madgui.widget.spinbox module

Custom spin box widgets.

Classes

AbstractSpinBox(*args, **kwargs)

Base class for custom spinbox controls.

QuantitySpinBox(*args, **kwargs)

ExpressionSpinBox(*args, **kwargs)

class madgui.widget.spinbox.AbstractSpinBox(*args, **kwargs)[source]

Bases: madgui.widget.quantity.ValueControlBase, PyQt5.QtWidgets.QAbstractSpinBox

Base class for custom spinbox controls.

Subclassing QAbstractSpinBox or QDoubleSpinBox directly with PyQt is hard, because they do not expose access to several crucial APIs:

  • prefix and suffix (QAbstractSpinBox)

  • no null values,

  • can’t control round()

  • NaN is reset to maximum in bound()

  • no unit editing

  • rounding is ‘f’-based

Methods

clear(self)

fixup(self, str)

keyPressEvent(self, QKeyEvent)

sizeHint(self)

stepBy(self, int)

stepEnabled(self)

clear(self)[source]
fixup(self, str)str[source]
keyPressEvent(self, QKeyEvent)[source]
sizeHint(self) → QSize[source]
step = None
stepBy(self, int)[source]
stepEnabled(self) → QAbstractSpinBox.StepEnabled[source]
typical = None
class madgui.widget.spinbox.ExpressionSpinBox(*args, **kwargs)[source]

Bases: madgui.widget.spinbox.QuantitySpinBox

Methods

format(value)

parse(text)

stepEnabled(self)

format(value)[source]
parse(text)[source]
stepEnabled(self) → QAbstractSpinBox.StepEnabled[source]
class madgui.widget.spinbox.QuantitySpinBox(*args, **kwargs)[source]

Bases: madgui.widget.quantity.QuantityControlBase, madgui.widget.spinbox.AbstractSpinBox

Methods

line_edit()

updateEdit()

update_step(value)

Attributes

step

float(x) -> floating point number

typical

float(x) -> floating point number

valueChanged

Signal<<class ‘object’>>

line_edit()[source]
step = 1.0
typical = 3.3333333333333335e-17
updateEdit()[source]
update_step(value)[source]
valueChanged

Signal<<class ‘object’>>