3.0 KiB
Class: QSpinBox
Create and control spin box widgets.
This class is a JS wrapper around Qt's QSpinBox class
A QSpinBox provides ability to add and manipulate native spin box widgets.
QSpinBox inherits from NodeWidget
Example
const { QSpinBox } = require("@nodegui/nodegui");
const spinBox = new QSpinBox();
new QSpinBox(parent?)
parentNodeWidget (optional). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
Static Methods
QSpinBox can access all the static methods defined in NodeWidget
Instance Properties
QSpinBox can access all the instance properties defined in NodeWidget
Instance Methods
QSpinBox can access all the instance methods defined in NodeWidget. Additionally it also has the following instance methods:
spinBox.setValue(val)
Sets the current value of the spinBox. It calls the native method QSpinBox: setValue.
valnumber - Set the value as current value
spinBox.setRange(minimum, maximum)
Sets the min/max value of the spinBox. It calls the native method QSpinBox: setRange.
maxnumber - Set the value as max value of the progress bar.
spinBox.setPrefix(prefix)
Sets the prefix of the spinBox. It calls the native method QSpinBox: setPrefix.
prefixstring - Specifies prefix content shows before the spinBox value. Prefix is an enum from Qt
spinBox.setSuffix(suffix)
Sets the suffix of the spinBox. It calls the native method QSpinBox: setSuffix.
suffixstring - Specifies suffix content shows after the spinBox value. Suffix is an enum from Qt
spinBox.setSingleStep(val)
Sets the single step value of the spinBox. It calls the native method QSpinBox: setSingleStep.
valnumber - Specifies amount value changes with each step. Suffix is an enum from Qt
spinBox.cleanText()
Returns the text content (String) of the spinBox excluding any prefix, suffix, or leading or trailing whitespace. It calls the native method QSpinBox: value.
spinBox.minimum()
Returns the minimum value (Number) of the spinBox. It calls the native method QSpinBox: value.
spinBox.maximum()
Returns the maximum value (Number) of the spinBox. It calls the native method QSpinBox: value.
spinBox.value()
Returns the current value (Number) of the spinBox. It calls the native method QSpinBox: value.