TaurusLauncherButton

Inheritance diagram of TaurusLauncherButton

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

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

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
button =  TaurusLauncherButton(widget = TaurusAttrForm())
button.setModel('a/b/c') #a device name, which will be given to the TaurusAttrForm when clicking

# a button that launches a taurusValueLabel (whose model is an attribute: 'a/b/c/attrname')
button =  TaurusLauncherButton(widget = TaurusValueLabel())
button.setModel('a/b/c/attrname') #a device name, which will be given to the TaurusValueLabel when clicking

#same as the previous one, but using the parent model and putting a custom text and icon:
button =  TaurusLauncherButton(widget = TaurusValueLabel(), text='click me', icon=':/taurus.png')
button.setUseParentModel(True)  #let's assume that the button's parent has a model of type "/a/b/c"
button.setModel('/attrname')
Model

Returns the model name for this component.

Return type::class:~`str`
Returns:the model name.
UseParentModel

Returns whether this component is using the parent model

Return type::class:~`bool`
Returns:True if using parent model or False otherwise
createWidget()[source]
displayValue(v)[source]

see TaurusBaseComponent.displayValue()

getDisplayValue()[source]

see TaurusBaseComponent.getDisplayValue()

getModelClass()[source]

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

classmethod getQtDesignerPluginInfo()[source]
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 (:class:~`Qt.QWidget`) –
setWidgetClassName(className, args=None, kwargs=None)[source]
widget()[source]
widgetClassName