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

Import in one component affects type resolution in another one

    XMLWordPrintable

Details

    • 064ea3c49 (dev), d918cd2dc (6.9), b8c924bb4 (6.8)

    Description

      The setup like that:

       

      // Main.qml
      import QtQuick
      import Qt.labs.settings
      Window {
          id: root
          visible: true
          Test {}
          property Settings settings: Settings {}
      } 
      // Test.qml
      import QtQuick
      import QtCore
      
      Item {}
       

       

      fails to load with a following error:

      QQmlApplicationEngine failed to load component
      qrc:/qt/qml/qt6_test_project/Main.qml:11:33: Cannot assign object of type "Settings" to property of type "QQmlSettings*" as the former is neither the same as the latter nor a sub-class of it. 

      However it works fine when there is no `import QtCore` in Test.qml

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            michalc Michał Cieślak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change