Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I organize files under the qml.qrc folder in Qt Creator?

Tags:

qt

qt-creator

qml

If I have a bunch of resources (images, fonts, etc.) in different folders under my qml.qrc file, is there a way to organize this within Qt Creator?

For example, if I have the following in my qml.qrc file:

<RCC>
    <qresource prefix="/">
        <file>main.qml</file>
        <file>pages/MainPage.qml</file>
        <file>pages/NewContactPage.qml</file>
        <file>images/plus.png</file>
        <file>images/minus.png</file>
        <file>images/exit.png</file>
    </qresource>
</RCC>

It will show up as a long list in Qt Creator, like this:

Resources
    qml.qrc
        /
          main.qml
          pages/MainPage.qml
          pages/NewContactPage.qml
          images/plus.png
          images/minus.png
          images/exit.png

Since this list can get really long over the duration of the project, it would be nice if these were organized better and split into folders like they are in my directory. Any ideas?

like image 303
rderosia Avatar asked Nov 19 '14 14:11

rderosia


1 Answers

Actually, I'd highly recommend that non .qml assets to be put in a different resource file altogether, because large files will gut application build times. What happens is even a tiny change to a qml source will result in recompilation of the entire resource file. If assets are in a different resource file they are not continuously recompiled.

This will also effectively achieve organization in addition to significantly improving build times.

like image 160
dtech Avatar answered Sep 18 '22 11:09

dtech