PDA

View Full Version : Where to put my stylesheets?



martinn
2nd February 2010, 13:56
In my Qt project I'm using the Qt Designer Editor when building my ui. I'm using stylesheets to set the styles of the different widgets around the project. My problem is that I want to use one file when creating my stylesheets, so that I have all styles in the same place. I could do everything in my centralWidgets's stylesheet property but as some of my widgets gets loaded into the project by code it doesn't seem to work in the Designer Editor. I also looked at this example but then it wont work in the Designer Editor either: http://wiki.forum.nokia.com/index.php/CS001502_-_Applying_a_Qt_style_sheet_to_an_application_via_Q Application

Where should I put my stylesheets if I want it to work also in Qt Designer Editor? Is there a way like in html to include the css file from somewhere?

aamer4yu
2nd February 2010, 14:54
Well, you can manually open the file, copy content and set the style sheet,,,,, cant you ?

martinn
2nd February 2010, 14:57
Thanks for your answer!

I'm not sure what you mean? To make my project easy to overlook I would like to have all my styles at one place. So it's easy to modify my styles. What file can I open and copy?

aamer4yu
2nd February 2010, 16:28
Well, as you said, you can set all the sheet in your central widget stylesheet. You can also include the stylesheet for widgets that get loaded later. Though you wont be able to see them in designer.


Is there a way like in html to include the css file from somewhere?
I guess yes,, I had read something familiar but cant recall. So lets wait for someone else to answer:)