Class: QgsDoubleSpinBox¶
-
class
qgis.gui.
QgsDoubleSpinBox
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QDoubleSpinBox
Constructor for QgsDoubleSpinBox.
- Parameters
parent – parent widget
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.
Enums
Methods
Sets the current value to the value defined by the clear value.
Returns the value used when clear() is called.
Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.
Defines the clear value as a custom value and will automatically set the clear value mode to CustomValue.
Defines if the clear value should be the minimum or maximum values of the widget or a custom value.
Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.
Set alignment in the embedded line edit widget
Sets whether the widget will show a clear button.
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().Returns whether the widget is showing a clear button.
Signals
Attributes
-
class
ClearValueMode
¶ Bases:
int
-
CustomValue
= 2¶
-
MaximumValue
= 1¶
-
MinimumValue
= 0¶
-
actionEvent
()¶
-
changeEvent
(self, event: QEvent)¶
-
childEvent
()¶
-
clear
(self)¶ Sets the current value to the value defined by the clear value.
-
clearValue
(self) → float¶ Returns the value used when clear() is called.
See also
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
expressionsEnabled
(self) → bool¶ Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.
- Returns
true if spin box allows expression entry
New in version 2.7.
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
lineEdit
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
(self, e: QPaintEvent)¶
-
receivers
()¶
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setClearValue
(self, customValue: float, clearValueText: str = '')¶ 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.
See also
-
setClearValueMode
(self, mode: QgsDoubleSpinBox.ClearValueMode, clearValueText: str = '')¶ 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.
-
setExpressionsEnabled
(self, enabled: bool)¶ 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
New in version 2.7.
-
setLineEdit
()¶
-
setLineEditAlignment
(self, alignment: Union[Qt.Alignment, Qt.AlignmentFlag])¶ Set alignment in the embedded line edit widget
- Parameters
alignment –
-
setShowClearButton
(self, showClearButton: bool)¶ Sets whether the widget will show a clear button. The clear button allows users to reset the widget to a default or empty state.
- Parameters
showClearButton – set to true to show the clear button, or false to hide it
See also
-
setSpecialValueText
(self, txt: str)¶ 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.
-
showClearButton
(self) → bool¶ Returns whether the widget is showing a clear button.
See also
-
showEvent
()¶
-
stepEnabled
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
validate
(self, input: str) → Tuple[QValidator.State, int]¶
-
valueFromText
(self, text: str) → float¶
-
wheelEvent
(self, event: QWheelEvent)¶