Unsolved Why Qt qml files are needed in app deploy when using Qt Quick Compiler
-
When using Qt Quick Compiler by setting flag
CONFIG += qtquickcompiler
, after deploying using windeployqt, all qml files of Qt Quick modules are copied to deploy directory in sub directories likeQtQuick
and so on. If I delete some of there qml files, qml engine gives lots of errors and many components don't get loaded. Why are the source code of these modules required when I am using Qt Quick Compiler? -
@nejatafshar Maybe because Qt Quick Compiler needs them when compiling :D You are creating kind of a dependency by deploying an application.
-
So what's the point of using Qt Quick Compiler? If Qt Quick modules are not compiled then there is no performance gain in app startup and other benefits as I am heavily using Qt Quick modules in my project.
-
@nejatafshar You cannot make an omelette without eggs :D It is a dependency dude. You can imagine that as qt tells the compiler to compile some code into an app, and compiler looks for the appropriate modules etc.
-
@nejatafshar if you don't want to have distribut qml files, you have to add them in a resources file (QRC) => for more details take a look at https://doc.qt.io/qt-5/qtquick-deployment.html#ahead-of-time-compilation
-
@KroMignon My problem is not with my qml files. I have already added them to resource file. The problem is with qml files of Qt Quick modules. Why should I ship them while using Qt Quick Compiler? It's wise to have .qmlc files of Qt Quick modules in deploy but why it's necessary to also have many qml files?
-
@nejatafshar said in Why Qt qml files are needed in app deploy when using Qt Quick Compiler:
Why are the source code of these modules required when I am using Qt Quick Compiler?
Because the Qt Quick Compiler compiles your project's QML code. It doesn't compile Qt's built-in QML code.
If Qt Quick modules are not compiled then there is no performance gain in app startup and other benefits as I am heavily using Qt Quick modules in my project.
Have you benchmarked to check to see if there's a performance gain?
Anyway, the Qt Quick Compiler is only one of many ways to speed up startup: https://blog.qt.io/blog/2019/01/11/qt-5-12-lts-road-faster-qml-application-startup/
-
@nejatafshar said in Why Qt qml files are needed in app deploy when using Qt Quick Compiler:
The problem is with qml files of Qt Quick modules.
Hmm, this is something I can not answer... I think you have to ask this question to Qt developers mailing list to got an answer ==> https://lists.qt-project.org/listinfo/development
-
@JKSH Thanks for the hint. So I should compile Qt with Qt Quick Compiler option set? But I wonder why some Qt's QML code are compiled in .qmlc files and I only need them for deploy and some other are not compiled and I need .qml files.
-
You're welcome.
@nejatafshar said in Why Qt qml files are needed in app deploy when using Qt Quick Compiler:
So I should compile Qt with Qt Quick Compiler option set?
I'm not sure what will happen if you compile Qt with that option.
But I wonder why some Qt's QML code are compiled in .qmlc files and I only need them for deploy and some other are not compiled and I need .qml files.
That's a good question. I would've expected all of Qt's built-in QML code to be pre-compiled into .qmlc... Maybe the devs forgot some of them? You could ask at the Development mailing list. You must subscribe before posting.