31 from python_qt_binding.QtCore
import QObject
36 Provides information to the plugin and exposes methods to interact with the framework. 38 PluginContext relays all methods to the corresponding `PluginHandler`. 42 super(PluginContext, self).
__init__(handler)
43 self.setObjectName(
'PluginContext')
49 Return the serial number of the plugin. 51 For a specific type of plugin each instance gets a serial number (which is the first 52 currently not used positive integer at construction time). 53 @return: The serial number 56 return self._handler.instance_id().serial_number
60 Return the command line arguments of the plugin. 62 @return: The arguments without a program name at the beginning 65 return self._handler.argv()
69 Add a widget to the UI. 71 The widget is embedded into a new QDockWidget which itself is added to the QMainWindow. 72 This method can be called once for each widget a plugin would like to add and at any point 73 in time (until the calling plugin has been shutdown). 75 Note: The ownership of the widget is transferred to the callee which will delete it when 76 the plugin is shut down. 77 @param widget: The widget to add 80 self._handler.add_widget(widget)
84 Remove a previously added widget from the UI. 86 Note: The ownership of the widget is transferred to the caller. 87 @param widget: The widget to remove 90 self._handler.remove_widget(widget)
94 Add a toolbar to the UI, which is directly added to the QMainWindow. 96 This method can be called once for each toolbar a plugin would like to add and at any point 97 in time (until the calling plugin has been shutdown). 98 Note: The ownership of the toolbar is transferred to the callee which will delete it when 99 the plugin is shut down. 100 @param widget: The toolbar to add 101 @type widget: QToolBar 103 self._handler.add_toolbar(toolbar)
107 Remove a previously added toolbar from the UI. 109 Note: The ownership of the toolbar is transferred to the caller. 110 @param widget: The toolbar to remove 111 @type widget: QToolBar 113 self._handler.remove_toolbar(toolbar)
119 The framework will call `Plugin.shutdown_plugin()` and unload it afterwards. 121 self._handler.close_plugin()
124 """Reload the plugin.""" 125 self._handler.reload_plugin()
def remove_toolbar(self, toolbar)
def add_toolbar(self, toolbar)
def add_widget(self, widget)
def remove_widget(self, widget)
def __init__(self, handler)