#include <qwt_counter.h>
Inheritance diagram for QwtCounter::
Public Types | |
enum | Button { Button1, Button2, Button3, ButtonCnt } |
Signals | |
void | buttonReleased (double value) |
void | valueChanged (double value) |
Public Methods | |
QwtCounter (QWidget *parent=0, char *name=0) | |
void | setNumButtons (int n) |
int | numButtons () const |
void | setIncSteps (QwtCounter::Button btn, int nSteps) |
int | incSteps (QwtCounter::Button btn) const |
virtual void | setValue (double) |
virtual QSizePolicy | sizePolicy () const |
virtual QSize | sizeHint () const |
Protected Methods | |
virtual void | fontChange (const QFont &f) |
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().
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)));
|
Button index |
|
ctor.
The default number of buttons is set to 2. The default increments are:
|
|
This signal is emitted when a button has been released
|
|
Notify change of font.
This function updates the fonts of all widgets contained in QwtCounter.
|
|
|
|
|
|
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
|
|
Specify the number of buttons on each side of the label.
|
|
Set a new value.
Reimplemented from QwtDblRange. |
|
A size hint.
|
|
|
|
This signal is emitted when the counter's value has changed
|