Multiple .qrc files in one application
-
Hi,
I have a general question about how multiple .qrc files work together.
Let's say I have qml.qrc and another.qrc.
In my project I can only reference to the content of qml.qrc, the another.qrc is simply not visible.
My .pro file hasRESOURCES += qml.qrc another.qrc
The conent of qml.qrc is
<RCC>
<qresource prefix="/Test">
<file>main.qml</file>
</qresource>
</RCC>and another.qrc looks like this
<RCC>
<qresource prefix="/Graphics">
<file>MyBeautifulIcon.png</file>
</qresource>
</RCC>I have no clue why Qt only works with qml.qrc.
-
Okay, I figured out what was wrong.
I used the wrong names to reference the files. I never assumed that the relative paths are part of the name
as well.So instead of
qrc:/MyFace.png
I have to use the full name just as it is defined inside the qrc file.
<file>assets/Subdirectory/MyFace.png</file>
becomes
qrc:/assets/Subdirectory/MyFace.png
This is one stupid mistake of me.
Now, in order to make it work without having to use the fullnames I simply use a file alias.
<file alias="MyFace.png">assets/Subdirectory/MyFace.png</file>
andqrc:/MyFace.png
works.