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

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

XMLWordPrintable

    • Windows

      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")

       

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes