Developer Documentation
|
This Interface can be used to configure visible widgets and menus in the viewer. A given view mode contains a list of toolbars, toolboxes and context menus which should be visible if the mode is active. Therefore you can define a subset of the full interface for special tasks.
OpenFlipper comes along with a lot of plugins each offering a wide variety of GUI elements such as toolboxes and toolbars. In order to constrain OpenFlipper's interface to a certain number of toolboxes and/or toolbar elements, the ViewModeInterface offers means to filter these elements.
So, for example, if we only wanted the toolboxes of the Data Control and the Selection plugin to be visible, we have to emit signal ViewModeInterface::defineViewModeToolboxes(QString, QStringList) in order to hide out everything else:
When the user selects "My Custom View Mode" out of the view modes menu, all toolboxes except for Data Control and Selection will disappear. This works analogously for toolbar elements via the signal ViewModeInterface::defineViewModeToolbars(QString, QStringList).
The Main Toolbar and the Viewer Toolbar will always be included in the list of toolbars and will be the default when you define a View Mode with only toolboxes and context menus. If you do not define context menus for your View Mode, they will default to all.
Additionally, if we wanted the "My Custom View Mode" entry in the view modes menu to appear with a fancy icon, we just have to call ViewModeInterface::defineViewModeIcon(QString, QString):
To use the ViewModeInterface: