Qt5 - setting background color to QPushButton and QCheckBox
I'm trying to change the background color of a QAbstractButton (either a QPushButton or QCheckBox) in Qt5 and having zero luck. This does nothing: pButton->setAutoFillBackground(true); QPalette palette = pButton->palette(); palette.setColor(QPalette::Window, QColor(Qt::blue)); pButton->setPalette(palette); pButton->show(); and if I try changing the style sheet: pButton->setStyleSheet("background-color: rgb(255,255,0);"); then Qt throws up its hands and draws an afwul-looking blocky button. There is a page titled " How to change the background color of QWidget " but it just talks about those