I tried various combinations of QPalette::Window and QPalette::Button; still no joy.
I tried various combinations of QPalette::Window and QPalette::Button; still no joy.
Hmm...
Which platforms work and which don't?
I would try stepping through the Qt code - and compare what is the difference between the working and the non working.
It might be even a Qt bug.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
You might also try experimenting with QWidget::setAutoFillBackground(true/false)
I fiddled some more, and never had any luck with the button backgrounds. I suspect it requires stylesheets to make it work, and that's just too much effort for something as conceptually simple as 'setBackground(myColor)'. So I went back to the color swatch approach and got that working after a fair amount of fiddling.
It was failing on Windows and on some Linux distros; other Linux distros worked just as I expected them to. So I don't think chasing platform-specific code variations is worthwhile, and it's something I just don't have time for anyway.
Bookmarks