Bug 402422 - Precompile qml
Summary: Precompile qml
Status: RESOLVED UNMAINTAINED
Alias: None
Product: rust-qt-binding-generator
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Jos van den Oever
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-21 12:07 UTC by David Craven
Modified: 2024-09-22 20:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Craven 2018-12-21 12:07:18 UTC
When running `cargo run` in the `templates/qt_quick_cargo` folder, for every qml file a qmlc file is created in the same directory. Ideally it would precompile the qml into the binary in release mode and put the qmlc into the target directory in debug mode.
Comment 1 Jos van den Oever 2018-12-21 12:52:41 UTC
Good idea.

You can compile them into the binary by generating them like so:

  for f in *.qml; do qmlcachegen $f; done

and then adding them to the *.qrc file. I do not know if the files will be picked up like that.

http://doc.qt.io/qt-5/qtquick-deployment.html has more information for how to do this with QMake and CMake.

On my machine compiling the qmlc files takes about 10ms per file.
Comment 2 Christoph Cullmann 2024-09-22 20:08:43 UTC
rust-qt-binding-generator is no longer maintained, please try more recent alternatives like

https://github.com/KDAB/cxx-qt/