本文整理汇总了C++中QCheckBox::palette方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::palette方法的具体用法?C++ QCheckBox::palette怎么用?C++ QCheckBox::palette使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::palette方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCheckBox
QList<QWidget*> ServiceItemDelegate::createItemWidgets() const
{
QCheckBox* checkBox = new QCheckBox();
QPalette palette = checkBox->palette();
palette.setColor(QPalette::WindowText, palette.color(QPalette::Text));
checkBox->setPalette(palette);
connect(checkBox, SIGNAL(clicked(bool)), this, SLOT(slotCheckBoxClicked(bool)));
KPushButton* configureButton = new KPushButton();
connect(configureButton, SIGNAL(clicked()), this, SLOT(slotConfigureButtonClicked()));
return QList<QWidget*>() << checkBox << configureButton;
}
示例2: headerDataChanged
void DiagramViewWrapper::headerDataChanged(Qt::Orientation orientation, int first, int last)
{
if (orientation == Qt::Horizontal)
{
for (int section = first; section <= last; ++section)
{
QCheckBox* cbox = m_lstCb[section];
cbox->setText(model()->headerData(section, orientation).toString());
// color highlight
QPalette p = cbox->palette();
QColor clrBkgd = qvariant_cast<QColor>(model()->headerData(section, Qt::Horizontal, Qt::DecorationRole));
p.setColor(cbox->backgroundRole(), clrBkgd);
if (clrBkgd.lightnessF() < 0.5)
{
p.setColor(cbox->foregroundRole(), Qt::white);
}
cbox->setPalette(p);
cbox->setAutoFillBackground(true);
}
}
}
示例3: QDialog
//.........这里部分代码省略.........
int curIdx = devices.indexOf(dev);
if(curIdx < 0)
{
#ifndef Q_OS_ANDROID
// assume its a file
ui->currentDeviceLabel->setText(dev);
m_filename = dev;
curIdx = devices.size() - 1;
#else
curIdx = 0;
#endif
}
ui->wifiDevice->setCurrentIndex(curIdx);
#ifndef Q_OS_ANDROID
// TODO confirm signal name
connect(ui->wifiDevice, SIGNAL(activated(int)), this, SLOT(wifiDeviceIdxChanged(int)));
#endif
ui->autoLocateAPs->setChecked(ms->autoGuessApLocations());
ui->guessMyLocation->setChecked(ms->showMyLocation());
MapRenderOptions renderOpts = ms->renderOpts();
ui->showReadingMarkers->setChecked(renderOpts.showReadingMarkers);
QStringList renderOptions = QStringList()
<< "(None)"
<< "Radial Lines"
<< "Circles"
<< "Rectangle";
MapGraphicsScene::RenderMode rm = ms->renderMode();
ui->renderType->addItems(renderOptions);
ui->renderType->setCurrentIndex((int)rm);
if(rm == MapGraphicsScene::RenderRadial)
{
ui->renderRadialOpts->setVisible(true);
ui->renderCircleOpts->setVisible(false);
}
else
if(rm == MapGraphicsScene::RenderCircles)
{
ui->renderRadialOpts->setVisible(false);
ui->renderCircleOpts->setVisible(true);
}
else
{
ui->renderRadialOpts->setVisible(false);
ui->renderCircleOpts->setVisible(false);
}
connect(ui->renderType, SIGNAL(currentIndexChanged(int)), this, SLOT(renderModeChanged(int)));
ui->multipleCircles->setChecked(renderOpts.multipleCircles);
ui->fillCircles->setChecked(renderOpts.fillCircles);
ui->circleSteps->setValue(renderOpts.radialCircleSteps);
ui->levelSteps->setValue(renderOpts.radialLevelSteps);
ui->angelDiff->setValue(renderOpts.radialAngleDiff);
ui->levelDiff->setValue(renderOpts.radialLevelDiff);
ui->lineWeight->setValue(renderOpts.radialLineWeight);
QList<MapApInfo*> apList = ms->apInfo();
QVBoxLayout *vbox = new QVBoxLayout(ui->apListBox);
QPushButton *btn;
QHBoxLayout *hbox = new QHBoxLayout();
btn = new QPushButton("Check All");
connect(btn, SIGNAL(clicked()), this, SLOT(selectAllAp()));
hbox->addWidget(btn);
btn = new QPushButton("Clear All");
connect(btn, SIGNAL(clicked()), this, SLOT(clearAllAp()));
hbox->addWidget(btn);
vbox->addLayout(hbox);
qSort(apList.begin(), apList.end(), OptionsDialog_sort_byEssid);
foreach(MapApInfo *info, apList)
{
QCheckBox *cb = new QCheckBox(QString("%1 (%2)").arg(info->essid).arg(info->mac.right(6)));
cb->setChecked(info->renderOnMap);
QPalette p = cb->palette();
p.setColor(QPalette::WindowText, m_scene->baseColorForAp(info->mac).darker());
cb->setPalette(p);
m_apCheckboxes[info->mac] = cb;
vbox->addWidget(cb);
}