Changing stylesheet in runtime
Unsolved
General and Desktop
-
int main(int argc, char *argv[]) { QApplication app(argc, argv); // Q_INIT_RESOURCE(dockwidgets); // w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint); bool bStyleIt = false; { QFile data("/home/einfochips/BEL_VMS_CLIENT/stylesheet.qss"); QString style; if (data.open(QFile::ReadOnly)) { QTextStream styleIn(&data); style = styleIn.readAll(); data.close(); app.setStyleSheet(style); bStyleIt = true; } } MainWindow w; w.setFixedSize(500,350); w.showMaximized(); return app.exec(); }
Hello this is my main.cpp of application where I want to set different themes. QFile data("/home/einfochips/BEL_VMS_CLIENT/stylesheet.qss"); This line reads stylesheet file and applies once I run application.
But I have another dialog with name theme.cpp where I have 3 radiobuttons which have some colors. So my question is how to apply stylesheeet to qAPP runtime?