Bug 402422

Summary: Precompile qml
Product: [Unmaintained] rust-qt-binding-generator Reporter: David Craven <david>
Component: generalAssignee: Jos van den Oever <jos>
Status: RESOLVED UNMAINTAINED    
Severity: wishlist    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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/