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:

    0_1553298010884_AnotaciĆ³n 2019-03-22 203830.png

    The problem is that each of these files has all the originals .qml files of the library (QGraphicalEffects for example):

    0_1553298683251_8301a3e0-eb89-408f-babb-4e930e388152-image.png

    Is there any solution or command that I should on the console to get rid of these files?


  • Moderators

    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

    0_1553367368880_3d729f06-bad6-48fc-84f4-4f1562bd21e6-image.png

    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?


  • Moderators

    @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.


  • Moderators

    @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. :-(


  • Moderators

    @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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.