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


C++ QRadioButton::isChecked方法代码示例

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


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

示例1: getThresholdComparison

GTUtilsOptionPanelMsa::ThresholdComparison GTUtilsOptionPanelMsa::getThresholdComparison(GUITestOpStatus &os) {
    openTab(os, Highlighting);
    QRadioButton *thresholdLessRb = GTWidget::findExactWidget<QRadioButton *>(os, "thresholdLessRb");
    GT_CHECK_RESULT(NULL != thresholdLessRb, "thresholdLessRb is NULL", LessOrEqual);
    QRadioButton *thresholdMoreRb = GTWidget::findExactWidget<QRadioButton *>(os, "thresholdMoreRb");
    GT_CHECK_RESULT(NULL != thresholdMoreRb, "thresholdMoreRb is NULL", LessOrEqual);
    const bool lessOrEqual = thresholdLessRb->isChecked();
    const bool greaterOrEqual = thresholdMoreRb->isChecked();
    GT_CHECK_RESULT(lessOrEqual ^ greaterOrEqual, "Incorrect state of threshold comparison radiobuttons", LessOrEqual);
    return lessOrEqual ? LessOrEqual : GreaterOrEqual;
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:11,代码来源:GTUtilsOptionPanelMSA.cpp

示例2: fillInMetadata

bool PEUtils::fillInMetadata(int senderIndex, QWidget * parent, ConnectorMetadata & cmd)
{
    bool result = false;
    QList<QWidget *> widgets = parent->findChildren<QWidget *>();
    foreach (QWidget * widget, widgets) {
        bool ok;
        int index = widget->property("index").toInt(&ok);
        if (!ok) continue;

        if (index != senderIndex) continue;

        QString type = widget->property("type").toString();
        if (type == "name") {
            QLineEdit * lineEdit = qobject_cast<QLineEdit *>(widget);
            if (lineEdit == NULL) continue;

            cmd.connectorName = lineEdit->text();
            cmd.connectorID = widget->property("id").toString();
            result = true;
        }
        else if (type == "radio") {
            QRadioButton * radioButton = qobject_cast<QRadioButton *>(widget);
            if (radioButton == NULL) continue;
            if (!radioButton->isChecked()) continue;

            cmd.connectorType = (Connector::ConnectorType) radioButton->property("value").toInt();
        }
        else if (type == "description") {
            QLineEdit * lineEdit = qobject_cast<QLineEdit *>(widget);
            if (lineEdit == NULL) continue;

            cmd.connectorDescription = lineEdit->text();
        }

    }
开发者ID:DHaylock,项目名称:fritzing-app,代码行数:35,代码来源:peutils.cpp

示例3: setModelData

        void uitabdelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                const QModelIndex &index) const {
            QVariant data;

            switch (typeeditor) {
                case TComboBox:{
                    QComboBox *cmbox = static_cast<QComboBox *> (editor);
                    data = cmbox->currentText();
                    break;}

                case TRadioButton:{
                    QRadioButton *cradio = static_cast<QRadioButton *> (editor);
                    data = cradio->isChecked();
                    break;}

                case TCheckBox:{
                    QCheckBox *checkb = static_cast<QCheckBox *> (editor);
                    data = checkb->isChecked();
                    break;}
                case TButton:{
                    break;}
                default:{
                    QSpinBox *spinBox = static_cast<QSpinBox *> (editor);
                    spinBox->interpretText();
                    data = spinBox->value();}}


            model->setData(index, data, Qt::EditRole);}
开发者ID:sealeks,项目名称:nsdavinci,代码行数:28,代码来源:uiuitil.cpp

示例4: saveCoreSettings

/**
  * Send the settings to the core. A connection to a core must be established.
  */
void SettingsWidget::saveCoreSettings()
{
    if (!this->getAtLeastOneState)
        return;

    Protos::GUI::CoreSettings settings;
    Common::ProtoHelper::setStr(settings, &Protos::GUI::CoreSettings::set_nick, this->ui->txtNick->text());
    settings.set_enable_integrity_check(this->ui->chkEnableIntegrityCheck->isChecked());

    for (QListIterator<Common::SharedDir> i(this->sharedDirsModel.getDirs()); i.hasNext();)
        Common::ProtoHelper::addRepeatedStr(*settings.mutable_shared_directories(), &Protos::GUI::CoreSettings::SharedDirectories::add_dir, i.next().path);

    if (this->ui->radIPv6->isChecked())
        settings.set_listen_any(Protos::Common::Interface::Address::IPv6);
    else if (this->ui->radIPv4->isChecked())
        settings.set_listen_any(Protos::Common::Interface::Address::IPv4);
    else
    {
        for (QListIterator<QRadioButton*> i(this->ui->grpInterfaces->findChildren<QRadioButton*>()); i.hasNext();)
        {
            QRadioButton* button = i.next();
            if (button->isChecked())
            {
                Common::ProtoHelper::setStr(settings, &Protos::GUI::CoreSettings::set_listen_address, button->text());
                break;
            }
        }
    }

    this->coreConnection->setCoreSettings(settings);
}
开发者ID:hmartinet,项目名称:D-LAN,代码行数:34,代码来源:SettingsWidget.cpp

示例5: getSelectedPortName

// Figure out which port was selected and return it, or nothing if none are
QString ChoosePortDialog::getSelectedPortName()
{
	QListIterator<QRadioButton*> i(m_portButtonList);
	while(i.hasNext()) {
		QRadioButton *button = i.next();
		if(button->isChecked())
			return button->text();
	}
	return QString();
}
开发者ID:jaekim708,项目名称:kiss,代码行数:11,代码来源:ChoosePortDialog.cpp

示例6: addDebuggingWidgets

void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
{
    m_debugDetailsContainer = new Utils::DetailsWidget(this);
    QWidget *debugWidget = new QWidget;
    m_debugDetailsContainer->setWidget(debugWidget);
    mainLayout->addWidget(m_debugDetailsContainer);
    QFormLayout *debugLayout = new QFormLayout(debugWidget);
    QHBoxLayout *debugRadioButtonsLayout = new QHBoxLayout;
    debugLayout->addRow(debugRadioButtonsLayout);
    QRadioButton *gdbButton = new QRadioButton(tr("Use remote gdb"));
    QRadioButton *gdbServerButton = new QRadioButton(tr("Use remote gdbserver"));
    debugRadioButtonsLayout->addWidget(gdbButton);
    debugRadioButtonsLayout->addWidget(gdbServerButton);
    debugRadioButtonsLayout->addStretch(1);
    gdbButton->setChecked(m_runConfiguration->useRemoteGdb());
    gdbServerButton->setChecked(!gdbButton->isChecked());
    connect(gdbButton, SIGNAL(toggled(bool)), this,
        SLOT(handleDebuggingTypeChanged(bool)));
    handleDebuggingTypeChanged(gdbButton->isChecked());
}
开发者ID:NoobSaibot,项目名称:qtcreator-minimap,代码行数:20,代码来源:maemorunconfigurationwidget.cpp

示例7: SlotOkButtonClicked

void InstallDialog::SlotOkButtonClicked()
{
        Action installAction("org.kde.kcontrol.kcmgrub2.install");
        installAction.setHelperId("org.kde.kcontrol.kcmgrub2");
        for (int i = 0; i < ui->treeWidget_recover->topLevelItemCount(); i++) {
            QRadioButton *radio = qobject_cast<QRadioButton *>(ui->treeWidget_recover->itemWidget(ui->treeWidget_recover->topLevelItem(i), 0));
            if (radio && radio->isChecked()) {
                installAction.addArgument("partition", ui->treeWidget_recover->topLevelItem(i)->text(1));
                installAction.addArgument("mountPoint", ui->treeWidget_recover->topLevelItem(i)->text(2));
                installAction.addArgument("mbrInstall", !ui->checkBox_partition->isChecked());
                break;
            }
        }
        if (installAction.arguments().value("partition").toString().isEmpty()) {
            KMessageBox::sorry(this, i18nc("@info", "Sorry, you have to select a partition with a proper name!"));
            return;
        }


        QProgressDialog progressDlg(this, Qt::Dialog);
        progressDlg.setWindowTitle(i18nc("@title:window", "Installing"));
        progressDlg.setLabelText(i18nc("@info:progress", "Installing GRUB..."));
        progressDlg.setCancelButton(0);
        progressDlg.setModal(true);
        progressDlg.setRange(0,0);
        progressDlg.show();

        ExecuteJob* reply = installAction.execute();
        reply->exec();
        
        if (reply->action().status() != Action::AuthorizedStatus ) {
          progressDlg.hide();
          return;
        }
        
        //connect(reply, SIGNAL(result()), &progressDlg, SLOT(hide()));
        progressDlg.hide();
        if (reply->error()) {
            KMessageBox::detailedError(this, i18nc("@info", "Failed to install GRUB."), reply->data().value("errorDescription").toString());
            this->reject();
        } else {
            progressDlg.hide();
            QDialog *dialog = new QDialog(this, Qt::Dialog);
            dialog->setWindowTitle(i18nc("@title:window", "Information"));
            dialog->setModal(true);
            QDialogButtonBox *btnbox = new QDialogButtonBox(QDialogButtonBox::Ok);
            KMessageBox::createKMessageBox(dialog, btnbox, QMessageBox::Information, i18nc("@info", "Successfully installed GRUB."), QStringList(), QString(), 0, KMessageBox::Notify, reply->data().value("output").toString()); // krazy:exclude=qclasses
            this->accept();
        }
    //this->accept();
}
开发者ID:houzhenggang,项目名称:grub2-editor,代码行数:51,代码来源:installDlg.cpp

示例8: KDialog

// new groups
void KNGroupDialog::slotUser2()
{
  QDate lastDate = a_ccount->lastNewFetch();
  KDialog *dlg = new KDialog( this );
  dlg->setCaption( i18n("New Groups") );
  dlg->setButtons( Ok | Cancel );

  QGroupBox *btnGrp = new QGroupBox( i18n("Check for New Groups"), dlg );
  dlg->setMainWidget(btnGrp);
  QGridLayout *topL = new QGridLayout( btnGrp );

  QRadioButton *takeLast = new QRadioButton( i18n("Created since last check:"), btnGrp );
  topL->addWidget(takeLast, 0, 0, 1, 2 );

  QLabel *l = new QLabel(KGlobal::locale()->formatDate(lastDate, KLocale::LongDate),btnGrp);
  topL->addWidget(l, 1, 1, Qt::AlignLeft);

  connect(takeLast, SIGNAL(toggled(bool)), l, SLOT(setEnabled(bool)));

  QRadioButton *takeCustom = new QRadioButton( i18n("Created since this date:"), btnGrp );
  topL->addWidget(takeCustom, 2, 0, 1, 2 );

  dateSel = new KDatePicker( lastDate, btnGrp );
  dateSel->setMinimumSize(dateSel->sizeHint());
  topL->addWidget(dateSel, 3, 1, Qt::AlignLeft);

  connect(takeCustom, SIGNAL(toggled(bool)), this, SLOT(slotDatePickerEnabled(bool)));

  takeLast->setChecked(true);
  dateSel->setEnabled(false);

  topL->addItem( new QSpacerItem(30, 0 ), 0, 0 );

  if (dlg->exec()) {
    if (takeCustom->isChecked())
      lastDate = dateSel->date();
    a_ccount->setLastNewFetch(QDate::currentDate());
    leftLabel->setText(i18n("Checking for new groups..."));
    enableButton(User1,false);
    enableButton(User2,false);
    filterEdit->clear();
    subCB->setChecked(false);
    newCB->setChecked(true);
    emit(checkNew(a_ccount,lastDate));
    incrementalFilter=false;
    slotRefilter();
  }

  delete dlg;
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:51,代码来源:kngroupdialog.cpp

示例9: ChangeLanguage

void MainWindow::ChangeLanguage()
{
    std::clog<<"MainWindow::ChangeLanguage()"<<std::endl;
    QList<QRadioButton*> list = ui->groupBox->findChildren<QRadioButton*>();
    for(int i=0;i<list.size();i++)
    {
        QRadioButton* rb = list.at(i);
        if(rb->isChecked())
        {
            lang->ChangeLanguage(rb->property(("lang_file")).toString()); // lang_file is dynamic property
            break;
        }
    }
    ui->retranslateUi(this);
}
开发者ID:Kuraturpa,项目名称:qt-localization-test,代码行数:15,代码来源:mainwindow.cpp

示例10: selectedSenderIdx

int SongcastDLG::selectedSenderIdx()
{
    int senderidx = -1;
    // Note: quite unbelievably, gridLayout::rowCount() is not the number
    // of actual rows, but the size of the internal allocation. So can't use it
    // after deleting rows...
    for (int i = 0; i < numSenderRows(); i++) {
        QRadioButton *btn = (QRadioButton*)
            sndGridLayout->itemAtPosition(i, 0)->widget();
        if (btn->isChecked()) {
            senderidx = i;
            break;
        }
    }
    return senderidx;
}
开发者ID:medoc92,项目名称:upplay,代码行数:16,代码来源:songcastdlg.cpp

示例11: Precision

void CSysSettingDialog::Precision( int &nPrecision, bool bGet )
{
    QString strName = "rdxPrecision%1";
    QRadioButton* pRB;

    if ( bGet ) {
        for ( int nIndex = 0; nIndex < 9; nIndex++ ) {
            pRB = ui->gbPrecision->findChild< QRadioButton* >( strName.arg( QString::number( nIndex ) ) );
            if ( pRB->isChecked( ) ) {
                nPrecision = nIndex;
                break;
            }
        }
    } else {
        pRB = ui->gbPrecision->findChild< QRadioButton* >( strName.arg( QString::number( nPrecision ) ) );
        pRB->setChecked( true );
    }
}
开发者ID:Strongc,项目名称:SCPark,代码行数:18,代码来源:syssettingdialog.cpp

示例12: radioSelection

QString DataSerieDialog::radioSelection(QGroupBox *groupBox)
{
    QString selection;
    QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(groupBox->layout());
    Q_ASSERT(layout);

    for (int i(0); i < layout->count(); i++) {
        QLayoutItem *item = layout->itemAt(i);
        Q_ASSERT(item);
        QRadioButton *radio = qobject_cast<QRadioButton *>(item->widget());
        Q_ASSERT(radio);
        if (radio->isChecked()) {
            selection = radio->text();
            break;
        }
    }

    qDebug() << "radioSelection: " << selection;
    return selection;
}
开发者ID:wangyun123,项目名称:Third,代码行数:20,代码来源:dataseriedialog.cpp

示例13: Store

		void Persistence::Store(QWidget* widget, QString storageName) {
			if (storageName.isEmpty()) storageName = widget->objectName();
			if (qobject_cast<QLineEdit*>(widget)) {
				QLineEdit* lineEdit = qobject_cast<QLineEdit*>(widget); 
				GetStore()[storageName] = QVariant(lineEdit->text());
			} else if (qobject_cast<QCheckBox*>(widget)) {
				QCheckBox* cb = qobject_cast<QCheckBox*>(widget); 
				GetStore()[storageName] = QVariant(cb->isChecked());
			} else if (qobject_cast<QSpinBox*>(widget)) {
				QSpinBox* sb = qobject_cast<QSpinBox*>(widget); 
				GetStore()[storageName] = QVariant(sb->value());
			} else if (qobject_cast<QRadioButton*>(widget)) {
				QRadioButton* rb = qobject_cast<QRadioButton*>(widget); 
				GetStore()[storageName] = QVariant(rb->isChecked());
			} else if (qobject_cast<QComboBox*>(widget)) {
				QComboBox* cb = qobject_cast<QComboBox*>(widget); 
				GetStore()[storageName] = QVariant(cb->currentText());
			} else {
				WARNING("Unsupported widget: " + widget->objectName());
			}
		}
开发者ID:Booley,项目名称:nbis,代码行数:21,代码来源:Persistence.cpp

示例14: VideoMode

void CSysSettingDialog::VideoMode( int &nMode, bool bGet )
{
    QString strName = "rdxVideoWay%1";
    QRadioButton* pRB;

    if ( 2 > nMode ) {
        return;
    }

    if ( bGet ) {
        for ( int nIndex = 2; nIndex < 5; nIndex++ ) {
            pRB = ui->gbVideo->findChild< QRadioButton* >( strName.arg( QString::number( nIndex ) ) );
            if ( pRB->isChecked( ) ) {
                nMode = nIndex;
                break;
            }
        }
    } else {
        pRB = ui->gbVideo->findChild< QRadioButton* >( strName.arg( QString::number( nMode ) ) );
        pRB->setChecked( true );
    }
}
开发者ID:Strongc,项目名称:SCPark,代码行数:22,代码来源:syssettingdialog.cpp

示例15: operator

void RandomImgOp::operator()(const imagein::Image*, const std::map<const imagein::Image*, std::string>&) {
    QDialog* dialog = new QDialog(qApp->activeWindow());
    dialog->setWindowTitle(qApp->translate("RandomImgOp", "Parameters"));
    dialog->setMinimumWidth(180);
    QFormLayout* layout = new QFormLayout(dialog);

    QGroupBox* radioGroup = new QGroupBox(qApp->translate("RandomImgOp", "Image type"), dialog);
    QRadioButton* intButton = new QRadioButton(qApp->translate("RandomImgOp", "8-bit integer"));
    QRadioButton* floatButton = new QRadioButton(qApp->translate("RandomImgOp", "Floating point"));
    QHBoxLayout* radioLayout = new QHBoxLayout(radioGroup);
    radioLayout->addWidget(intButton);
    radioLayout->addWidget(floatButton);
    intButton->setChecked(true);
    layout->insertRow(0, radioGroup);

    QSpinBox* widthBox = new QSpinBox(dialog);
    widthBox->setRange(0, 65536);
    widthBox->setValue(512);
    layout->insertRow(1, qApp->translate("RandomImgOp", "Width : "), widthBox);

    QSpinBox* heightBox = new QSpinBox(dialog);
    heightBox->setRange(0, 65536);
    heightBox->setValue(512);
    layout->insertRow(2, qApp->translate("RandomImgOp", "Height : "), heightBox);

    QSpinBox* channelBox = new QSpinBox(dialog);
    channelBox->setRange(1, 4);
    channelBox->setValue(3);
    layout->insertRow(3, qApp->translate("RandomImgOp", "Number of channels : "), channelBox);

    QWidget* intRangeWidget = new QWidget(dialog);
    QHBoxLayout* intRangeLayout = new QHBoxLayout(intRangeWidget);
    QSpinBox* intMinBox = new QSpinBox(dialog);
    QSpinBox* intMaxBox = new QSpinBox(dialog);
    intMinBox->setRange(0, 255);
    intMaxBox->setRange(0, 255);
    intMinBox->setValue(0);
    intMaxBox->setValue(255);
    intRangeLayout->addWidget(new QLabel(qApp->translate("RandomImgOp", "Range : ")));
    intRangeLayout->addWidget(intMinBox);
    intRangeLayout->addWidget(new QLabel(qApp->translate("RandomImgOp", " to ")));
    intRangeLayout->addWidget(intMaxBox);
    layout->insertRow(4, intRangeWidget);

    QWidget* floatRangeWidget = new QWidget(dialog);
    QHBoxLayout* floatRangeLayout = new QHBoxLayout(floatRangeWidget);
    QDoubleSpinBox* floatMinBox = new QDoubleSpinBox(dialog);
    QDoubleSpinBox* floatMaxBox = new QDoubleSpinBox(dialog);
    floatMinBox->setValue(0.0);
    floatMaxBox->setValue(1.0);
    floatMinBox->setRange(-65536, 65536);
    floatMaxBox->setRange(-65536, 65536);
    floatRangeLayout->addWidget(new QLabel(qApp->translate("RandomImgOp", "Range : ")));
    floatRangeLayout->addWidget(floatMinBox);
    floatRangeLayout->addWidget(new QLabel(qApp->translate("RandomImgOp", " to ")));
    floatRangeLayout->addWidget(floatMaxBox);
    layout->insertRow(5, floatRangeWidget);
    floatRangeWidget->hide();

    layout->setSizeConstraint(QLayout::SetFixedSize);

    QObject::connect(intButton, SIGNAL(toggled(bool)), intRangeWidget, SLOT(setVisible(bool)));
    QObject::connect(floatButton, SIGNAL(toggled(bool)), floatRangeWidget, SLOT(setVisible(bool)));

    QPushButton *okButton = new QPushButton(qApp->translate("Operations", "Validate"), dialog);
    okButton->setDefault(true);
    layout->addWidget(okButton);
    QObject::connect(okButton, SIGNAL(clicked()), dialog, SLOT(accept()));

    QDialog::DialogCode code = static_cast<QDialog::DialogCode>(dialog->exec());

    if(code!=QDialog::Accepted) {
        return;
    }

    if(intButton->isChecked()) {

        Image* resImg = new Image(widthBox->value(), heightBox->value(), channelBox->value());
        RandomLib::Random random;
        for(unsigned int c = 0; c < resImg->getNbChannels(); ++c) {
            for(unsigned int j = 0; j < resImg->getHeight(); ++j) {
                for(unsigned int i = 0; i < resImg->getWidth(); ++i) {
                    Image::depth_t value = random.IntegerC<Image::depth_t>(intMinBox->value(), intMaxBox->value());
//                    Image::depth_t value = 256. * (rand() / (RAND_MAX + 1.));;
                    resImg->setPixel(i, j, c, value);
                }
            }
        }
        this->outImage(resImg, qApp->translate("Operations", "Random image").toStdString());

    }
    else if(floatButton->isChecked()) {

        Image_t<double>* resImg = new Image_t<double>(widthBox->value(), heightBox->value(), channelBox->value());
        RandomLib::Random random;
        for(unsigned int c = 0; c < resImg->getNbChannels(); ++c) {
            for(unsigned int j = 0; j < resImg->getHeight(); ++j) {
                for(unsigned int i = 0; i < resImg->getWidth(); ++i) {
                    double min = floatMinBox->value();
                    double max = floatMaxBox->value();
//.........这里部分代码省略.........
开发者ID:eiimage,项目名称:eiimage,代码行数:101,代码来源:RandomImgOp.cpp


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