PDA

View Full Version : website of suggested styles for widgets



valerianst
5th September 2013, 15:25
Hi there guys,

do you know if exist a website or any type of resource of nice text to input in the setStyleSheet method?

IIt would be nice something like: preview-image-of-the-widget ---------> code


I hope it exists!

Cheers!

wysota
5th September 2013, 16:00
Could you elaborate what you mean? What is "preview-image-of-the-widget"?

valerianst
5th September 2013, 16:57
Could you elaborate what you mean? What is "preview-image-of-the-widget"?

Sure!

I mean something like: (A) --> (B)

where (A) is the image of the widget:
________________
|_my___button____|


and (B) is the code necessary to obtain that result:

for instance:



mywidget->setStyleSheet("color: blue;"
"background-color: yellow;"
"selection-color: yellow;"
"selection-background-color: blue;");



If no site of this type exists, it would be nice to know at least the exact styles of the Qt widgets. I haven't found this information in the wiki :(

wysota
5th September 2013, 17:12
Sure!

I mean something like: (A) --> (B)

where (A) is the image of the widget:
________________
|_my___button____|


and (B) is the code necessary to obtain that result:

for instance:



mywidget->setStyleSheet("color: blue;"
"background-color: yellow;"
"selection-color: yellow;"
"selection-background-color: blue;");


There are a lot of CSS examples in the Web.




If no site of this type exists, it would be nice to know at least the exact styles of the Qt widgets. I haven't found this information in the wiki :(
Style Sheets Reference

valerianst
10th September 2013, 11:51
There are a lot of CSS examples in the Web.




Style Sheets Reference

Hi, thank you for the links.

Unfortunately, it's not what I was looking for.. that link doesn't show the exact styles of the Qt widgets but only some example..

About the CSS, yep.. you're right.. but as you said they are.. CSS. Thank you anyway :)

wysota
10th September 2013, 15:06
Qt doesn't use stylesheets to draw its controls, so you won't see such definition.

valerianst
11th September 2013, 14:54
Qt doesn't use stylesheets to draw its controls, so you won't see such definition.

Ok, can I ask you what does it use? is there any change to get the information from which I can create a correspondent stylesheet?

wysota
11th September 2013, 15:14
Ok, can I ask you what does it use?
It uses QStyle API that may perform direct painting calls or delegate drawing to the system.


is there any change to get the information from which I can create a correspondent stylesheet?
I don't understand your question. If you are asking whether you can precisely mimic the default look using stylesheets then no, you can't.

valerianst
11th September 2013, 15:27
It uses QStyle API that may perform direct painting calls or delegate drawing to the system.


I don't understand your question. If you are asking whether you can precisely mimic the default look using stylesheets then no, you can't.

Yes I was asking that.. it's very strange that I can't do it.. it should be possible using the right definition. Why can't I?

wysota
11th September 2013, 21:23
Why can't I?
Because expressiveness of stylesheets is not big enough to handle everything Qt draws. And in addition to that system drawn styles can have themes which simply can't be mimicked by a static style sheet.

valerianst
18th September 2013, 10:08
Ok I understand. Thank you very much for all your explanations!