gazebosim/gz-gui

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

Aperta

#320 aperta il 24 nov 2021

 (2 commenti) (1 reazione) (0 assegnatari)C++ (68 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (103 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor