Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120189

[Reg 6.6 -> 6.7] Cannot assign object of type "IconPropertiesGroup" to property of type "IconPropertiesGroup_QMLTYPE_1*" as the former is neither the same as the latter nor a sub-class of it

    XMLWordPrintable

Details

    • 933f80f34 (dev), 18aeb7177 (6.7), 5eba40805 (dev), 3668db06e (6.7)

    Description

      KDE Plasma's systemsettings application fails to load QML-based modules using Qt 6.7 due to the following QML error:

       

      qrc:/kcm/kcm_landingpage/main.qml:18 Type KCM.SimpleKCM unavailable
      qrc:/qt/qml/org/kde/kcmutils/SimpleKCM.qml:33 Type Kirigami.ScrollablePage unavailable
      qrc:/qt/qml/org/kde/kirigami/ScrollablePage.qml:68 Type Kirigami.Page unavailable
      qrc:/qt/qml/org/kde/kirigami/Page.qml:237 Type Kirigami.PageRow unavailable
      qrc:/qt/qml/org/kde/kirigami/PageRow.qml:180 Type OverlayDrawer unavailable
      file:///home/nico/kde/usr/qml/org/kde/kirigami/OverlayDrawer.qml:22 Type KT.OverlayDrawer unavailable
      file:///home/nico/kde/usr/qml/org/kde/kirigami/templates/OverlayDrawer.qml:120 Cannot assign object of type "IconPropertiesGroup" to property of type "IconPropertiesGroup_QMLTYPE_55*" as the former is neither the same as the latter nor a sub-class of it.

      This seems to be due to its somewhat complex architecture: There is a QML-based sidebar (using QQuickWidget) in a QMainWindow. The QML code is added via qt_add_qml_module. The actual module content is in another QQuickWidget, loaded from a plugin that ships the QML code via qrc but not using qt_add_qml_module.

      Additionally both import components from Kirigami. Kirigami uses the qmlRegisterType(QUrl ...) function to register its controls. The combination of these factors makes the bug appear.

      https://invent.kde.org/nicolasfella/qml-test is a minimal example showing the problem. Loading the second component fails with

      qrc:/qt/qml/org/kde/systemsettings/Main.qml:4 Type Comps.OverlayDrawer unavailable file:///home/nico/qml-test/OverlayDrawer.qml:4 Cannot assign object of type "IconPropertiesGroup" to property of type "IconPropertiesGroup_QMLTYPE_1*" as the former is neither the same as the latter nor a sub-class of it.

      This is tested with current 6.7 branch (qtbase 32fa63f650be5b2d5d2c219d9150f994c761bd75, qtdeclarative ac0bbf86c979ab3faef102890ceaceb0378f8ed4). It worked fine with Qt 6.6 and previous

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-120189
          # Subject Branch Project Status CR V

          Activity

            People

              ulherman Ulf Hermann
              nicolasfella Nicolas Fella
              Votes:
              8 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: