TaurusValueLabel

Inheritance diagram of TaurusValueLabel

class TaurusValueLabel(parent=None, designMode=False, background='quality')[source]

Bases: PyQt4.QtGui.QLabel, taurus.qt.qtgui.base.taurusbase.TaurusBaseWidget

A widget that represents the read value of an attribute.

Deprecated since version Use: taurus.qt.qtgui.display.TaurusLabel instead.

The following features are present:

  • The background color changes with the attribute quality according to the Taurus color guide
  • The attribute value is displayed according to the attribute format
  • Supports all data types and formats (although it is designed mainly for SCALAR format)
  • A tooltip is automatically generated displaying additional attribute information
  • If the size of the widget is too small to display the entire value, the text changes to a symbolic link that opens a dialog with the attribute value when clicked

This widget emits the following signals (excluding signals of the super classes):

modelChanged:
  • Signature: modelChanged(const QString &) -> None
  • Description: the signal is emmited when the model for this widget changes either by direct model manipulation, change of the useParentModel and change of the parent model (if useParentModel is set to True)

Example:

import sys
from taurus.external.qt import Qt
from taurus.qt.qtgui.display import TaurusValueLabel

app = Qt.QApplication(sys.argv)

w = TaurusValueLabel()
w.model = 'sys/taurustest/1/position'

w.setVisible(True)
sys.exit(app.exec_())
../../../../../../_images/label01.png
defineBackground(background)[source]
getFormatedToolTip(cache=True, showValue=False)[source]
getModelClass()[source]
classmethod getQtDesignerPluginInfo()[source]
getShowState()[source]

either or not to show the state as a background color

getShowValueStateAsBackground()[source]

either or not to show the state as a background color

handleEvent(evt_src, evt_type, evt_value)[source]

reimplemented to check that the display fits the size each time that the value changes

isReadOnly()[source]
minimumSizeHint()[source]
model

This property holds the unique URI string representing the model name with which this widget will get its data from. The convention used for the string can be found here.

In case the property useParentModel is set to True, the model text must start with a ‘/’ followed by the attribute name.

Access functions:

See also

model concept

resetShowState()[source]
resetShowValueStateAsBackground()[source]
resizeEvent(event)[source]
setModel(m)[source]
setShowState(showState)[source]

Whether or not to show the device state as background color. Note: obviously, setShowState(True) forces setShowQuality(False) !

setShowValueStateAsBackground(showState)[source]

Whether or not to show the value as background color. The attribute value must be a state! Note: obviously, forces setShowState(False) and setShowQuality(False)

showFullValueDialog(*args)[source]
showQuality

This property holds whether or not this widget should fill the background with the attribute quality/device state according to the Taurus color guide

Access functions:

  • TaurusBaseWidget.getShowQuality()
  • TaurusBaseWidget.setShowQuality()
  • TaurusBaseWidget.resetShowQuality()
showText

This property holds whether or not this widget should display the current value of the model as text. Setting this to False is useful when you just want to represent the quality/state as background color in a small space

Access functions:

  • TaurusBaseWidget.getShowText()
  • TaurusBaseWidget.setShowText()
  • TaurusBaseWidget.resetShowText()
taurusPopupMenu

This property holds the contents of a the popup menu as an XML string.

Access functions:

  • TaurusBaseWidget.getTaurusPopupMenu()
  • TaurusBaseWidget.setTaurusPopupMenu()
  • TaurusBaseWidget.resetTaurusPopupMenu()
updateStyle(extra='')[source]
useParentModel

This property holds whether or not this widget should search in the widget hierarchy for a model prefix in a parent widget.

Access functions:

  • TaurusBaseWidget.getUseParentModel()
  • TaurusBaseWidget.setUseParentModel()
  • TaurusBaseWidget.resetUseParentModel()

See also

model concept

validateDisplay()[source]

Checks that the display fits in the widget and sets it to ”...” if it does not