Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Use same StyleSheets in build and runtime
moravas last edited by
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?
steno last edited by
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);