Public Member Functions | Private Attributes | List of all members
qt_gui.plugin_context.PluginContext Class Reference
Inheritance diagram for qt_gui.plugin_context.PluginContext:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, handler)
 
def add_toolbar (self, toolbar)
 
def add_widget (self, widget)
 
def argv (self)
 
def close_plugin (self)
 
def reload_plugin (self)
 
def remove_toolbar (self, toolbar)
 
def remove_widget (self, widget)
 
def serial_number (self)
 

Private Attributes

 _handler
 

Detailed Description

Provides information to the plugin and exposes methods to interact with the framework.

PluginContext relays all methods to the corresponding `PluginHandler`.

Definition at line 34 of file plugin_context.py.

Constructor & Destructor Documentation

◆ __init__()

def qt_gui.plugin_context.PluginContext.__init__ (   self,
  handler 
)

Definition at line 41 of file plugin_context.py.

Member Function Documentation

◆ add_toolbar()

def qt_gui.plugin_context.PluginContext.add_toolbar (   self,
  toolbar 
)
Add a toolbar to the UI, which is directly added to the QMainWindow.

This method can be called once for each toolbar a plugin would like to add and at any point
in time (until the calling plugin has been shutdown).
Note: The ownership of the toolbar is transferred to the callee which will delete it when
      the plugin is shut down.
@param widget: The toolbar to add
@type widget: QToolBar

Definition at line 92 of file plugin_context.py.

◆ add_widget()

def qt_gui.plugin_context.PluginContext.add_widget (   self,
  widget 
)
Add a widget to the UI.

The widget is embedded into a new QDockWidget which itself is added to the QMainWindow.
This method can be called once for each widget a plugin would like to add and at any point
in time (until the calling plugin has been shutdown).

Note: The ownership of the widget is transferred to the callee which will delete it when
    the plugin is shut down.
@param widget: The widget to add
@type widget: QWidget

Definition at line 67 of file plugin_context.py.

◆ argv()

def qt_gui.plugin_context.PluginContext.argv (   self)
Return the command line arguments of the plugin.

@return: The arguments without a program name at the beginning
@rtype: list

Definition at line 58 of file plugin_context.py.

◆ close_plugin()

def qt_gui.plugin_context.PluginContext.close_plugin (   self)
Close the plugin.

The framework will call `Plugin.shutdown_plugin()` and unload it afterwards.

Definition at line 115 of file plugin_context.py.

◆ reload_plugin()

def qt_gui.plugin_context.PluginContext.reload_plugin (   self)
Reload the plugin.

Definition at line 123 of file plugin_context.py.

◆ remove_toolbar()

def qt_gui.plugin_context.PluginContext.remove_toolbar (   self,
  toolbar 
)
Remove a previously added toolbar from the UI.

Note: The ownership of the toolbar is transferred to the caller.
@param widget: The toolbar to remove
@type widget: QToolBar

Definition at line 105 of file plugin_context.py.

◆ remove_widget()

def qt_gui.plugin_context.PluginContext.remove_widget (   self,
  widget 
)
Remove a previously added widget from the UI.

Note: The ownership of the widget is transferred to the caller.
@param widget: The widget to remove
@type widget: QWidget

Definition at line 82 of file plugin_context.py.

◆ serial_number()

def qt_gui.plugin_context.PluginContext.serial_number (   self)
Return the serial number of the plugin.

For a specific type of plugin each instance gets a serial number (which is the first
currently not used positive integer at construction time).
@return: The serial number
@rtype: int

Definition at line 47 of file plugin_context.py.

Member Data Documentation

◆ _handler

qt_gui.plugin_context.PluginContext._handler
private

Definition at line 45 of file plugin_context.py.


The documentation for this class was generated from the following file:


qt_gui
Author(s): Dirk Thomas
autogenerated on Fri Jun 24 2022 02:42:37