madgui.widget.quantity module¶
Utility classes for creating widgets holding physical quantities.
Classes
|
Base class for controls showing a prefix/suffix surrounding an editable value in a QLineEdit. |
Use this validator instead of QDoubleValidator to avoid allowing |
|
|
Base class for widgets displaying values from an ordered set. |
|
Base class for widgets displaying physical quantities. |
|
Readonly line-edit showing a quantity. |
-
class
madgui.widget.quantity.
AffixControlBase
(*args, **kwargs)[source]¶ Bases:
object
Base class for controls showing a prefix/suffix surrounding an editable value in a QLineEdit.
Methods
focusInEvent
(event)format
(value)keyPressEvent
(event)parse
(value)sanitize
(value)set_value
(value[, update])stripped
(text)textFromValue
(value)validate
(text, pos)valueFromText
(text)Attributes
str(object=’’) -> str
-
placeholder_text
= ''¶
-
property
prefix
¶
-
property
suffix
¶
-
validator
= None¶
-
property
value
¶
-
-
class
madgui.widget.quantity.
DoubleValidator
[source]¶ Bases:
PyQt5.QtGui.QValidator
Use this validator instead of QDoubleValidator to avoid allowing numbers in the current locale…
Methods
validate
(self, str, int)-
maximum
= None¶
-
minimum
= None¶
-
-
class
madgui.widget.quantity.
ExpressionValidator
[source]¶ Bases:
PyQt5.QtGui.QValidator
Methods
parse
(text)validate
(self, str, int)
-
class
madgui.widget.quantity.
QuantityControlBase
(parent=None, value=None, unit=None)[source]¶ Bases:
madgui.widget.quantity.ValueControlBase
Base class for widgets displaying physical quantities.
Attributes
Methods
format
(value)get_unit
()parse
(text)set_magnitude
(magnitude)set_quantity
(value)set_quantity_checked
(value)set_unit
(unit)-
property
fmtspec
¶
-
property
magnitude
¶
-
property
quantity
¶
-
property
unit
¶
-
property
-
class
madgui.widget.quantity.
QuantityDisplay
(*args, **kwargs)[source]¶ Bases:
madgui.widget.quantity.QuantityControlBase
,PyQt5.QtWidgets.QLineEdit
Readonly line-edit showing a quantity.
Methods
mousePressEvent
(self, QMouseEvent)mouseReleaseEvent
(self, QMouseEvent)Attributes
Signal<<class ‘object’>>
-
valueChanged
¶ Signal<<class ‘object’>>
-
-
class
madgui.widget.quantity.
ValueControlBase
(*args, **kwargs)[source]¶ Bases:
madgui.widget.quantity.AffixControlBase
Base class for widgets displaying values from an ordered set.
Methods
round_value
(value)sanitize
(value)set_range
(minimum, maximum)Attributes
-
property
maximum
¶
-
property
minimum
¶
-
property
range
¶
-
property