View Full Version : Stylesheets
FuryCradle
25th September 2009, 07:33
Hello, how to import a qss file into my application, i dont wanna use an internal string variable, I'm planning to import it from a file since there's gonna be a lot of customization...
in setStyleSheet you can only specify a string, where can I specify a file name?
FuryCradle
25th September 2009, 07:44
i am sorry for being impatient but anyway i hope i am being useful, i figured it out by myself
QFIle file("path/to/file.qss");
file.open(QFile::ReadOnly);
QString styleSheet = QLating1String(file.readAll());
myapp->setStyleSheet(styleSheet);
sorry for troubles again
Lykurg
26th September 2009, 21:34
Just as a side note
QFile file("path/to/file.qss");
file.open(QFile::ReadOnly);
myapp->setStyleSheet(file.readAll());
file.close();
saves a not used local variable and an unnecessary transformation.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.