TaurusValueLineEdit
- class TaurusValueLineEdit(qt_parent=None, designMode=False)[source]
A taurus-aware
QLineEdit
. It will display the value (or fragment of the value) referenced by its model. It is aTaurusBaseWritableWidget
and as such it does not apply the changes straight away to the model (unlessautoApply
is enabled), but instead shows that there are pending operations which can be applied by pressing “ENTER”.When used with numerical value Attributes as its model, it provides some extended behaviour:
It represents out-of-limit values using different colours (for warning, range, invalid,…)
It uses a validator that is range-aware
The mouse wheel and keyboard arrows can be enabled for doing value increments
Note
when used with models whose value is a pint Quantity, the text is parsed by pint and therefore one can write e.g. 2 3 mm which is equivalent to 6 mm !
Import from
taurus.qt.qtgui.input
as:from taurus.qt.qtgui.input import TaurusValueLineEdit
- autoApply
whether autoApply mode is enabled or not.
- Returns:
True if autoApply is enabled. False otherwise
- Return type:
- enableWheelEvent
- forcedApply
whether forcedApply mode is enabled or not.
- Returns:
True if forceApply is enabled. False otherwise
- Return type:
- getValue()[source]
This method must be implemented in derived classes to return the value to be written. Note that this may differ from the displayed value (e.g. for a numeric value being edited by a QLineEdit-based widget, the displayed value will be a string while getValue will return a number)
- isTextValid()[source]
Validates current text
- Returns:
Returns False if there is a validator and the current text is not Acceptable. Returns True otherwise.
- Return type:
- model
Returns the model name for this component.
- setEnabled(enabled)[source]
Reimplement from
QLineEdit
to avoid autoenabling if the widget is explicitly disabled (but allow auto-disabling if the widget is explicitly enabled)
- useParentModel
(deprecated))