TaurusValueLineEdit

Inheritance diagram of 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 a TaurusBaseWritableWidget and as such it does not apply the changes straight away to the model (unless autoApply 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:

bool

enableWheelEvent
forcedApply

whether forcedApply mode is enabled or not.

Returns:

True if forceApply is enabled. False otherwise

Return type:

bool

getEnableWheelEvent()[source]
classmethod getQtDesignerPluginInfo()[source]

reimplemented from TaurusBaseWidget

getSingleStep()[source]
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)

handleEvent(evt_src, evt_type, evt_value)[source]

reimplemented from TaurusBaseWidget

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:

bool

keyPressEvent(evt)[source]

Key press event handler

model

Returns the model name for this component.

Parameters:

key (object) – the model key. Defaults to first element of .modelKeys

Returns:

the model name.

Return type:

str

notifyValueChanged(*args)[source]

reimplement to avoid autoapply on every partial edition

resetEnableWheelEvent()[source]
resetSingleStep()[source]
setEnableWheelEvent(b)[source]
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)

setSingleStep(step)[source]
setValue(v)[source]

Set the displayed text from a given value object

updateStyle()[source]

Reimplemented from TaurusBaseWritableWidget

useParentModel

(deprecated))

wheelEvent(evt)[source]

Wheel event handler