21 m_pradRed =
new QRadioButton(
"&Red");
22 m_pradGreen =
new QRadioButton(
"&Green");
23 m_pradBlue =
new QRadioButton(
"&Blue");
24 m_pradGreen->setChecked(
true);
29 m_pchk =
new QCheckBox(
"&Light");
30 m_pchk->setChecked(
true);
33 QPushButton* pcmd =
new QPushButton(
"&Exit");
34 connect(pcmd, SIGNAL(clicked()), qApp, SLOT(quit()));
37 QVBoxLayout* pvbxLayout =
new QVBoxLayout;
38 pvbxLayout->addWidget(m_pradRed);
39 pvbxLayout->addWidget(m_pradGreen);
40 pvbxLayout->addWidget(m_pradBlue);
41 pvbxLayout->addWidget(m_pchk);
42 pvbxLayout->addWidget(pcmd);
43 setLayout(pvbxLayout);
51 QPalette pal = palette();
52 int nLight = m_pchk->isChecked() ? 150 : 80;
53 if(m_pradRed->isChecked()) {
54 pal.setColor(backgroundRole(), QColor(Qt::red).light(nLight));
56 else if(m_pradGreen->isChecked()) {
57 pal.setColor(backgroundRole(), QColor(Qt::green).light(nLight));
60 pal.setColor(backgroundRole(), QColor(Qt::blue).light(nLight));