#include int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget myWidget; QVBoxLayout *layout = new QVBoxLayout; QPushButton *push1 = new QPushButton("checkable"); QPushButton *push2 = new QPushButton("bold"); push2->setObjectName("bold"); myWidget.setStyleSheet("QPushButton { color: blue; } QPushButton:checked { color: red; font-weight: bold; } QPushButton#bold { font-weight: bold; }"); push1->setCheckable(true); layout->addWidget(push1); layout->addWidget(push2); myWidget.setLayout(layout); myWidget.show(); return app.exec(); }