In case of paletes, I would think their icons are located in separate directories, i.e.
@paletes
|_dark
| |_icon.png
|_light
|_icon.png
@
Honestly, I would do something like this, because this way I have more control of what's going on rather than letting resource system do this.
@enum Palette {
PALETTE_DEFAULT = 0,
PALETTE_DARK,
PALETTE_LIGHT
};
void switchPalette(Palette iPalette)
{
QString prefix;
switch (iPalette) {
case PALETTE_DARK:
prefix = "dark";
break;
case PALETTE_LIGHT:
case PALETTE_DEFAULT:
prefix = "light";
break;
}
// use QIcon(QString(":/%1/icon.png").arg(prefix));
}@
I admit this solution is not "beautiful" enough (as we say). But I would do this way.