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


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

本文整理汇总了C++中QCheckBox::setDisabled方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setDisabled方法的具体用法?C++ QCheckBox::setDisabled怎么用?C++ QCheckBox::setDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QCheckBox的用法示例。


在下文中一共展示了QCheckBox::setDisabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createEditor

QWidget* MyBooleanItemDelegate::createEditor(QWidget*parent, const QStyleOptionViewItem&, const QModelIndex&) const
{
    QCheckBox* editorWidget = new QCheckBox(parent);
    if (!readOnly)
    {
        if (essence != 0)
        {
            essence->saveOldValues();
            disconnect(this, SIGNAL(closeEditor(QWidget*)), this, SLOT(calculate()));
            connect(this, SIGNAL(closeEditor(QWidget*)), this, SLOT(calculate()));
            editorWidget->setDisabled(false);
        }
    }
开发者ID:morozovvl,项目名称:qbalance,代码行数:13,代码来源:mybooleanitemdelegate.cpp

示例2: addTableRow

void GUIWidget::addTableRow()
{
  if(m_pTableWidget){
    int rowNumber = m_pTableWidget->rowCount();
    m_pTableWidget->insertRow(rowNumber);
    QCheckBox* pCheckBox = new QCheckBox();
    pCheckBox->setDisabled(true);
    m_pTableWidget->setCellWidget(rowNumber,0, pCheckBox);
    QDateEdit* pQde1 = new QDateEdit();
    pQde1->setDisabled(true);
    QDateEdit* pQde2 = new QDateEdit();
    pQde2->setDisabled(true);
    pQde2->setDateTime(QDateTime::currentDateTime());
    m_pTableWidget->setCellWidget(rowNumber,2, pQde1);
    m_pTableWidget->setCellWidget(rowNumber,3, pQde2);
  }
}
开发者ID:WeizhongDai,项目名称:qttrader,代码行数:17,代码来源:GUIWidget.cpp

示例3: addMaterialScenario

void MainWindow::addMaterialScenario(int index, QString name, QString abbr) {
	EscenarioMaterialCustom* new_scenario = main_scenario.createCustomMaterialScenario(index, name.toStdWString(), abbr.toStdString());
	for (MaterialConfigUI* config: materials_ui)
		config->escenarioAdded(index, name);
	for (StrengthFunctionConfig* config: strength_functions_ui)
		config->escenarioAdded(index, name);
	QCheckBox* qcheckbox = new QCheckBox(name + " (" + abbr + ")", ui->groupBox_escenarios);
	qcheckbox->setChecked(true);
	if (index == MaterialProperty::ORIGINAL_VALUE)
		qcheckbox->setDisabled(true);
	ui->widget_materials->layout()->addWidget(qcheckbox);
	for (Material &material: main_scenario.materials) {
		if (material.type == 0) {
			general_material_config.addScenario(new_scenario, material, main_scenario.strength_functions.size() > 0);
			break;
		}
	}
	index_qcheckbox_material_scenario[index] = qcheckbox;
	qcheckbox_material_scenario_index[qcheckbox] = index;
	connect(qcheckbox, SIGNAL(toggled(bool)), this, SLOT(toggleMaterialScenario(bool)));
}
开发者ID:conejoo,项目名称:Escenarios,代码行数:21,代码来源:mainwindow.cpp

示例4: refreshROMInfos

void ROMSelectionDialog::refreshROMInfos() {
	QString controlROMFileName = synthProfile.controlROMFileName;
	QString pcmROMFileName = synthProfile.pcmROMFileName;

	clearButtonGroup(controlROMGroup);
	clearButtonGroup(pcmROMGroup);
	controlROMRow = -1;
	pcmROMRow = -1;

	QStringList fileFilter = ui->fileFilterCombo->itemData(ui->fileFilterCombo->currentIndex()).value<QStringList>();
	QStringList dirEntries = synthProfile.romDir.entryList(fileFilter);
	ui->romInfoTable->clearContents();
	ui->romInfoTable->setRowCount(dirEntries.size());

	int row = 0;
	for (QStringListIterator it(dirEntries); it.hasNext();) {
		QString fileName = it.next();
		FileStream file;
		if (!file.open((synthProfile.romDir.absolutePath() + QDir::separator() + fileName).toUtf8())) continue;
		const ROMInfo *romInfoPtr = ROMInfo::getROMInfo(&file);
		if (romInfoPtr == NULL) continue;
		const ROMInfo &romInfo = *romInfoPtr;

		QButtonGroup *romGroup;
		QString romType;
		switch (romInfo.type) {
			case ROMInfo::PCM:
				romType = QString("PCM");
				romGroup = &pcmROMGroup;
				if (pcmROMRow == -1) pcmROMRow = row;
				break;
			case ROMInfo::Control:
				romType = QString("Control");
				romGroup = &controlROMGroup;
				if (controlROMRow == -1) controlROMRow = row;
				break;
			case ROMInfo::Reverb:
				romType = QString("Reverb");
				romGroup = NULL;
				break;
			default:
				MT32Emu::ROMInfo::freeROMInfo(romInfoPtr);
				continue;
		}

		if (fileName == controlROMFileName) {
			controlROMRow = row;
		} else if (fileName == pcmROMFileName) {
			pcmROMRow = row;
		}

		int column = 0;
		QCheckBox *checkBox = new QCheckBox();
		if (romInfo.type != ROMInfo::Reverb) {
			romGroup->addButton(checkBox);
			romGroup->setId(checkBox, row);
		} else checkBox->setDisabled(true);
		ui->romInfoTable->setCellWidget(row, column++, checkBox);

		if (controlROMRow == row || pcmROMRow == row) {
			checkBox->setChecked(true);
		}

		QTableWidgetItem *item = new QTableWidgetItem(fileName);
		item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
		ui->romInfoTable->setItem(row, column++, item);

		item = new QTableWidgetItem(QString(romInfo.shortName));
		item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
		ui->romInfoTable->setItem(row, column++, item);

		item = new QTableWidgetItem(QString(romInfo.description));
		item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
		ui->romInfoTable->setItem(row, column++, item);

		item = new QTableWidgetItem(romType);
		item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
		ui->romInfoTable->setItem(row, column++, item);

		item = new QTableWidgetItem(QString(romInfo.sha1Digest));
		item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
		ui->romInfoTable->setItem(row, column++, item);

		MT32Emu::ROMInfo::freeROMInfo(romInfoPtr);
		row++;
	}
	ui->romInfoTable->setRowCount(row);
	ui->romInfoTable->resizeColumnsToContents();
}
开发者ID:polluks,项目名称:munt,代码行数:89,代码来源:ROMSelectionDialog.cpp


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