The Qt resource file .qrc allows to split the embedded files into different prefixes
<RCC>
<qresource prefix="/qml">
<file alias="CustomWidget.qml">qml/CustomWidget.qml</file>
</qresource>
<qresource prefix="/icons">
<file alias="home.png">icons/home.png</file>
</qresource>
</RCC>
I often see developers redoing the filesystem hierarchy with prefixes like the example above. But in my opinion it is exactly the same as this for the caller code point of view :
<RCC>
<qresource>
<file>qml/CustomWidget.qml</file>
<file>icons/home.png</file>
</qresource>
</RCC>
In both cases you can use the file in C++ with the same syntax :/qml/CustomWidget.qml
.
Is there any advantage at using the prefix+alias over the filesystem path ?