Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-5055

The qmlapplicationviewer class generated with a Qt Quick Application does not support qml files in qrc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • Qt Creator 2.2.0
    • None
    • PC Ubuntu + Qt 4.7.3

    Description

      I tried to use the example of code included in the autogenerated Qt Quick application but this does not support qml files in qrc.

          //It is not possible to use a qrc file with this API
      //    viewer.setMainQmlFile(QLatin1String("qrc:/qml/main.qml"));
          //Error is: file:///home/ag/workspace/qt-workspace/steptest-build-desktop/qrc:/qml/main.qml: File not found
      

      I had to use instead

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

      Is it the right way to use it ?

      Attachments

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

        Activity

          People

            portale Alessandro Portale
            agroyer Anthony Groyer
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes