QwtCounter (3) - Linux Manuals
NAME
QwtCounter -
SYNOPSIS
#include <qwt_counter.h>
Public Types
enum Button { Button1, Button2, Button3, ButtonCnt }
Button index. 
Public Slots
void setValue (double)
Set a new value without adjusting to the step raster. 
Signals
void buttonReleased (double value)
void valueChanged (double value)
Public Member Functions
QwtCounter (QWidget *parent=NULL)
virtual ~QwtCounter ()
Destructor. 
void setValid (bool)
bool isValid () const 
void setWrapping (bool)
En/Disable wrapping. 
bool wrapping () const 
bool isReadOnly () const 
void setReadOnly (bool)
Allow/disallow the user to manually edit the value. 
void setNumButtons (int n)
int numButtons () const 
void setIncSteps (QwtCounter::Button btn, int nSteps)
int incSteps (QwtCounter::Button btn) const 
virtual QSize sizeHint () const 
A size hint. 
double singleStep () const 
void setSingleStep (double s)
Set the step size of the counter. 
void setRange (double min, double max)
Set the minimum and maximum values. 
double minimum () const 
void setMinimum (double min)
double maximum () const 
void setMaximum (double max)
void setStepButton1 (int nSteps)
int stepButton1 () const 
returns the number of increment steps for button 1 
void setStepButton2 (int nSteps)
int stepButton2 () const 
returns the number of increment steps for button 2 
void setStepButton3 (int nSteps)
int stepButton3 () const 
returns the number of increment steps for button 3 
double value () const 
Protected Member Functions
virtual bool event (QEvent *)
virtual void wheelEvent (QWheelEvent *)
virtual void keyPressEvent (QKeyEvent *)
Detailed Description
The Counter Widget.
A Counter consists of a label displaying a number and one ore more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value.
A counter has a range from a minimum value to a maximum value and a step size. When the wrapping property is set the counter is circular.
The number of steps by which a button increments or decrements the value can be specified using setIncSteps(). The number of buttons can be changed with setNumButtons().
Example:
#include <qwt_counter.h> QwtCounter *counter = new QwtCounter(parent); counter->setRange(0.0, 100.0); // From 0.0 to 100 counter->setSingleStep( 1.0 ); // Step size 1.0 counter->setNumButtons(2); // Two buttons each side counter->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step counter->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps connect(counter, SIGNAL(valueChanged(double)), myClass, SLOT(newValue(double)));
 
 
Button index. 
 
Enumerator
 
The default number of buttons is set to 2. The default increments are: 
 
 
Parameters:
 
 
Parameters:
 
 
Parameters:
 
Returns:
 
 
 
Returns:
 
Parameters:
 
See Also:
 
 
 
Returns:
 
See Also:
 
 
 
Returns:
 
See Also:
 
 
 
 
Parameters:
 
 
 
Returns:
 
See Also:
 
 
 
Returns:
 
See Also:
 
 
 
Returns:
 
See Also:
 
 
Parameters:
 
See Also:
 
 
Parameters:
 
See Also:
 
 
Parameters:
 
See Also:
 
Note:
 
 
Parameters:
 
See Also:
 
 
 
Set the minimum and maximum values. The maximum is adjusted if necessary to ensure that the range remains valid. The value might be modified to be inside of the range.
 
Parameters:
 
See Also:
 
 
 
Allow/disallow the user to manually edit the value. 
 
Parameters:
 
See Also:
 
 
 
Set the step size of the counter. A value <= 0.0 disables stepping
 
Parameters:
 
See Also:
 
 
Parameters:
 
 
Parameters:
 
 
Parameters:
 
 
When the counter is set to invalid, no numbers are displayed and the buttons are disabled.
 
Parameters:
 
See Also:
 
 
 
Set a new value without adjusting to the step raster. The state of the counter is set to be valid.
 
Parameters:
 
See Also:
 
Warning:
 
 
 
En/Disable wrapping. If wrapping is true stepping up from maximum() value will take you to the minimum() value and vice versa.
 
Parameters:
 
See Also:
 
 
 
Returns:
 
See Also:
 
 
 
Returns:
 
See Also:
 
 
Parameters:
 
 
Parameters:
 
 
 
Returns:
 
See Also:
 
 
 
Generated automatically by Doxygen for Qwt User's Guide from the source code.
 
 Member Enumeration Documentation
enum QwtCounter::Button
Constructor & Destructor Documentation
QwtCounter::QwtCounter (QWidget *parent = NULL) [explicit]
The counter is initialized with a range is set to [0.0, 1.0] with 0.01 as single step size. The value is invalid.
Member Function Documentation
void QwtCounter::buttonReleased (doublevalue) [signal]
This signal is emitted when a button has been released 
bool QwtCounter::event (QEvent *event) [protected],  [virtual]
Handle QEvent::PolishRequest events 
int QwtCounter::incSteps (QwtCounter::Buttonbutton) const
bool QwtCounter::isReadOnly () const
bool QwtCounter::isValid () const
void QwtCounter::keyPressEvent (QKeyEvent *event) [protected],  [virtual]
Handle key events
 
 
 
 
 
 
 
 double QwtCounter::maximum () const
double QwtCounter::minimum () const
int QwtCounter::numButtons () const
void QwtCounter::setIncSteps (QwtCounter::Buttonbutton, intnumSteps)
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
numSteps Number of steps
void QwtCounter::setMaximum (doublevalue)
Set the maximum value of the range
void QwtCounter::setMinimum (doublevalue)
Set the minimum value of the range
void QwtCounter::setNumButtons (intnumButtons)
Specify the number of buttons on each side of the label
void QwtCounter::setRange (doublemin, doublemax)
max Maximum value
void QwtCounter::setReadOnly (boolon)
void QwtCounter::setSingleStep (doublestepSize)
void QwtCounter::setStepButton1 (intnSteps)
Set the number of increment steps for button 1 
void QwtCounter::setStepButton2 (intnSteps)
Set the number of increment steps for button 2 
void QwtCounter::setStepButton3 (intnSteps)
Set the number of increment steps for button 3 
void QwtCounter::setValid (boolon)
Set the counter to be in valid/invalid state
void QwtCounter::setValue (doublevalue) [slot]
void QwtCounter::setWrapping (boolon)
double QwtCounter::singleStep () const
double QwtCounter::value () const
void QwtCounter::valueChanged (doublevalue) [signal]
This signal is emitted when the counter's value has changed 
void QwtCounter::wheelEvent (QWheelEvent *event) [protected],  [virtual]
Handle wheel events 
bool QwtCounter::wrapping () const
Author