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

QQmlEngine aborts with failing assertion on Qt.createComponent() call when called from evaluate()

    XMLWordPrintable

Details

    Description

      We have a consulting project that'll require us to implement an app, where the entry point will be in a JavaScript file provided by the user, meaning we'll only create an instance of QQmlEngine, and then do the following sequence of calls:

      engine.evaluate(contents);
      QJSValue mainFunc = engine.globalObject().property("main");
      QJSValue result = mainFunc.call();

      so the UI will be created dynamically by the script.

      At this point we need to provide only support for Qt Widgets, but I decided to go further and also test if it's possible to create a QML-based user interface from the same script. Long story short, both Qt.createComponent(...) and Qt.createQmlObject(...) cause program crash.

      Somebody can say I'm doing it wrong, but, well, the rest methods of "Qt" global object do work normally with QQmlEngine, so I believe this use case should be supported as well.

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            wearyinside Oleg Yadrov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes