Originally Posted by
wysota
The problem is that all rcc does is that it transforms a binary file into a C byte array and a directory doesn't have a "byte" representation. If you need to add a "directory", just add a new prefix and put all the files you want under the prefix.
All true, but this makes it still not impossible. It could be a shortcut for adding each file individually into the .qrc file. The qmake program could handle it automatically when it finds a directory in the .qrc file.
Instead of writing:
<qresource>
<file>DocsHTML/basic01.html</file>
<file>DocsHTML/basic02.html</file>
<file>DocsHTML/basic03.html</file>
<file>DocsHTML/basic04.html</file>
</qresource>
<qresource>
<file>DocsHTML/basic01.html</file>
<file>DocsHTML/basic02.html</file>
<file>DocsHTML/basic03.html</file>
<file>DocsHTML/basic04.html</file>
</qresource>
To copy to clipboard, switch view to plain text mode
The following:
<qresource>
<file>DocsHTML/</file>
</qresource>
<qresource>
<file>DocsHTML/</file>
</qresource>
To copy to clipboard, switch view to plain text mode
could be equivalent. All basic*.html files would be automatically added to the resource.
Of course there are other problems. The above syntax enhancement would be nice and easy to implement, it but would not yet allow the use of QDir. If this was a requirement, it would have to store somewhere the tree structure of the resource dir to be able to traverse it with a QDir like syntax.
And if there is a QDir like syntax, the next questions would be how to add new files and dirs to the resources, which would be way beyond the original scope of the resource system.
But this would be cool too. A portable ram disk for all Qt applications.
Bookmarks