当前位置: 首页>>代码示例>>C++>>正文


C++ QCheckBox::palette方法代码示例

本文整理汇总了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;
}
开发者ID:blue-shell,项目名称:folderview,代码行数:13,代码来源:serviceitemdelegate.cpp

示例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);
        }
    }
}
开发者ID:teugen,项目名称:Chart-builder,代码行数:22,代码来源:diagramviewwrapper.cpp

示例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);
	}
开发者ID:aicconsulting,项目名称:wifisigmap,代码行数:101,代码来源:OptionsDialog.cpp


注:本文中的QCheckBox::palette方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。