gazebosim/gz-gui

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

Offen

#320 geöffnet am 24.11.2021

 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)C++ (68 Forks)auto 404
enhancementhelp wanted

Repository-Metriken

Stars
 (103 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 8h 31m) (3 gemergte PRs in 30 T)

Beschreibung

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