Python plugin interface.
Overview
A Python plugin is a Python module containing a class Plugin, with a constructor taking a pointer to the MainWindow as input.
For instance, if you have
[pyplugins]
module.submodule=true
in your configuration file (Settings::readSettingFile), then the Plugin class will be accessed by the GUI in a way similar to:
from module.submodule import Plugin
pluginInstance =
Plugin(mainWindow)
Plugin can interact with the interface in following ways.
Dock widgets:
Your plugin may inherits from class PythonQt.QtGui.QDockWidget
. In this case, an instance of the Plugin will be added to the MainWindow as a QDockWidget
.
Signals and slots:
The most important signals and slots you should know about are listed here. A more up-to-date list of the available_in_python
The following method will be automatically connected to Qt signals:
Plugin.osgWidget
when a new OSGWidget is created (MainWindow::viewCreated(OSGWidget*)).
Plugin.resetConnection
triggered when CORBA connection should be reset. This is mandatory is you have a CORBA Client
Plugin.refreshInterface
triggered when users request to refresh the interface.
Logging information
Logging can be done from Python through:
- See also
- See examples pyplugins/gepetto/gui/pythonwidget.py and pyplugins/gepetto/gui/matplotlib_example.py