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


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

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


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

示例1: updateTestSummary

void CTestSummaryWindow::updateTestSummary()
{
    _testSummaryTree->clear();
    int i;

    QCheckBox* check;

    for(i=0;i <= INIT_TEST_COUNT;i++)
    {
        if(i == 0)
            _initTreeItem[i] = new QTreeWidgetItem(_testSummaryTree,QStringList(QString(tr(initTArray[i]._title.toLatin1().data()))));
        else
        {
            _initTreeItem[i] = new QTreeWidgetItem(_initTreeItem[0],QStringList(QString(tr(initTArray[i]._title.toLatin1().data()))));
            //_testSummaryTree->model()->setData(QModelIndex(1), Qt::TextAlignmentRole, Qt::AlignCenter);

            _testSummaryTree->model()->setData(_testSummaryTree->model()->index(0,i), Qt::TextAlignmentRole, Qt::AlignCenter);
        }
        check = new QCheckBox;
        check->setEnabled(false);
        _testSummaryTree->setItemWidget(_initTreeItem[i], 1, check);
    }

    for(i=0; i <= FULL_TEST_COUNT;i++)
    {
        if(i == 0)
            _fullTreeItem[i] = new QTreeWidgetItem(_testSummaryTree,QStringList(QString(tr(fullTArray[i]._title.toLatin1().data()))));
        else
            _fullTreeItem[i] = new QTreeWidgetItem(_fullTreeItem[0],QStringList(QString(tr(fullTArray[i]._title.toLatin1().data()))));
        check = new QCheckBox;
        check->setEnabled(false);
        _testSummaryTree->setItemWidget(_fullTreeItem[i], 1, check);
    }

    for(i=0; i <= ADJUST_TEST_COUNT;i++)
    {
        if(i == 0)
            _adjustTreeItem[i] = new QTreeWidgetItem(_testSummaryTree,QStringList(QString(tr(adjustTArray[i]._title.toLatin1().data()))));
        else
            _adjustTreeItem[i] = new QTreeWidgetItem(_adjustTreeItem[0],QStringList(QString(tr(adjustTArray[i]._title.toLatin1().data()))));
        check = new QCheckBox;
        check->setEnabled(false);
        _testSummaryTree->setItemWidget(_adjustTreeItem[i], 1, check);
    }

    for(i=0;i <= FUNCTION_TEST_COUNT;i++)
    {
        if(i == 0)
            _functionTreeItem[i] = new QTreeWidgetItem(_testSummaryTree,QStringList(QString(tr(functionTArray[i]._title.toLatin1().data()))));
        else
            _functionTreeItem[i] = new QTreeWidgetItem(_functionTreeItem[0],QStringList(QString(tr(functionTArray[i]._title.toLatin1().data()))));
        check = new QCheckBox;
        check->setEnabled(false);
        _testSummaryTree->setItemWidget(_functionTreeItem[i], 1, check);
    }
    _testSummaryTree->expandAll();
}
开发者ID:jiacheng2012,项目名称:311_tester,代码行数:57,代码来源:ctestsummarywindow.cpp

示例2: setSize

static void setSize(QLineEdit & widthED, LengthCombo & widthUnitCO,
	QLineEdit & heightED, LengthCombo & heightUnitCO,
	QCheckBox & aspectratioCB,
	external::ResizeData const & data)
{
	bool using_scale = data.usingScale();
	string scale = data.scale;
	if (data.no_resize()) {
		// Everything is zero, so default to this!
		using_scale = true;
		scale = "100";
	}

	if (using_scale) {
		doubleToWidget(&widthED, scale);
		widthUnitCO.setCurrentItem("scale");
	} else
		lengthToWidgets(&widthED, &widthUnitCO,
				data.width.asString(), Length::defaultUnit());

	string const h = data.height.zero() ? string() : data.height.asString();
	Length::UNIT const default_unit = data.width.zero() ?
		Length::defaultUnit() : data.width.unit();
	lengthToWidgets(&heightED, &heightUnitCO, h, default_unit);

	heightED.setEnabled(!using_scale);
	heightUnitCO.setEnabled(!using_scale);

	aspectratioCB.setChecked(data.keepAspectRatio);

	bool const disable_aspectRatio = using_scale ||
		data.width.zero() || data.height.zero();
	aspectratioCB.setEnabled(!disable_aspectRatio);
}
开发者ID:xavierm02,项目名称:lyx-mathpartir,代码行数:34,代码来源:GuiExternal.cpp

