Skip to content

Allow accessing plugin class using the underscore naming convention in older branches #692

@azeey

Description

@azeey

Desired behavior

In the migration from Qt5 to Qt6, the naming convention for accessing plugins from QML was changed (see https://github.com/gazebosim/gz-gui/blob/6e572954dca6caa12623130c0482892ab59d1540/tutorials/09_migration_qt6.md). It would be nice if this convention was also available in older branches so that users migrating to Jetty can make these changes in Harmonic/Ionic, and test them before migrating. This would also make it possible to use the same QML code for both Jetty and the version of Gazebo they are migrating from.

Alternatives considered

Implementation suggestion

The change was made in

gz-gui/src/Plugin.cc

Lines 132 to 133 in 6e57295

this->dataPtr->context->setContextProperty(
QString::fromStdString("_" + filename), this);

I suggest adding that same line to earlier versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions