QwtCounter Class Reference
The Counter Widget.
More...
#include <qwt_counter.h>
List of all members.
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:
Member Enumeration Documentation
Constructor & 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:
-
QwtCounter::~QwtCounter |
( |
|
) |
[virtual] |
Member Function Documentation
void QwtCounter::buttonReleased |
( |
double |
value |
) |
[signal] |
This signal is emitted when a button has been released
- Parameters:
-
bool QwtCounter::editable |
( |
|
) |
const |
returns whether the line edit is edatble. (default is yes)
bool QwtCounter::event |
( |
QEvent * |
e |
) |
[protected, virtual] |
Handle PolishRequest events
- Returns:
- the number of steps by which a specified button increments the value or 0 if the button is invalid.
- Parameters:
-
| btn | One of QwtCounter::Button1 , QwtCounter::Button2 , QwtCounter::Button3 |
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)
double QwtCounter::maxVal |
( |
|
) |
const |
returns the maximum value of the range
double QwtCounter::minVal |
( |
|
) |
const |
returns the minimum value of the range
int QwtCounter::numButtons |
( |
|
) |
const |
- Returns:
- The number of buttons on each side of the widget.
void QwtCounter::polish |
( |
|
) |
[virtual] |
Sets the minimum width for the buttons
void 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 |
( |
bool |
editable |
) |
|
Allow/disallow the user to manually edit the value.
- Parameters:
-
| editable | true enables editing |
- See also:
- editable()
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
- Parameters:
-
| btn | One of QwtCounter::Button1 , QwtCounter::Button2 , QwtCounter::Button3 |
| nSteps | Number of steps |
void QwtCounter::setMaxValue |
( |
double |
value |
) |
|
void QwtCounter::setMinValue |
( |
double |
value |
) |
|
void QwtCounter::setNumButtons |
( |
int |
n |
) |
|
Specify the number of buttons on each side of the label.
- Parameters:
-
void QwtCounter::setStep |
( |
double |
stepSize |
) |
|
void QwtCounter::setStepButton1 |
( |
int |
nSteps |
) |
|
Set the number of increment steps for button 1
- Parameters:
-
void QwtCounter::setStepButton2 |
( |
int |
nSteps |
) |
|
Set the number of increment steps for button 2
- Parameters:
-
void QwtCounter::setStepButton3 |
( |
int |
nSteps |
) |
|
Set the number of increment steps for button 3
- Parameters:
-
void QwtCounter::setValue |
( |
double |
v |
) |
[virtual] |
QSize QwtCounter::sizeHint |
( |
|
) |
const [virtual] |
double QwtCounter::step |
( |
|
) |
const |
int QwtCounter::stepButton1 |
( |
|
) |
const |
returns the number of increment steps for button 1
int QwtCounter::stepButton2 |
( |
|
) |
const |
returns the number of increment steps for button 2
int QwtCounter::stepButton3 |
( |
|
) |
const |
returns the number of increment steps for button 3
double QwtCounter::value |
( |
|
) |
const [virtual] |
void QwtCounter::valueChanged |
( |
double |
value |
) |
[signal] |
This signal is emitted when the counter's value has changed
- Parameters:
-
void QwtCounter::wheelEvent |
( |
QWheelEvent * |
e |
) |
[protected, virtual] |
Handle wheel events
- Parameters:
-