示例3: returnWidget

QWidget* CObjectProperty::returnWidget(QWidget *parent_) {
    if(m_visible) {
        if(m_type == "string") {
            QLineEdit* newWidget = new QLineEdit(parent_);
            if(!m_editable) newWidget->setEnabled(false);
            newWidget->setText(m_property.toString());
            QObject::connect(this,SIGNAL(signal_propertyChanged(QString)),newWidget,SLOT(setText(QString)));
            QObject::connect(newWidget,SIGNAL(textChanged(QString)),this,SLOT(slot_propertyChanged(QString)));
            return newWidget;
        } else if(m_type == "longlong") {
            QLineEdit* newWidget = new QLineEdit(parent_);
            if(!m_editable) newWidget->setEnabled(false);
            QValidator* validator = new QIntValidator();
            newWidget->setValidator(validator);
            newWidget->setText(m_property.toString());
            QObject::connect(this,SIGNAL(signal_propertyChanged(QString)),newWidget,SLOT(setText(QString)));
            QObject::connect(newWidget,SIGNAL(textChanged(QString)),this,SLOT(slot_propertyChanged(QString)));
            return newWidget;
        } else if(m_type == "bool") {
            QCheckBox* newWidget = new QCheckBox(parent_);
            if(!m_editable) newWidget->setEnabled(false);
            newWidget->setChecked(m_property.toBool());
            QObject::connect(this,SIGNAL(signal_propertyChanged(bool)),newWidget,SLOT(setChecked(bool)));
            QObject::connect(newWidget,SIGNAL(toggled(bool)),this,SLOT(slot_propertyChanged(bool)));
            return newWidget;
        }
    }
开发者ID:powerpaul17,项目名称:qAPV,代码行数:27,代码来源:cobjectproperty.cpp

示例4: setPinModeOutput

// _____________________________________________________________________
void CRaspiGPIO::setPinModeOutput(unsigned int gpio_num, unsigned int init_state)
{
    pinMode(gpio_num, OUTPUT);
    digitalWrite(gpio_num, init_state);

    QString txt = "O";
    QString tooltip = "Digital Output";
    QLabel *lbl = m_ihm.findChild<QLabel*>(PREFIX_MODE_GPIO + QString::number(gpio_num));
    if (lbl) {
        lbl->setText(txt);
        lbl->setToolTip(tooltip);
        lbl->setEnabled(true);
    }
    QLabel *lbl_name = m_ihm.findChild<QLabel*>(PREFIX_GPIO_NAME + QString::number(gpio_num));
    if (lbl_name) {
        lbl_name->setEnabled(true);
    }

    QCheckBox *checkbox = m_ihm.findChild<QCheckBox*>(PREFIX_CHECKBOX_WRITE + QString::number(gpio_num));
    if (checkbox) {
        checkbox->setEnabled(true);
    }
    m_raspi_pins_config[gpio_num] = tRaspiPinConfig { OUTPUT, PUD_OFF, init_state};

    // Crée la data dans le data manager et l'associe à une callback pour déclencher l'écriture sur le port sur changement de valeur de la data
    QString dataname = PREFIX_RASPI_OUT_DATANAME + QString::number(gpio_num);
    m_application->m_data_center->write(dataname, init_state);
    CData *data = m_application->m_data_center->getData(dataname);
    if (data) {
        connect (data, SIGNAL(valueUpdated(QVariant)), this, SLOT(onDataChangeWrite(QVariant)));
    }
}
开发者ID:CRLG,项目名称:LABOTBOX,代码行数:33,代码来源:CRaspiGPIO.cpp

示例5: setProperties

void AbstractCameraManager::setProperties(std::vector<CameraProperty> &properties) {
    cameraProperties = std::vector<CameraProperty>(properties);
    for(unsigned int i=0; i<cameraProperties.size(); i++) {
        CameraProperty &property = cameraProperties.at(i);
        //qDebug() << property.getName().c_str() << reinterpret_cast<quintptr>(&property);
        QTreeWidgetItem* it = new QTreeWidgetItem();
        it->setText( Ui::PropertyName, property.getName().c_str());
        propertiesList.addTopLevelItem(it);
        //checkbox
        QCheckBox* box = new QCheckBox();
        box->setProperty("CameraProperty", QVariant::fromValue(reinterpret_cast<quintptr>(&property)) );

        if(!property.getCanAuto()) box->setEnabled(false);
        propertiesList.setItemWidget(it, Ui::PropertyAuto, box);
        connect( box, SIGNAL(stateChanged(int)), this, SLOT(on_propertyCheckbox_changed(int)) );
        //slider
        if( property.getType() == CameraManager::AUTOTRIGGER ) continue;
        QSlider* slider = new QSlider(Qt::Horizontal);
        slider->setProperty("CameraProperty", QVariant::fromValue(reinterpret_cast<quintptr>(&property)) );
        slider->setProperty("TreeWidgetItem", QVariant::fromValue(reinterpret_cast<quintptr>(it)) );
        slider->setTracking(true); //might be wanted
        slider->setRange(property.getMinToSlider(), property.getMaxToSLider());
        propertiesList.setItemWidget(it, Ui::PropertySlider, slider);

        box->setProperty("TreeWidgetSlider", QVariant::fromValue(reinterpret_cast<quintptr>(slider)) );
        connect( slider, SIGNAL(valueChanged(int)), this, SLOT(on_propertySlider_changed(int)) );
    }
    propertiesList.resizeColumnToContents(0);
    propertiesList.resizeColumnToContents(1);
    propertiesList.resizeColumnToContents(2);
}
开发者ID:Antoinephi,项目名称:Project-Norway,代码行数:31,代码来源:abstractcameramanager.cpp

示例6: createWidgets

	QWidget* createWidgets(BasePropertyWidget* parent)
	{
		m_checkBox = new QCheckBox(parent);
		m_checkBox->setEnabled(!parent->readOnly());
		QObject::connect(m_checkBox, &QCheckBox::clicked, parent, &BasePropertyWidget::setWidgetDirty);
		return m_checkBox;
	}
开发者ID:cguebert,项目名称:SofaViewer,代码行数:7,代码来源:NumericalPropertyWidget.cpp

示例7: actionChanged

void OptionsPopup::actionChanged()
{
    QAction *action = qobject_cast<QAction *>(sender());
    QTC_ASSERT(action, return);
    QCheckBox *checkbox = m_checkboxMap.value(action);
    QTC_ASSERT(checkbox, return);
    checkbox->setEnabled(action->isEnabled());
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:8,代码来源:findtoolbar.cpp

示例8: disableCheckbox

void SensorsDialog::disableCheckbox(int index)
{
    QCheckBox *cb = getCheckboxPtr(index);

    if (cb != NULL) {
        cb->setText("");
        cb->setEnabled(false);
        cb->setVisible(false);
    }
}
开发者ID:SLURM-RJMS-RESEARCH,项目名称:thermal_daemon,代码行数:10,代码来源:sensorsdialog.cpp

示例9: setCheckBoxCheckedForPlayer

void CTicTacToe::setCheckBoxCheckedForPlayer(QObject* sender, int player)
{
    /**
     * @param: QObject sender: Object to the pressed Checkbox
     * @param: int player: Player who play
     */

    Qt::CheckState pCheckState = getPlayerCheckBoxState(player);
    QCheckBox* box = static_cast<QCheckBox*>(sender);
    box->setCheckState(pCheckState);
    box->setEnabled(false);
}
开发者ID:MiniKahn,项目名称:TicTacTest,代码行数:12,代码来源:TicTacToe.cpp

示例10: onSelectedKnobChanged

 void onSelectedKnobChanged()
 {
     if (!selectedKnob) {
         return;
     }
     KnobParametricPtr isParametric = toKnobParametric( selectedKnob->getKnob() );
     if (isParametric) {
         useAliasCheckBox->setChecked(true);
     }
     useAliasLabel->setEnabled(!isParametric);
     useAliasCheckBox->setEnabled(!isParametric);
 }
开发者ID:kcotugno,项目名称:Natron,代码行数:12,代码来源:PickKnobDialog.cpp

示例11: onSelectedKnobChanged

 void onSelectedKnobChanged()
 {
     if (!selectedKnob) {
         return;
     }
     KnobParametric* isParametric = dynamic_cast<KnobParametric*>( selectedKnob->getKnob().get() );
     if (isParametric) {
         useAliasCheckBox->setChecked(true);
     }
     useAliasLabel->setEnabled(!isParametric);
     useAliasCheckBox->setEnabled(!isParametric);
 }
开发者ID:jessezwd,项目名称:Natron,代码行数:12,代码来源:PickKnobDialog.cpp

示例12: QCheckBox

QCheckBox *OptionsPopup::createCheckboxForCommand(Id id)
{
    QAction *action = ActionManager::command(id)->action();
    QCheckBox *checkbox = new QCheckBox(action->text());
    checkbox->setToolTip(action->toolTip());
    checkbox->setChecked(action->isChecked());
    checkbox->setEnabled(action->isEnabled());
    checkbox->installEventFilter(this); // enter key handling
    QObject::connect(checkbox, &QCheckBox::clicked, action, &QAction::setChecked);
    QObject::connect(action, &QAction::changed, this, &OptionsPopup::actionChanged);
    m_checkboxMap.insert(action, checkbox);
    return checkbox;
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:13,代码来源:findtoolbar.cpp

示例13: addRotationButton

void KRandRModule::addRotationButton(int thisRotation, bool checkbox)
{
	Q_ASSERT(m_rotationGroup);
	if (!checkbox) {
		QRadioButton* thisButton = new QRadioButton(RandRScreen::rotationName(thisRotation), m_rotationGroup);
		thisButton->setEnabled(thisRotation & currentScreen()->rotations());
		connect(thisButton, SIGNAL(clicked()), SLOT(slotRotationChanged()));
	} else {
		QCheckBox* thisButton = new QCheckBox(RandRScreen::rotationName(thisRotation), m_rotationGroup);
		thisButton->setEnabled(thisRotation & currentScreen()->rotations());
		connect(thisButton, SIGNAL(clicked()), SLOT(slotRotationChanged()));
	}
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例14: addCheck

// Create new checkbox widget
QtWidgetObject* AtenTreeGuiDialog::addCheck(TreeGuiWidget* widget, QString label)
{
	QtWidgetObject* qtwo = widgetObjects_.add();
	QCheckBox *check = new QCheckBox(this);
	qtwo->set(widget, check);
	check->setText(label);
	check->setChecked(widget->valueI());
	check->setEnabled(widget->enabled());
	check->setVisible(widget->visible());
	check->setMinimumHeight(WIDGETHEIGHT);
	check->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	// Connect signal to master slot
	QObject::connect(check, SIGNAL(clicked(bool)), this, SLOT(checkBoxWidget_clicked(bool)));
	return qtwo;
}
开发者ID:alinelena,项目名称:aten,代码行数:16,代码来源:treegui_funcs.cpp

示例15: QFormLayout

SGMBeamlineDetectorConnectionView::SGMBeamlineDetectorConnectionView(QWidget *parent) :
	QWidget(parent)
{
	fl_ = new QFormLayout();
	QList<AMOldDetector*> possibleDetectors = SGMBeamline::sgm()->possibleDetectorsForSet(SGMBeamline::sgm()->allDetectors());
	for(int x = 0; x < possibleDetectors.count(); x++){
		QCheckBox *tempCheckBox = new QCheckBox();
		tempCheckBox->setEnabled(false);
		if(possibleDetectors.at(x)->isConnected())
			tempCheckBox->setChecked(true);
		fl_->addRow(possibleDetectors.at(x)->detectorName(), tempCheckBox);
	}
	setLayout(fl_);

	connect(SGMBeamline::sgm(), SIGNAL(detectorAvailabilityChanged(AMOldDetector*,bool)), this, SLOT(onDetectorAvailabilityChanged(AMOldDetector*,bool)));
}
开发者ID:,项目名称:,代码行数:16,代码来源:


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