The QtBasicDialGauge class provides a basic dial gauge with SVG graphics. More...
#include <qtbasicdialgauge.h>
Public Slots | |
void | setValue (int value) |
void | setMaximum (int maximum) |
void | setMinimum (int minimum) |
void | setRange (int minimum, int maximum) |
Signals | |
void | valueChanged (int value) |
Public Member Functions | |
QtBasicDialGauge (QWidget *parent=0) | |
~QtBasicDialGauge () | |
int | maximum () const |
int | minimum () const |
int | value () const |
Protected Member Functions | |
virtual void | paintEvent (QPaintEvent *event) |
virtual QSize | sizeHint () const |
void | init () |
The QtBasicDialGauge class provides a basic dial gauge with SVG graphics.
The description of the QtBasicDialGauge.
The QtBasicDialGauge is an example to show the capabilities of the Qt Framework related to customized controls.
Here is a possible implementation shown
// Create a QtSvgDialGauge QWidget * widget = new QWidget(this) QtBasicDialGauge * gauge = new QtBasicDialGauge(widget); gauge->setRange(0, 100); gauge->setValue(0): widget->addWidget(gauge); widget->show();
The signal valueChanged() is emitted when the QtBasicDialGauge value has changed, with the new value as argument.
The most useful functions are setValue() to set the QtBasicDialGauge directly to some value.
With the function setRange() it is possible to set the smallest and biggest visible value.The values can be set seperatly with setMinimum() and setMaximum(). The actual minimum and maximum value can be read over the minimum() and maximum() function.
Signals
QtBasicDialGauge::QtBasicDialGauge | ( | QWidget * | parent = 0 |
) | [explicit] |
Constructor of the widget with parent
as Parent.
QtBasicDialGauge::~QtBasicDialGauge | ( | ) |
Destructor
int QtBasicDialGauge::maximum | ( | ) | const |
Returns the set maximum value.
int QtBasicDialGauge::minimum | ( | ) | const |
Returns the set minimum value.
void QtBasicDialGauge::setMaximum | ( | int | maximum | ) | [slot] |
void QtBasicDialGauge::setMinimum | ( | int | minimum | ) | [slot] |
void QtBasicDialGauge::setRange | ( | int | minimum, | |
int | maximum | |||
) | [slot] |
Sets the minimum and maximum value if minimum < maximum
References setMaximum(), and setMinimum().
Referenced by ScrollDialPopup::setRange().
void QtBasicDialGauge::setValue | ( | int | value | ) | [slot] |
Sets the actual value if the value is >= minimum() and value is <= maximum().
Referenced by ScrollDialPopup::setValue().
int QtBasicDialGauge::value | ( | ) | const |
Returns the actual value.