Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.2
Description
I have a cmake / qml application running on an embedded target. If I want to make a minor change to a qml file, I need to rebuild, deploy and restart the app. I should be able to edit qml sources on the target and restart the app to see my changes.
In qt5 / qmake projects, we could load qml sources at runtime. I think this ability has been lost in qt6.
I can get a Loader to load qml at runtime. However, for my use case, I need all of my qml types to load at runtime without using a Loader.
eg. in the following code, I need 'first' to be loaded at runtime.
MyRectangle { id: first } // this is defined at compile time Loader { source: "file:///path/to/MyRectangle.qml" // this is defined at run time }
This is an issue for the users of the project that don't want to download source code and a toolchain, install qt, and rebuild the app. They just want to edit on the device.
I am currently adding qml sources via 'qt_add_qml_module', however I will use a different approach if it gives me what I want.
I have example code here: https://github.com/DanielMcInnes/helloQmlTc branch: 'load-qml-at-runtime')
It is not clear from the documentation if what I want is possible. Apologies in advance if I have missed something.
Attachments
Issue Links
- relates to
-
QTBUG-130099 Import of module in Javascript resource does not respect qmldir->prefer
-
- Reported
-