How to get rid of QtQuick and QGraphicalEffects folders on app final release?
-
Hi.
In my last project, I noted something that bothers me. When I compile the final executable on the console with:
windeployqt --release --qmldir <MyQMLFiles> PathToExecutable
I got these files:
The problem is that each of these files has all the originals .qml files of the library (QGraphicalEffects for example):
Is there any solution or command that I should on the console to get rid of these files?
-
I don't think there is. If you are certain your app does not need them, you can delete them manually after running Qt deployment.
-
@sierdzio Thank you for your answer.
I do some test in order to probe your advice.
First, my project uses the ColorOverlay effect, so:
- I delete the QGraphicalEffects folder. The application did not open. Maybe some crash.
- I restore the folder, and I delete all the files except these ones. The app run correctly
The same effect with QtQuick/Controls.2 folder. When I erase it, the app did not run.
So, the conclusions are:
- You can delete some files (*.qml) but never delete the plugins.qmltypes, qmldir, qtgraphicaleffectsplugin.dll and the effects you use in your app, in my case ColorOverlay.qml
- You can delete those files (*qml) in QtQuick/Controls.2 folder that don't belong to your theme or style. For example, if you use Fusion, you can delete the others. In addition you can not delete the plugins.qmltypes, qmldir, qtquickcontrols2plugin.dll files either.
But now the question is: Why the qt system deployment cannot handle this automatically?
-
@oria66 said in How to get rid of QtQuick and QGraphicalEffects folders on app final release?:
But now the question is: Why the qt system deployment cannot handle this automatically?
Because nobody wrote project parser that's clever enough to detect which QML files are necessary and which aren't.
-
@J.Hilk said in How to get rid of QtQuick and QGraphicalEffects folders on app final release?:
@sierdzio which is a shame, because this is one of the reasons why android and iOS apps get so big in size so quickly. The deployment tool copies just as well everything. :-(
It is. Although all these QML dependencies do not weight much. Qt DLLs are significantly heavier.
-
@oria66 I had a similar question a few weeks ago. See this thread:
https://forum.qt.io/post/511417
The only way I could do it was by opening the gradle project in Android Studio after building it with Qt Creator. Then by trial and error, remove unwanted DLLs. Sadly, it didn't save much space.