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?)

  • parent NodeWidget (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.

  • val number - 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.

  • max number - 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.

spinBox.setSuffix(suffix)

Sets the suffix of the spinBox. It calls the native method QSpinBox: setSuffix.

spinBox.setSingleStep(val)

Sets the single step value of the spinBox. It calls the native method QSpinBox: setSingleStep.

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.