The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
More...
#include <qgsdoublespinbox.h>
Public Member Functions |
| QgsDoubleSpinBox (QWidget *parent=0) |
virtual void | clear () override |
| Set the current value to the value defined by the clear value.
|
double | clearValue () const |
| returns the value used when clear() is called.
|
bool | expressionsEnabled () const |
| Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.
|
void | setClearValue (double customValue, QString clearValueText=QString()) |
| setClearValue defines the clear value as a custom value and will automatically set the clear value mode to CustomValue
|
void | setClearValueMode (ClearValueMode mode, QString clearValueText=QString()) |
| setClearValueMode defines if the clear value should be the minimum or maximum values of the widget or a custom value
|
void | setExpressionsEnabled (const bool enabled) |
| Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.
|
void | setShowClearButton (const bool showClearButton) |
| determines if the widget will show a clear button
|
bool | showClearButton () const |
virtual QValidator::State | validate (QString &input, int &pos) const override |
virtual double | valueFromText (const QString &text) const override |
Protected Member Functions |
virtual void | changeEvent (QEvent *event) override |
virtual void | paintEvent (QPaintEvent *event) override |
virtual void | resizeEvent (QResizeEvent *event) override |
Detailed Description
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
The clear value can be either the minimum or the maiximum value of the spin box or a custom value. This value can then be handled by a special value text.
Definition at line 27 of file qgsdoublespinbox.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
QgsDoubleSpinBox::QgsDoubleSpinBox |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
Member Function Documentation
void QgsDoubleSpinBox::changeEvent |
( |
QEvent * |
event | ) |
|
|
overrideprotectedvirtual |
void QgsDoubleSpinBox::clear |
( |
| ) |
|
|
overridevirtual |
Set the current value to the value defined by the clear value.
Definition at line 77 of file qgsdoublespinbox.cpp.
double QgsDoubleSpinBox::clearValue |
( |
| ) |
const |
bool QgsDoubleSpinBox::expressionsEnabled |
( |
| ) |
const |
|
inline |
Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.
- Returns
- true if spin box allows expression entry
- Note
- added in QGIS 2.7
Definition at line 59 of file qgsdoublespinbox.h.
void QgsDoubleSpinBox::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotectedvirtual |
void QgsDoubleSpinBox::resizeEvent |
( |
QResizeEvent * |
event | ) |
|
|
overrideprotectedvirtual |
void QgsDoubleSpinBox::setClearValue |
( |
double |
customValue, |
|
|
QString |
clearValueText = QString() |
|
) |
| |
setClearValue defines the clear value as a custom value and will automatically set the clear value mode to CustomValue
- Parameters
-
customValue | defines the numerical value used as the clear value |
clearValueText | is the text displayed when the spin box is at the clear value. If not specified, no special value text is used. |
Definition at line 82 of file qgsdoublespinbox.cpp.
setClearValueMode defines if the clear value should be the minimum or maximum values of the widget or a custom value
- Parameters
-
mode | mode to user for clear value |
clearValueText | is the text displayed when the spin box is at the clear value. If not specified, no special value text is used. |
Definition at line 96 of file qgsdoublespinbox.cpp.
void QgsDoubleSpinBox::setExpressionsEnabled |
( |
const bool |
enabled | ) |
|
Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.
- Parameters
-
enabled | set to true to allow expression entry |
- Note
- added in QGIS 2.7
Definition at line 55 of file qgsdoublespinbox.cpp.
void QgsDoubleSpinBox::setShowClearButton |
( |
const bool |
showClearButton | ) |
|
determines if the widget will show a clear button
- Note
- the clear button will set the widget to its minimum value
Definition at line 49 of file qgsdoublespinbox.cpp.
bool QgsDoubleSpinBox::showClearButton |
( |
| ) |
const |
|
inline |
QValidator::State QgsDoubleSpinBox::validate |
( |
QString & |
input, |
|
|
int & |
pos |
|
) |
| const |
|
overridevirtual |
double QgsDoubleSpinBox::valueFromText |
( |
const QString & |
text | ) |
const |
|
overridevirtual |
Property Documentation
bool QgsDoubleSpinBox::expressionsEnabled |
|
readwrite |
bool QgsDoubleSpinBox::showClearButton |
|
readwrite |
The documentation for this class was generated from the following files: