TaurusLabel
¶
digraph inheritancec55afafd7c {
rankdir=UD;
ratio=compress;
size="8.0, 12.0";
"BaseConfigurableClass" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A base class defining the API for configurable objects."];
"Logger" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The taurus logger class. All taurus pertinent classes should inherit"];
"Object" -> "Logger" [arrowsize=0.5,style="setlinewidth(0.5)"];
"Object" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QFrame" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QWidget" -> "QFrame" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QLabel" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QFrame" -> "QLabel" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QObject" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"wrapper" -> "QObject" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QPaintDevice" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"simplewrapper" -> "QPaintDevice" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QWidget" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QObject" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QPaintDevice" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseComponent" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A generic Taurus component."];
"TaurusListener" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"];
"BaseConfigurableClass" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseWidget" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The base class for all Qt Taurus widgets."];
"TaurusBaseComponent" -> "TaurusBaseWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusLabel" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QLabel" -> "TaurusLabel" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseWidget" -> "TaurusLabel" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusListener" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="TaurusListener Interface"];
"Logger" -> "TaurusListener" [arrowsize=0.5,style="setlinewidth(0.5)"];
"simplewrapper" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"wrapper" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"simplewrapper" -> "wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"];
}
-
class
TaurusLabel
(parent=None, designMode=False)[source]¶ Bases:
PyQt5.QtWidgets.QLabel
,taurus.qt.qtgui.base.taurusbase.TaurusBaseWidget
-
DefaultAlignment
= <PyQt5.QtCore.Qt.Alignment object>¶
-
DefaultAutoTrim
= True¶
-
DefaultBgRole
= 'quality'¶
-
DefaultFgRole
= 'rvalue'¶
-
DefaultModelIndex
= None¶
-
DefaultPrefix
= ''¶
-
DefaultShowText
= True¶
-
DefaultSuffix
= ''¶
-
autoTrim
¶ Specifies wether the text will be trimmed when it doesn’t fit in the available space
Access functions:
-
bgRole
¶ This property holds the background role. Valid values are ‘’/’None’, ‘quality’, ‘state’
Access functions:
-
dragEnabled
¶ Specifies whether the user can drag data from this widget
Access functions:
TaurusLabel.isDragEnabled()
TaurusLabel.setDragEnabled()
TaurusLabel.resetDragEnabled()
-
fgRole
¶ This property holds the foreground role (the text). Valid values are:
- ‘’/’None’ - no value is displayed
- ‘rvalue’ - the value is displayed
- ‘wvalue’ - the write value is displayed
- ‘quality’ - the quality is displayed
- ‘state’ - the device state is displayed
Access functions:
-
getFgRole
()[source]¶ get the foreground role for this label (see
setFgRole()
)
-
getModelIndexValue
()[source]¶ Called inside getDisplayValue to use with spectrum attributes. By default not used, but some widget might want to support this feature.
Override when needed.
-
getModelMimeData
()[source]¶ Returns a MimeData object containing the model data. The default implementation fills the TAURUS_MODEL_MIME_TYPE. If the widget’s Model class is Attribute or Device, it also fills TAURUS_ATTR_MIME_TYPE or TAURUS_DEV_MIME_TYPE, respectively
Return type: QMimeData
Returns:
-
classmethod
getQtDesignerPluginInfo
()[source]¶ Returns pertinent information in order to be able to build a valid QtDesigner widget plugin.
The dictionary returned by this method should contain at least the following keys and values: - ‘module’ : a string representing the full python module name (ex.: ‘taurus.qt.qtgui.base’) - ‘icon’ : a string representing valid resource icon (ex.: ‘designer:combobox.png’) - ‘container’ : a bool telling if this widget is a container widget or not.
This default implementation returns the following dictionary:
{ 'group' : 'Taurus [Unclassified]', 'icon' : 'logos:taurus.png', 'container' : False }
Return type: dict
Returns: a map with pertinent designer information
-
handleEvent
(evt_src, evt_type, evt_value)[source]¶ very basic and generalistic handling of events.
Override when necessary.
Parameters: - evt_src (
object
orNone
) – object that triggered the event - evt_type (
TaurusEventType
orNone
) – type of event - evt_value (
object
orNone
) – event value
- evt_src (
-
isReadOnly
()[source]¶ Determines if this component is read-only or not in the sense that the user can interact with it. Default implementation returns True.
Override when necessary.
Return type: bool
Returns: whether or not this component is read-only
-
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.
Access functions:
TaurusBaseWidget.getModel()
TaurusLabel.setModel()
TaurusBaseWidget.resetModel()
See also
-
modelIndex
¶ This property holds the index inside the model value that should be displayed
Access functions:
See also
-
prefixText
¶ This property holds a prefix text
Access functions:
-
setAutoTrim
(trim)[source]¶ Enable/disable auto-trimming of the text. If trim is True, the text in the label will be trimmed when it doesn’t fit in the available space
Parameters: trim ( bool
) –
-
setBgRole
(bgRole)[source]¶ Set the background role. The label background will be set according to the current palette and the role. Valid roles are: - ‘none’ : no background - ‘state’ a color depending on the device state - ‘quality’ a color depending on the attribute quality - ‘rvalue’ a color depending on the rvalue of the attribute - <arbitrary member name> a color based on the value of an arbitrary member of the model object (warning: experimental feature!)
Warning
the <arbitrary member name> support is still experimental and its API may change in future versions
-
setFgRole
(fgRole)[source]¶ Set what is shown as the foreground (the text) of the label Valid Roles are:
- ‘rvalue’ the read value of the attribute
- ‘wvalue’ the write value of the attribute
- ‘none’ : no text
- ‘quality’ - the quality of the attribute is displayed
- ‘state’ - the device state
-
setModel
(m)[source]¶ Sets/unsets the model name for this component
Parameters: model ( str
) – the new model name
-
suffixText
¶ This property holds a suffix text
Access functions:
-
textInteractionFlags
¶ Specifies how the label should interact with user input if it displays text.
-
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
-