Your approach sounds correct. The process is not as complex as it sounds. The only thing you need is to add the "smaller" qss file in the resources, under a specific prefix (eg. stylesheets
), and then automatically load and concatenate all these files. Sample code follows:
QDir stylesheetsDir(":/stylesheets");
QFileInfoList entries = stylesheetsDir.entryInfoList();
QString completeStylesheet = "";
foreach (QFileInfo fileInfo, entries)
{
QFile file(":/stylesheets/" + fileInfo.fileName(););
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
continue;
QTextStream in(&file);
completeStylesheet += in.readAll()
}