Yes, it is a cleaner solution.
In fact, it would work just as expected (as it does in CSS where the reference path is always the CSS file, and not the application or "index").
That also saves me from having to document it.
It just didn't occur to me that there was already a recognizable pattern for making the changes: url(
This works:
// Custom style sheet (QSS)... if (!options.sCustomStyleSheet.isEmpty()) { QFile file(options.sCustomStyleSheet); if (file.open(QFile::ReadOnly)) { QFileInfo fileInfo(options.sCustomStyleSheet); QString qssPath = fileInfo.path(); QString qssContent = QString::fromUtf8(file.readAll()); qssContent.replace("url(", "url("+qssPath+"/"); app.setStyleSheet(qssContent); file.close(); } }
Example QSS:
qtractorPluginListView {
background: url(Tecnico_Images/shelves.png);
}
Copyright (C) 2006-2025 rncbc aka Rui Nuno Capela. All rights reserved.
Powered by Drupal
Recent comments
52 min 35 sec ago
55 min 13 sec ago
4 hours 56 min ago
7 hours 16 min ago
8 hours 3 min ago
8 hours 15 min ago
12 hours 44 min ago
13 hours 10 min ago
14 hours 9 min ago
14 hours 19 min ago