[Interest] working with external stylesheet in Qt Designer

Hamish Moffatt hamish at risingsoftware.com
Fri Apr 5 02:55:47 CEST 2013


tl;dr: is there any way to edit/preview forms in Qt Designer with 
stylesheet loaded from an external file?

My application has various custom forms and widgets I've designed in Qt 
Designer which depend extensively on stylesheets. For preview purposes 
I've put stylesheets into each form, but I have different styles 
depending on screen size and which skin is selected, so I need to load 
the style into qApplication once, but still be able to preview it in 

This looks like a common question from my googling; is there a solution? 
Here are some ideas which don't help;

1. Qt Stylesheets don't support CSS's @include (QTBUG-2047 proposes it)

2. In Designer's settings you can set up a preview with a stylesheet, 
but you have to specify the text (can't refer to a file)

3. A poster to the PyQT list hinted at creating a designer extension 
which automatically loaded the stylesheet from an external file but I 
haven't found any details. ( 
http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg16133.html ). 
How could this work?



More information about the Interest mailing list