QCheckBox* checkBox = new QCheckBox("Checkbox", this); checkBox->setStyleSheet("QCheckBox { color: blue; }");
QCheckBox* checkBox = new QCheckBox("Checkbox", this); checkBox->setStyleSheet("QCheckBox::indicator:checked { background-color: green; }");This example sets the background color of the checkbox to green when it is checked. These examples use the Qt package library.