TaurusLauncherButton

Inheritance diagram of TaurusLauncherButton
class TaurusLauncherButton(parent=None, designMode=False, widget=None, icon=None, text=None)[source]

This class provides a button that launches a modeless dialog containing a specified Taurus widget which gets the same model as the button. The button does not use the model directly. Instead it passes it to the associated widget.

Code examples:

# a button that launches a TaurusAttrForm when clicked
b = TaurusLauncherButton(widget = TaurusAttrForm())
# set dev name, which will be set at the TaurusAttrForm when clicking
b.setModel("a/b/c")

# a button that launches a taurusLabel
b = TaurusLauncherButton(widget="taurus.qt.qtgui.display:TaurusLabel")
b.setModel("a/b/c/d")

# a button that launches a TaurusPlot
b = TaurusLauncherButton(widget="taurus_pyqtgraph:TaurusPlot")
b.setModel("eval:rand(50)")

Import from taurus.qt.qtgui.button as:

from taurus.qt.qtgui.button import TaurusLauncherButton
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

UseParentModel

(deprecated))

createWidget()[source]
displayValue(v)[source]

see TaurusBaseComponent.displayValue()

getDisplayValue(**kwargs)[source]

see TaurusBaseComponent.getDisplayValue()

getModelClass(**kwargs)[source]

see TaurusBaseComponent.getModelClass(). Note that in the case of TaurusLauncherButton, the class is completely dependent on the widget’s class

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 }
Returns

a map with pertinent designer information

Return type

dict

getWidgetClassName()[source]
onClicked()[source]

Slot called when the button is clicked. Note that the dialog will only be created once. Subsequent clicks on the button will only raise the existing dialog

resetWidgetClassName(className, args=None, kwargs=None)[source]
setText(text)[source]

Sets the text of the button. see Qt.QPushButton.setText()

setWidget(widget)[source]

sets the widget that will be shown when clicking the button

Parameters

widget (Qt.QWidget) –

setWidgetClassName(className, args=None, kwargs=None)[source]
widget()[source]
widgetClassName