QRC add folder
-
Hi,
I'm trying to read a folder's content who contains another folder and files in theses folders.
The organisation of the content can be resume with the following schema:- Ressources - fileressource - fileressource - ... - players - player1 - info.txt - icon.png - sprite.png - player1 - info.txt - icon.png - sprite.png - fileressource
What i want is to get something like this:
QStringList playersFolder = QDir(":players").entryList(); // Expected { "James", "Maximus" } (without take in account dot and dotdot) for (auto playerFolder : playersFolder) { QString pathInfo = playerFolder + "/info.txt"; QString pathIcon = playerFolder + "/icon.png"; QString pathSprite = playerFolder + "/sprite.png"; }
But what I have is
playersFolder = {"icon.png", "info.png", "James", "Maximus", "sprite.png"}
My QRC is like this:
<RCC version="1.0"> <qresource> <file>players</file> </qresource> </RCC>
So i'm confused
-
Hi,
AFAIK, and following the documentation, you are expected to list all files explicitly in the .qrc file. I am currently surprised you are not getting an error when compiling your application.
-
Hi,
AFAIK, and following the documentation, you are expected to list all files explicitly in the .qrc file. I am currently surprised you are not getting an error when compiling your application.
-
What do you mean by "I want to do this dynamically" ?
-
That's not how the resource system is working. You either build the resources as part of your application or build an external binary resource.
You have all the information you need here.