| 
    QGIS API Documentation 3.99.0-Master (f78f5286a64)
    
   | 
 
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 Types | |
| enum | ClearValueMode { MinimumValue , MaximumValue , CustomValue } | 
| Behavior when widget is cleared.  More... | |
Public Slots | |
| void | setEditingTimeoutInterval (int timeout) | 
| Sets the timeout (in milliseconds) threshold for the editingTimeout() signal to be emitted after an edit.   | |
Signals | |
| void | editingTimeout (double value) | 
| Emitted when either:   | |
| void | returnPressed () | 
| Emitted when the Return or Enter key is used in the line edit.   | |
| void | textEdited (const QString &text) | 
| Emitted when the the value has been manually edited via line edit.   | |
Public Member Functions | |
| QgsDoubleSpinBox (QWidget *parent=nullptr) | |
| Constructor for QgsDoubleSpinBox.   | |
| void | clear () override | 
| Sets the current value to the value defined by the clear value.   | |
| double | clearValue () const | 
| Returns the value used when clear() is called.   | |
| int | editingTimeoutInterval () const | 
| Returns the timeout (in milliseconds) threshold for the editingTimeout() signal to be emitted after an edit.   | |
| bool | expressionsEnabled () const | 
| Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.   | |
| bool | isCleared () const | 
Returns true if the value is equal to the clear value.   | |
| void | paintEvent (QPaintEvent *e) override | 
| void | setClearValue (double customValue, const QString &clearValueText=QString()) | 
| Defines the clear value as a custom value and will automatically set the clear value mode to CustomValue.   | |
| void | setClearValueMode (ClearValueMode mode, const QString &clearValueText=QString()) | 
| Defines if the clear value should be the minimum or maximum values of the widget or a custom value.   | |
| void | setExpressionsEnabled (bool enabled) | 
| Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.   | |
| void | setLineEditAlignment (Qt::Alignment alignment) | 
| Set alignment in the embedded line edit widget.   | |
| void | setShowClearButton (bool showClearButton) | 
| Sets whether the widget will show a clear button.   | |
| void | setSpecialValueText (const QString &txt) | 
| Set the special-value text to be txt If set, the spin box will display this text instead of a numeric value whenever the current value is equal to minimum().   | |
| bool | showClearButton () const | 
| Returns whether the widget is showing a clear button.   | |
| void | stepBy (int steps) override | 
| QValidator::State | validate (QString &input, int &pos) const override | 
| double | valueFromText (const QString &text) const override | 
Protected Member Functions | |
| void | changeEvent (QEvent *event) override | 
| void | focusOutEvent (QFocusEvent *event) override | 
| void | timerEvent (QTimerEvent *event) override | 
| void | wheelEvent (QWheelEvent *event) override | 
Properties | |
| bool | clearValue | 
| bool | expressionsEnabled | 
| bool | showClearButton | 
Friends | |
| class | TestQgsRangeWidgetWrapper | 
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 44 of file qgsdoublespinbox.h.
Behavior when widget is cleared.
| Enumerator | |
|---|---|
| MinimumValue | Reset value to minimum()  | 
| MaximumValue | Reset value to maximum()  | 
| CustomValue | Reset value to custom value (see setClearValue() )  | 
Definition at line 62 of file qgsdoublespinbox.h.
      
  | 
  explicit | 
Constructor for QgsDoubleSpinBox.
| parent | parent widget | 
Definition at line 41 of file qgsdoublespinbox.cpp.
      
  | 
  overrideprotected | 
Definition at line 73 of file qgsdoublespinbox.cpp.
      
  | 
  override | 
Sets the current value to the value defined by the clear value.
Definition at line 171 of file qgsdoublespinbox.cpp.
| double QgsDoubleSpinBox::clearValue | ( | ) | const | 
Returns the value used when clear() is called.
Definition at line 216 of file qgsdoublespinbox.cpp.
      
  | 
  signal | 
