According to Qt's QWidget documentation:
QWidget propagates explicit palette roles from parent to child. If you assign a brush or color to a specific role on a palette and assign that palette to a widget, that role will propagate to all the widget's children, overriding any system defaults for that role.
I have a widget hierarchy:
QMainWindow 'window'
|_QGroupBox 'box'
|_QLabel 'label'
|_QLabel 'label2'
So if I were to call box->setPalette(somePalette)
the new palette is used to paint box
, label
and label2
Now I want to undo this, i.e. I want box
, label
and label2
to use my default palette, which is easy, I call box->setPalette(window->palette())
right?
The issue with this is box
still technically has a custom palette set (it makes a deep copy of the palette you pass it), if I modify the palette of window
it no longer propagates through box
to label
and label2
.
So, how do I actually remove the palette from box
so that palette propogation is restored?