It the frame is sunken, use QPalette:: Dark, otherwise use QPalette::Light.
Qt Code:
groupBox->setPalette(p);To copy to clipboard, switch view to plain text mode
It the frame is sunken, use QPalette:: Dark, otherwise use QPalette::Light.
Qt Code:
groupBox->setPalette(p);To copy to clipboard, switch view to plain text mode
J-P Nurmi
Strange, it does not work for me, not in code, and not in designer...
In your attached image I see you are working under windows... (I am under SUSE10)
Maybe its a window system issue?
I confirm that this code works on SuSE 10...try the following link
http://www.qtcentre.org/forum/showthread.php?t=2041
it's the same doubt that you posted!!!
This is in my code and it works
grpbox_right->setPalette(QPalette(Qt::darkBlue));
Nupul
I just found out that this code works where the other code snippets you suggested didn't work for me:
In all the code you supplied the group box was not parented, or its parent was not visible in the code supplied... I think it plays a role in this behaviour.Qt Code:
//grpControls is a QGroupBox which is parented to another widgetTo copy to clipboard, switch view to plain text mode
Another thing that bothers me is when I try to set the frame color with designer no color role changes the frame color...
Can you confirm this?
Thanks for your help!
@jpn
Yes, your last reply was the right answer!
Its the Plastique, and when I try this with another stlyle its behaves as expected.
Tanks!
Plastique style maybe? Then try:Originally Posted by high_flyer
Qt Code:
groupBox->setPalette(p);To copy to clipboard, switch view to plain text mode
QWindowsStyle lets QCommonStyle to draw PE_Frame primitive element. That's where I got the color group I advised to use. But anyway, it seems to depend on the used style. Such a pity, but for example QPlastiqueStyle seems to use a different color group for drawing frame rect...
You can check QxxxStyle::drawPrimitive()'s case PE_Frame for more information.
QPlastiqueStyle uses a merged color of darkened background palette color and highlight palette color or something like that..
J-P Nurmi
Bookmarks