# msl.qt.widgets.spinboxes module¶

Custom QtWidgets.QDoubleSpinBox and QtWidgets.QSpinBox classes.

In situations where the value of the spinbox is used to represent the position/value of equipment in the laboratory one typically does not want to connect the valueChanged() signal of the spinbox to change the value of the equipment because each numeric key press would be sent to the equipment. For example, if you wanted to set the position/value of the equipment to 1234 then typing the value 1234 in the spinbox would send:

• 1 $$\rightarrow$$ set the value of the equipment to be 1

• 12 $$\rightarrow$$ set the value of the equipment to be 12

• 123 $$\rightarrow$$ set the value of the equipment to be 123

• 1234 $$\rightarrow$$ set the value of the equipment to be 1234

These custom QAbstractSpinBox subclasses will emit the editingFinished() signal when any of the following events occur:

• the spinbox loses focus

• the Enter key is pressed

• the Up, Down, PageUp or PageDown keys are pressed

• the Increment and Decrement buttons are clicked

class msl.qt.widgets.spinboxes.SpinBox(*, parent=None, value=0, minimum=0, maximum=100, step=1, unit='', tooltip='', value_changed=None, editing_finished=None)[source]

Bases: QSpinBox

A QSpinBox that emits editingFinished() after a stepBy() signal.

Parameters
class msl.qt.widgets.spinboxes.DoubleSpinBox(*, parent=None, value=0, minimum=0, maximum=100, step=1, decimals=2, use_si_prefix=False, unit='', tooltip='', value_changed=None, editing_finished=None)[source]

Bases: QDoubleSpinBox

A QDoubleSpinBox that emits editingFinished() after a stepBy() signal.

Parameters
validate(text, position)[source]
fixup(text)[source]
valueFromText(text)[source]
textFromValue(value)[source]
setValue(value)[source]