![]() |
Cube GUI Plugin User Guide
(CubeGUI 4.8.2, revision 7895e762)
How to develop a Cube GUI Plugin, road map and examples
|
The class cubepluginapi::PluginServices is used by the plugins to interact with the cube GUI. This Chapter will provide an overview about the most important functions.
To add one ore more tabs next to the system tree, the plugin has to call cubepluginapi::PluginServices::addTab. This function requires a cubegui::TabInterface as parameter. The tab has to define a label and a widget. See Step by step example for CubePlugin for a simple demo.
A context menu is shown, if the user clicks with the right mouse button on a tree. With cubepluginapi::PluginServices::addContextMenuItem, the plugin can add a menu item to the context menu.
Cube provides toolbars, if they are enabled ( e.g. Preferences, Synchronisation). A plugin may create additional toolbars with cubepluginapi::PluginServices::addToolBar. A toolbar may be assigned to a tab. In this case, the toolbar is only visible, if the tab is also visible. If the tab gets detached, the toolbar will be moved to the new window.
Shortcuts can be defined with QAction::setShortcut. To ensure that the plugin shortcuts don't interfere with the default shortcuts, the context should be set using QAction::setShortcutContext( Qt::WidgetWithChildrenShortcut ).
The colormap plugin example (ColorMapPlugin.h, ColorMapPlugin.cpp) demonstrates how to use cubepluginapi::PluginServices::addColorMap
The default value view shows a colored square next to the numerical value. The function cubepluginapi::PluginServices::addValueView adds the given value view to the list of available views from which the user can choose the active one. See ValueView example for an example implementation.
To add a new metric to the metric tree, call cubepluginapi::PluginServices::addMetric.
A plugin may define one or more tree item marker to tag items of interest.
Tree items are marked in different ways:
To create a new marker, cubepluginapi::PluginServices::getTreeItemMarker has to be called. Then, the marker cann be added in two different ways:
See Extensive example for an example implementation.
To write a message to the status line at the bottom of the cube window, call cubepluginapi::PluginServices::setMessage.
To communicate with other plugins, a named value can be send with cubepluginapi::PluginServices::setGlobalValue. After a value has been set, the SIGNAL cubepluginapi::PluginServices::globalValueChanged is emitted and the value can be read by other plugins. After a plugin is successfully started, the global value <plugin name>="">::started
is set to true.
The API function cubepluginapi::PluginServices::createFuture( TabInterface* tab = 0 ) creates a Future object to execute a task in parallel. The Future object is deleted after the plugin has been closed. If a TabInterface is given, a progress bar will be displayed in the given tab while the tasks are running.
The parallel plugin example (ParallelPlugin.h, ParallelPlugin.cpp) demonstrates how to use cubepluginapi::Future
![]() |
Copyright © 1998–2022 Forschungszentrum Jülich GmbH,
Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming |