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

QML "file://" Import not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.2.0
    • None
    • Windows 8

    Description

      I have an application, where:
      *QML Files are in resource file
      *main.qml
      *RedRect.qml
      *QML Files are in relative directory
      *GreenRect.qml
      *qmldir

      When trying to import the relative directory inside main.qml following happens:
      1. Directory import succeeds
      2. qmldir file is resolved correctly and recognized that GreenRecti Item refers to GreenRect.qml
      3. I get an error that GreenRect.qml file is not found, even though it is in the same folder as qmldir and relative to the imported directory.

      This issue is easily resolved by providing absolute path with "file:///", which proves that there is a bug at some point in the process of loading of the QML item.

      Full console log:

      QML debugging is enabled. Only use this in a safe environment.
      qrc:/qml/main.qml:11:5: Type GreenRecti unavailable
      file://qml/MixedResource/GreenRect.qml: File not found

      I have attached a really small and simple example that reproduces the problem easily

      Attachments

        1. GreenRect.qml
          0.1 kB
        2. main.qml
          0.2 kB
        3. qmldir
          0.0 kB
        4. RedRect.qml
          0.1 kB
        5. resource.qrc
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shausman Simon Hausmann
            rachol Rafal Chomentowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes