Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94581 Review and Document new Qt 6.2 CMake API
  3. QTBUG-95146

Create a QT_IMPORT_QML_PLUGIN C++ macro for static qml plugin importing

    XMLWordPrintable

Details

    • 9ac0a380b07c5da0ec0d7224cc8fe5ac21e97676

    Description

      Context
      https://git.qt.io/alcroito/qt6-cmake-api-review/-/commit/14b4999bc857f5402a3577fe334ebfb3602ad0c2#f3ff9c1b48af14adf093e2af0c5cf2849829bb6d_176_232

      For the use case of allowing multiple qml modules attached to an executable, we agreed that it should be achieved by creating multiple static qml modules and plugins and the plugins should be linked to the executable.

      To ensure symbols are not discarded, Q_IMPORT_PLUGIN calls need to be added to the executable's source code, manually by the project developer.

      To facilitate an upgrade path where that might be done automatically by the build system, developers should instead use QT_IMPORT_QML_PLUGIN instead of Q_IMPORT_PLUGIN.

      This allows us to make QT_IMPORT_QML_PLUGIN a no-op in future Qt versions when the initialization will be done automatically by the build system, without causing duplicate symbol errors.

      QT_IMPORT_QML_PLUGIN's implementation for Qt 6.2 should merely call QT_IMPORT_PLUGIN.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ulherman Ulf Hermann
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes