Use same StyleSheets in build and runtime
I have a relative complex UI and I would like customize it by .css or .qss file. The problem is the following: How can I set a given .css file in the UI editor of the Qt Creator at any widgets styleSheet property and use this file at runtime as well?
The stylesheet property in the designer takes actual css, not a file name.
if ( styleSheet.open( QFile::ReadOnly ) )
QTextStream textStream( &styleSheet );
QString styleSheetContent = textStream.readAll(); styleSheet.close(); setStyleSheet(styleSheetContent);