Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can you suggest where can I find good documentation / examples how to write them?
Posted

1 solution

With Qt you can use the Qt Style Sheets to specify global and item specific styles. These can be stored in a file (which may be also embedded into the Qt app) and loaded upon program start. The advantage is that all style information is located in a single place and you don't have to use the Qt Designer for each widget.

I did not found examples for flat applications with Qt style sheets. But it is always up to you to design your application and even with examples you have to know the basics to modify the examples and add your own parts.

Some links:
Qt Style Sheets Examples[^]
Qt Style Sheets Reference[^]
 
Share this answer
 
Comments
Member 11143434 8-Jun-15 0:21am    
Thank you very much for your answer. It seems exactly what I need. My thanks also to developers of Qt for their well designed framework. I had never thought it would be so easy.
It is nowhere written where and how to write and read custom style sheets - so I write them to extra .qss file and read it whilst starting program. It is Ok ? Or is there something better?
Jochen Arndt 8-Jun-15 2:56am    
It is Ok to read the file in your app instance and call SetStyleSheet. But Qt has also some build-in command line options and one of them is '-stylesheet[= ]<path_to_file>'.
Member 11143434 8-Jun-15 4:37am    
Thanks:)
I knew about command line option - but it's not interesting for me (at least now)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900