gazebosim/gz-gui

Support plugins without a "view"

Open

#220 opened on May 7, 2021

 (0 comments) (0 reactions) (0 assignees)C++ (68 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (103 stars)
PR merge metrics
 (PR metrics pending)

Description

Ignition GUI currently has several assumptions that plugins have a visual representation described by a QML file. But often we want to create plugins that add functionality to the GUI but don't necessarily display any information. For example, the KeyPublisher plugin creates an invisible rectangle just to satisfy this requirement:

https://github.com/ignitionrobotics/ign-gui/blob/ffbdb26ce519f85b273d57527a11470dae3838e1/src/plugins/key_publisher/KeyPublisher.qml#L22-L26

Desired behavior

We should add support for plugins that don't necessarily have a QML view, but that are loaded and updated together with the entire application.

Alternatives considered

We can continue creating invisible plugins like KeyPublisher, but this feels like a hack.

Implementation suggestion

We need a mechanism to tell if a plugin doesn't have a QML file, so we don't try to load that and don't add it to the view. Maybe just the absence of a qrc file could be enough to indicate that a plugin is "headless".

Additional context

Other plugins that could benefit from this concept are plugins that add functionality to other existing plugins. For example, how the Grid3D plugin adds a grid to an existing scene. That plugin is also view-less:

https://github.com/ignitionrobotics/ign-gui/blob/ffbdb26ce519f85b273d57527a11470dae3838e1/src/plugins/grid_3d/Grid3D.qml#L21-L24

Invisible plugins can be used to augment other plugins without the need for those plugins to handle all the plugins directly.

Contributor guide