Emitted when either:
This signal can be used to respond semi-instantly to changes in the spin box, without responding too quickly while the user in the middle of setting the value.
| int QgsDoubleSpinBox::editingTimeoutInterval | ( | ) | const | 
Returns the timeout (in milliseconds) threshold for the editingTimeout() signal to be emitted after an edit.
Definition at line 144 of file qgsdoublespinbox.cpp.
      
  | 
  inline | 
Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.
true if spin box allows expression entry Definition at line 101 of file qgsdoublespinbox.h.
      
  | 
  overrideprotected | 
Definition at line 107 of file qgsdoublespinbox.cpp.
| bool QgsDoubleSpinBox::isCleared | ( | ) | const | 
Returns true if the value is equal to the clear value. 
Definition at line 319 of file qgsdoublespinbox.cpp.
      
  | 
  override | 
Definition at line 124 of file qgsdoublespinbox.cpp.
      
  | 
  signal | 
Emitted when the Return or Enter key is used in the line edit.
| void QgsDoubleSpinBox::setClearValue | ( | double | customValue, | 
| const QString & | clearValueText = QString()  | 
        ||
| ) | 
Defines the clear value as a custom value and will automatically set the clear value mode to CustomValue.
| 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 178 of file qgsdoublespinbox.cpp.
| void QgsDoubleSpinBox::setClearValueMode | ( | QgsDoubleSpinBox::ClearValueMode | mode, | 
| const QString & | clearValueText = QString()  | 
        ||
| ) | 
Defines if the clear value should be the minimum or maximum values of the widget or a custom value.
| 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 197 of file qgsdoublespinbox.cpp.
      
  | 
  slot | 
Sets the timeout (in milliseconds) threshold for the editingTimeout() signal to be emitted after an edit.
Definition at line 149 of file qgsdoublespinbox.cpp.
| void QgsDoubleSpinBox::setExpressionsEnabled | ( | bool | enabled | ) | 
Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.
| enabled | set to true to allow expression entry  | 
Definition at line 68 of file qgsdoublespinbox.cpp.
| void QgsDoubleSpinBox::setLineEditAlignment | ( | Qt::Alignment | alignment | ) | 
Set alignment in the embedded line edit widget.
| alignment | 
Definition at line 226 of file qgsdoublespinbox.cpp.
| void QgsDoubleSpinBox::setShowClearButton | ( | bool | showClearButton | ) | 
Sets whether the widget will show a clear button.
The clear button allows users to reset the widget to a default or empty state.
| showClearButton | set to true to show the clear button, or false to hide it  | 
Definition at line 62 of file qgsdoublespinbox.cpp.
| void QgsDoubleSpinBox::setSpecialValueText | ( | const QString & | txt | ) | 
Set the special-value text to be txt If set, the spin box will display this text instead of a numeric value whenever the current value is equal to minimum().
Typical use is to indicate that this choice has a special (default) meaning.
Definition at line 231 of file qgsdoublespinbox.cpp.
      
  | 
  inline | 
Returns whether the widget is showing a clear button.
Definition at line 87 of file qgsdoublespinbox.h.
      
  | 
  override | 
Definition at line 130 of file qgsdoublespinbox.cpp.
      
  | 
  signal | 
Emitted when the the value has been manually edited via line edit.
      
  | 
  overrideprotected | 
Definition at line 113 of file qgsdoublespinbox.cpp.
      
  | 
  override | 
Definition at line 294 of file qgsdoublespinbox.cpp.
      
  | 
  override | 
Definition at line 278 of file qgsdoublespinbox.cpp.
      
  | 
  overrideprotected | 
Definition at line 85 of file qgsdoublespinbox.cpp.
      
  | 
  friend | 
Definition at line 236 of file qgsdoublespinbox.h.
      
  | 
  readwrite | 
Definition at line 57 of file qgsdoublespinbox.h.
      
  | 
  readwrite | 
Definition at line 58 of file qgsdoublespinbox.h.
      
  | 
  readwrite | 
Definition at line 56 of file qgsdoublespinbox.h.