QwtCounter(3) | Qwt User's Guide | QwtCounter(3) |
NAME¶
QwtCounter -SYNOPSIS¶
#include <qwt_counter.h>
Inherits QwtDoubleRange.
Public Types¶
enum Button { Button1, Button2, Button3, ButtonCnt }
Signals¶
void buttonReleased (double value)
void valueChanged (double value)
Public Member Functions¶
QwtCounter (QWidget *parent=NULL)
virtual ~QwtCounter ()
bool editable () const
int incSteps (QwtCounter::Button btn) const
double maxVal () const
double minVal () const
int numButtons () const
virtual void polish ()
void setEditable (bool)
void setIncSteps (QwtCounter::Button btn, int nSteps)
void setMaxValue (double m)
void setMinValue (double m)
void setNumButtons (int n)
void setStep (double s)
void setStepButton1 (int nSteps)
void setStepButton2 (int nSteps)
void setStepButton3 (int nSteps)
virtual void setValue (double)
virtual QSize sizeHint () const
double step () const
int stepButton1 () const
int stepButton2 () const
int stepButton3 () const
virtual double value () const
Protected Member Functions¶
virtual bool event (QEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void rangeChange ()
virtual void wheelEvent (QWheelEvent *)
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. The range can be specified using QwtDblRange::setRange(). The counter's value is an integer multiple of the step size. The number of steps by which a button increments or decrements the value can be specified using QwtCounter::setIncSteps(). The number of buttons can be changed with QwtCounter::setNumButtons().
Holding the space bar down with focus on a button is the fastest method to step through the counter values. When the counter underflows/overflows, the focus is set to the smallest up/down button and counting is disabled. Counting is re-enabled on a button release event (mouse or space bar).
Example:
#include '../include/qwt_counter.h> QwtCounter *cnt; cnt = new QwtCounter(parent, name); cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0 cnt->setNumButtons(2); // Two buttons each side cnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step cnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));
Member Enumeration Documentation¶
enum QwtCounter::Button¶
Button indexConstructor & Destructor Documentation¶
QwtCounter::QwtCounter (QWidget *parent = NULL) [explicit]¶
The default number of buttons is set to 2. The default increments are:- Button 1: 1 step
- Button 2: 10 steps
- Button 3: 100 steps
Parameters:
Member Function Documentation¶
void QwtCounter::buttonReleased (doublevalue) [signal]¶
This signal is emitted when a button has been releasedParameters:
bool QwtCounter::event (QEvent *e) [protected], [virtual]¶
Handle PolishRequest eventsint QwtCounter::incSteps (QwtCounter::Buttonbtn) const¶
Returns:Parameters:
void QwtCounter::keyPressEvent (QKeyEvent *e) [protected], [virtual]¶
Handle key events- Ctrl + Qt::Key_Home Step to minValue()
- Ctrl + Qt::Key_End Step to maxValue()
- Qt::Key_Up Increment by incSteps(QwtCounter::Button1)
- Qt::Key_Down Decrement by incSteps(QwtCounter::Button1)
- Qt::Key_PageUp Increment by incSteps(QwtCounter::Button2)
- Qt::Key_PageDown Decrement by incSteps(QwtCounter::Button2)
- Shift + Qt::Key_PageUp Increment by incSteps(QwtCounter::Button3)
- Shift + Qt::Key_PageDown Decrement by incSteps(QwtCounter::Button3)
int QwtCounter::numButtons () const¶
Returns:void QwtCounter::polish () [virtual]¶
Sets the minimum width for the buttonsvoid QwtCounter::rangeChange () [protected], [virtual]¶
Notify change of range. This function updates the enabled property of all buttons contained in QwtCounter.Reimplemented from QwtDoubleRange.
void QwtCounter::setEditable (booleditable)¶
Allow/disallow the user to manually edit the value. Parameters:See also:
void QwtCounter::setIncSteps (QwtCounter::Buttonbtn, intnSteps)¶
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.Parameters:
nSteps Number of steps
void QwtCounter::setMaxValue (doublevalue)¶
Set the maximum value of the rangeParameters:
See also:
void QwtCounter::setMinValue (doublevalue)¶
Set the minimum value of the rangeParameters:
See also:
void QwtCounter::setNumButtons (intn)¶
Specify the number of buttons on each side of the label. Parameters:void QwtCounter::setStep (doublestepSize)¶
Set the step sizeParameters:
See also:
Reimplemented from QwtDoubleRange.
void QwtCounter::setStepButton1 (intnSteps)¶
Set the number of increment steps for button 1Parameters:
void QwtCounter::setStepButton2 (intnSteps)¶
Set the number of increment steps for button 2Parameters:
void QwtCounter::setStepButton3 (intnSteps)¶
Set the number of increment steps for button 3Parameters:
void QwtCounter::setValue (doublev) [virtual]¶
Set a new value. Parameters:See also:
Reimplemented from QwtDoubleRange.
double QwtCounter::value () const [virtual]¶
Returns:Reimplemented from QwtDoubleRange.
void QwtCounter::valueChanged (doublevalue) [signal]¶
This signal is emitted when the counter's value has changedParameters:
void QwtCounter::wheelEvent (QWheelEvent *e) [protected], [virtual]¶
Handle wheel eventsParameters:
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.Tue Nov 20 2012 | Version 5.2.3 |