PDA

View Full Version : Qt Style Sheets Problems with QDialog



Lykurg
5th November 2006, 12:33
Hi,

in my application-wide css i define
* {color: #333333;}
QPushButton[enabled="false"] {color: FF0000;}
This works in my "normal" Application. But if i start a normal QDialog-Subclass via
dgl_xyz dgl( this, Qt::Dialog );
dgl.setAttribute( Qt::WA_ShowModal );
if ( dgl.exec() == QDialog::Accepted )
{
//...
} the fonts color is #333333, but the font of the disabled QPushButtons are also gray instead of red.


What's wrong?


Thanks,

Lykurg

jacek
5th November 2006, 13:07
How about:QPushButton:enabled {color: FF0000;}?

Lykurg
5th November 2006, 13:19
works! So I learnd
QPushButton:disabled != QPushButton[enabled="false"]
in every case.

Thanks

jacek
5th November 2006, 14:43
works! So I learnd
QPushButton:disabled != QPushButton[enabled="false"]
in every case.
That's probably because of this:
Warning: If the value of the property changes after the style sheet has been set, it might be necessary to force a style sheet recomputation. One way to achieve this is to unset the style sheet and set it again.