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

Giving wrong typename to QQuickView::loadFromModule crashes the application.

    XMLWordPrintable

Details

    • Windows

    Description

      User reported that the attached example application crash with following:

      view.loadFromModule("test_qtQuickViewLoadFromModuleCrash","Main.qml"); -> Crash

      view.loadFromModule("test_qtQuickViewLoadFromModuleCrash","Main"); -> Works correctly

      compared to using QQuickView::setSource with an invalid URL, user will get empty view and the following in the application output:
      qrc:/mainx.qml: No such file or directory

       

      User wanted to highlight two points:

      1) The application should not crash/assert (it does not when using an incorrect URL to load a QML scene)
      2) The error message should provide information on what went wrong, including the incorrect module URI and typename. Ideally, it may even write whether the URI is wrong or the typename ("Module 'MyModule' does not contain a type called 'MyType'" versus "Module 'MyModule' not found")

       

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              tero.pelkonen Tero Pelkonen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes