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

"sibling" Qml files that import the same Url-loaded module fail to load

    XMLWordPrintable

Details

    • caa5358fe97becafeba9631f4c4d2fc69469afb1

    Description

      This is somewhat hard to explain, but if you have a file structure like this:

      main.qml
        uses Bug
        uses Zub
      Bug.qml
        imports foo
      Zub.qml
        imports foo
      
      foo is a module imported from http://...
      

      Bug.qml will fail to load with:

      file:///C:/Users/josh/scratch/qt/qtbug-xxxxx/main.qml:7:3: Type Bug unavailable
             Bug {
             ^
      file:///C:/Users/josh/scratch/qt/qtbug-xxxxx/Bug.qml:2:1: module "foo" is not installed
           import foo 1.0
           ^
      

      If you do any of the following:
      1) Add "import foo 1.0" to main.qml
      2) Remove Bug from use in main.qml
      3) Remove Zub from use in main.qml

      Everything works fine.

      Internally this seems to be because the two QQmlTypeLoader::Blob objects share a QQmlQmldirData object, but they don't expect to be doing so, and their use of the Import and priority on QQmlQmldirData conflicts.

      Attachments

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

        Activity

          People

            andysh Andy Shaw
            jfaust Josh Faust
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes