Cube GUI Plugin User Guide  (CubeGUI 4.4.4, revision 18494)
How to develop a Cube GUI Plugin, road map and examples
Plugin interaction with the Cube Plugin API

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.

Functions to show information provided by the plugin

Add a new Tab next to the System tree

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.

Add a context menu to a tree view

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.

Create a toolbar

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.

Define a shortcut

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 ).

Create an additional colormap

The colormap plugin example (ColorMapPlugin.h, ColorMapPlugin.cpp) demonstrates how to use cubepluginapi::PluginServices::addColorMap

Create an alternative value view

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.

Add a metric to the metric tree

To add a new metric to the metric tree, call cubepluginapi::PluginServices::addMetric.

Add a marker to a tree

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.

Add a status message

To write a message to the status line at the bottom of the cube window, call cubepluginapi::PluginServices::setMessage.


Cube Writer Library    Copyright © 1998–2017 Forschungszentrum Jülich GmbH, Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming