Frame color/palette of QGroupBox?
-
Hi, I am trying to figure out the border color of
QGroupBox
. I have applied a fusion style and black palette toQApplication
and myQGroupBox
looks like this:
As you can see the border color ofQGroupBox
is neither black nor white but a shade of gray. I am trying to figure out which color is this.I have subclassed
QProxyStyle
and in itsdrawPrimitive()
function when the primitive element is equal toQStyle::PE_FrameGroupBox
I am printing all the colors that are available in its current palette in all its states (Active, inactive, and Disabled) but none of the colors seem to be the border color of theQGroupBox
.I tried to figure out the
QGroupBox
border color using the color picker fromQColorDialog
, here are the results for different palettes:- qApp->setPalette(QPalette{QColor{0,0,0}}) => QColor(ARGB 1, 0.0901961, 0.0901961, 0.0901961)
- qApp->setPalette(QPalette{QColor{10,10,10}}) => QColor(ARGB 1, 0.121569, 0.121569, 0.121569)
- qApp->setPalette(QPalette{QColor{20,20,20}}) => QColor(ARGB 1, 0.152941, 0.152941, 0.152941)
As you can see the border color does change with the change in the main color of the palette applied, how is this calculated and how can I get this programmatically from Qt?
-
Fusion style ignores palette for the groupbox frame and uses a hardcoded semi-transparent pixmap.
See the source.