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

REG: Referencing neighbouring QML types from QML file in resource bundle file system no longer works

    XMLWordPrintable

Details

    Description

      In Qt 4, you could bundle QML files in a qrc resource bundle, and then reference your main QML file like this:

      QDeclarativeView view;
      view.setSource(QUrl("qrc:qml/main.qml"));
      

      The resource file system would then behave like any regular file system, allowing you to reference custom types inside main.qml which it would find by searching qrc:qml/ for the type.

      This no longer works in QML 2.

      The attached example demonstrates the problem. Run it against Qt 5 and you will get an error message that the type MyType is not found.

      If you however edit the two QML files to import QtQuick 1.1 instead of 2.0, and then recompile against Qt 4.8, you will see no such error message and the red rectangle (MyType) will be shown in the middle of the view.

      Attachments

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

        Activity

          People

            mvogt Matthew Vogt (closed Nokia identity) (Inactive)
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes