DockWidgetPanel

Inheritance diagram of DockWidgetPanel
class DockWidgetPanel(parent, widget, name, mainwindow)[source]

This is an extended QDockWidget which provides some methods for being used as a “panel” of a TaurusGui application. Widgets of TaurusGui are inserted in the application by adding them to a DockWidgetPanel.

Import from taurus.qt.qtgui.taurusgui as:

from taurus.qt.qtgui.taurusgui import DockWidgetPanel
applyConfig(configdict, depth=-1)[source]

applies the settings stored in a configdict to the current object.

In most usual situations, using registerConfigProperty() and registerConfigDelegate(), should be enough to cover all needs using this method, although it can be reimplemented in children classes to support very specific configurations.

Parameters:
  • configdict (dict)

  • depth (int) – If depth = 0, applyConfig will only be called for this object, and not for any other object registered via registerConfigurableItem(). If depth > 0, applyConfig will be called recursively as many times as the depth value. If depth < 0 (default, see note), no limit is imposed to recursion (i.e., it will recurse for as deep as there are registered items).

Note

the default recursion depth can be tweaked in derived classes by changing the class property defaultConfigRecursionDepth

See also

createConfig()

closeEvent(self, event: Optional[QCloseEvent])[source]
createConfig(*args, **kwargs)[source]

Returns a dictionary containing configuration information about the current state of the object.

In most usual situations, using registerConfigProperty() and registerConfigDelegate(), should be enough to cover all needs using this method, although it can be reimplemented in children classes to support very specific configurations.

By default, meth:createQConfig and meth:saveConfigFile call to this method for obtaining the data.

Hint: The following code allows you to serialize the configuration dictionary as a string (which you can store as a QSetting, or as a Tango Attribute, provided that allowUnpickable==False):

import pickle
s = pickle.dumps(widget.createConfig())
Parameters:

alllowUnpickable (bool) – if False the returned dict is guaranteed to be a pickable object. This is the default and preferred option because it allows the serialization as a string that can be directly stored in a QSetting. If True, this limitation is not enforced, which allows to use more complex objects as values (but limits its persistence).

Returns:

configurations (which can be loaded with applyConfig()).

Return type:

dict<str,object>

getWidgetClassName()[source]
getWidgetModuleName()[source]
isCustom()[source]
isPermanent()[source]
setCustom(custom)[source]
setPermanent(permanent)[source]
setWidgetFromClassName(classname, modulename=None)[source]