QSpinBox mySpinBox; mySpinBox.setRange(0, 100); mySpinBox.setPrefix("$"); mySpinBox.interpretText();In this example, we create a QSpinBox that accepts values from 0 to 100 and adds a dollar sign as a prefix. We then call interpretText to enable the widget to interpret text input as a value. Package library: QtWidgets.