gazebosim/gz-gui

Support plugins without a "view"

开放

#220 创建于 2021年5月7日

 (0 条评论) (0 个反应) (0 位负责人)C++ (68 个派生)auto 404
enhancementhelp wanted

仓库指标

星标
 (103 个星标)
PR 合并指标
 (平均合并 8小时 31分钟) (30 天内合并 3 个 PR)

描述

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.

贡献者指南