Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML pre-compilation to bytecode, is it possible?

Tags:

embedded

qt

qml

I'm trying to optimize some QML code for speed and memory.

I know it's possible to create a Qt resource file (*.rcc) to reduce *.qml file space. Although I don't have numbers about how much improvement/compression is obtained with this step.
Check how to do it in Qt/QML Compiling libraries and resources

But, I know too that it's been in some people heads roadmap before to precompile QML files to bytecode, so this step could be avoided in runtime.

So, someone knows if it is possible to precompile QML in any released Qt version? or in any planned?

like image 744
kikeenrique Avatar asked Jun 12 '13 16:06

kikeenrique


2 Answers

With Qt 5.3 is possible:

http://doc.qt.digia.com/QtQuickCompiler/

"The Qt Quick Compiler is a development add-on for Qt Quick applications which allows you to compile QML source code into the final binary. When you use this add-on, the application's startup time is significantly improved and you no longer need to deploy .qml files together with the application."

like image 132
crsnplusplus Avatar answered Oct 06 '22 21:10

crsnplusplus


QML pre-compilation to bytecode, is it possible?

Unfortunately, this is not possible as of now. Also, this is a fairly large feature request, so will not probably be supported any time soon. For sure, not in the upcoming 5.2 for which we have the feature freeze in one week, but most probably not even 5.3 for next summer, etc.

I have just discussed this issue shortly with one of the developers, so you may need to live with(out) it for now. I was also asking about creating a jira report for tracking this, but I have been told such a big feature requests are not tracked there like the v4 engine rewriting for the declarative repository in the near past.

like image 27
lpapp Avatar answered Oct 06 '22 20:10

lpapp