gazebosim/gz-gui

Support using ign-gui QML components in fully custom downstream application

Open

#320 opened on Nov 24, 2021

 (2 comments) (1 reaction) (0 assignees)C++ (68 forks)auto 404
enhancementhelp wanted

Repository metrics

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

Description

Desired behavior

I would like to incorporate ign-gui and also ign-rviz QML components in an existing Qt Quick application. The existing application sets up a QGuiApplication already and needs to do some different things than what ignition::gui::Aplication does for the following:

Implementation suggestion

In order to use ign-gui QML components in a downstream application, I would like to suggest a couple of changes.

  1. The method ignition::gui::App() returns a pointer of type ignition::gui::Application. Can an abstract base class be defined and then ignition::gui::App() returns the base class? Then Application would be changed to inherit from the base class.
  2. The Application class performs a lot of plugin loading logic. Could the majority of this logic be extracted to a helper class that could also be used downstream? Ideally, the Application class would then only be specific to setting up and interacting with ignition::gui::MainWindow and other "top level" things like signal handlers and logging.
    • Note that the method ignition::gui::Application::AddPluginsToWindow is specific to proably too specific to igntion::gui::MainWindow to be extracted, but maybe it could be broken down some with common functionality extracted.

Alternatives considered

I could subclass the ignition::gui::Application class as-is and override the constructor and other methods. I would have to work around the issues described here and I am not sure how feasible this solution is without testing it.

Additional context

N/A

Contributor guide