Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the best approach while deploying qml files in embeded application?

Tags:

qt

qml

qtembedded

I am working for an embedded project, UI developed in QML and backend logic developed using DB/other system calls in C++/Qt.

Which is the best approach to deploy qml files?

Does It adding to .qrc (as resource) and compile to executable application?

or

Load QML files from import folder (QML files will be deployed)?

or any other suggesion?

I have around 200 QML files.

like image 673
Ashif Avatar asked Jan 15 '16 09:01

Ashif


1 Answers

QML files in the file system

Files are stored without compression and encryption

  • Faster to build but slower to deploy
  • Stored without compression so they take more storage space
  • Easy to do UI changes on the fly on target (just edit QML and restart)

QML files in the resource file

Resources are compiled to the binary file making the executable file size bigger

  • Slower to build but faster to deploy.
  • Takes less storage space because resources are compressed by default.
  • Because the executable size is bigger the program takes more memory when running.
  • You can't do changes to UI without re-compiling

See from the link the following chapter Managing Resource Files with the Qt Resource System for an example of relative path referencing.

I don't have any strong opinion but here some of my thoughts: If memory usage is an issue then you might go without embedded resources and make sure you use dynamic loading of components as much as possible. In the development phase it's easier to go without embedded resources. If it's a customer project I would do the customer delivery as qml files embedded. This prevents the customer from tweaking the UI code themselves.

like image 141
talamaki Avatar answered Oct 26 '22 17:10

talamaki