Search code examples
qtresourcesqmlqt-creator

Adding resources to QML project results in very slow compilation


I have added some icons to the resource file of my project and suddenly every tiny change to the QML code results in 7-8 seconds of wait time before the project is ran, it almost feels like it is recompiling the C++ code, but in reality that's the delay from the "compilation" of the qrc file.

I tried disabling qrc compression in hopes that it will get faster, but it didn't have any effect. This is very strange and annoying, considering the fact I am using a high end system with a fast CPU and SSD - the extra resources are only 2 megabytes, why is it taking so long? Adding the same files to an archive with high compression takes about 5 milliseconds.


Solution

  • OK, still no clue why is it so slow, but I found a way to avoid it.

    The problem was that for every tiny change to QML sources the entire resource file was recompiled. So I moved all the images to another resource file, didn't have to do anything else, no need to change paths or anything, now QML code is in a different resource file and the one with the images is no longer recompiled on every change, so the project launches instantaneously.