* { ...}
:pressed { ... }
Better yet apply that on the parent or on the application object and use class or id selectors to select the object you want.
* { ...}
:pressed { ... }
Better yet apply that on the parent or on the application object and use class or id selectors to select the object you want.
Thanks wysota,
And why?Better yet apply that on the parent or on the application object and use class or id selectors to select the object you want.
Greets,
Weilor
Because you'll have more control. Doubts like this one wouldn't even occur, because you'd be calling the object by name.
Hi wysota!
If I want to change only the font color of a widget by using stylesheets,
say i write it like this
this->setStyleSheet("color: red");
and this works fine.
but unfortunately if the font like bold, italic, underline... are set to true while calling the
setStyleSheet(..); I notice that font is loosing all those attributes like bold, underline, italic....
Is it a limitation of style sheets.
AFAIK, stylesheets are not good enough. because, if you are interested in changin only the font color, why should one worry about the other attributes like font bold, italic....?
Hi Diams,
You should read the doc and see that if you use style sheet, it erases everything from QPalette
and setFont is at the same level as QPalette ( don't ask exactly how does it work)
but you should take the choice between Qpalette and style sheet
for font bold:
Qt Code:
To copy to clipboard, switch view to plain text mode
that's all
david
Hi David
This implementation is not a good idea, isn't it?it erases everything from QPalette
Thanks for the reply
Using style sheet seems the best and powerful way
otherwise from the doc its is said:
Do not use this function(setPalette()) in conjunction with Qt Style Sheets. When using style sheets, the palette of a widget can be customized using the "color", "background-color", "selection-color", "selection-background-color" and "alternate-background-color".
how to set the text underline property by using stylesheets?
QLabel {color:blue; font:bold;}
the above example works fine for foreground color and font bold attributes.
But I couldn't see anywehere in Qt documentation about how to set the underline attribute.
Could anyone help me please?
-James
so, there is no way we can set the
{ font : underline; } attribute through stylesheets???
NOTE: { font : underline; } fails. This is not the right way of doing it.
But i dont know the right way either.
I don't know if Qt supports it, but in CSS it should be "text-decoration: underline;" as far as I remember.
dyams (21st January 2008)
dyams (21st January 2008)
Bookmarks