Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.10.1
-
None
-
Qt 5.10.1, macOS 10.13.3
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.