TaurusModelChooser

Inheritance diagram of TaurusModelChooser
class TaurusModelChooser(parent=None, selectables=None, host=None, designMode=None, singleModel=False)[source]

Bases: taurus.qt.qtgui.container.tauruswidget.TaurusWidget

A widget that allows the user to select a list of models from a tree representing devices and attributes from a Tango server.

The user selects models and adds them to a list. Then the user should click on the update button to notify that the selection is ready.

signals::
  • “updateModels” emitted when the user clicks on the update button. It passes a list<str> of models that have been selected.

UpdateAttrs
addModels(models)[source]

Add given models to the selected models list

getListedModels(asMimeData=False)[source]

returns the list of models that have been added

Parameters

asMimeData (bool) – If False (default), the return value will be a list of models. If True, the return value is a QMimeData containing at least TAURUS_MODEL_LIST_MIME_TYPE and text/plain MIME types. If only one model was selected, the mime data also contains a TAURUS_MODEL_MIME_TYPE.

Return type

list <str> or QMimeData

Returns

the type of return depends on the value of asMimeData

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

isSingleModelMode()[source]

returns True if the selection is limited to just one model. Returns False otherwise.

Return type

bool

Returns

static modelChooserDlg(parent=None, selectables=None, host=None, asMimeData=False, singleModel=False, windowTitle='Model Chooser', listedModels=None)[source]

Static method that launches a modal dialog containing a TaurusModelChooser

Parameters
  • parent (QObject) – parent for the dialog

  • selectables (list <TaurusElementType>) – if passed, only elements of the tree whose type is in the list will be selectable.

  • host (QObject) – Tango host to be explored by the chooser

  • asMimeData (bool) – If False (default), a list of models will be. returned. If True, a QMimeData object will be returned instead. See getListedModels() for a detailed description of this QMimeData object.

  • singleModel (bool) – If True, the selection will be of just one model. Otherwise (default) a list of models can be selected

  • windowTitle (str) – Title of the dialog (default=”Model Chooser”)

  • listedModels (list <str>) – List of model names for initializing the model list

Return type

list,bool or QMimeData,bool

Returns

Returns a models,ok tuple. models can be either a list of models or a QMimeData object, depending on asMimeData. ok is True if the dialog was accepted (by clicking on the “update” button) and False otherwise

onRemoveSelected()[source]

Remove the list-selected models from the list

resetListedModels()[source]

equivalent to setListedModels([])

resetSingleModelMode()[source]

equivalent to setSingleModelMode(False)

setListedModels(models)[source]

adds the given list of models to the widget list

setSingleModelMode(single)[source]

sets whether the selection should be limited to just one model (single=True) or not (single=False)

singleModelMode

returns True if the selection is limited to just one model. Returns False otherwise.

Return type

bool

Returns

updateList(attrList)[source]

for backwards compatibility with AttributeChooser only. Use setListedModels() instead

updateModels