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


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

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


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

示例1: checkValidity

void JumpToDialog::checkValidity(void)
{
	QValidator::State state = QValidator::Acceptable;

	int i;

	const QValidator *vldr = cbFunctions->validator();
	QString s = cbFunctions->currentText();
	int pos = 0;
	if (vldr->validate(s, pos) != QValidator::Acceptable) {
		state = QValidator::Invalid;
	}

	/* Find OK button */
	QAbstractButton *okButton = NULL;
	QList<QAbstractButton*> buttonList;
	buttonList = buttonBox->buttons();
	for (i = 0; i < buttonList.size(); i++) {
		if (buttonBox->buttonRole(buttonList[i])
				== QDialogButtonBox::AcceptRole) {
			okButton = buttonList[i];
		}
	}

	if (!okButton) {
		return;
	}

	if (state == QValidator::Acceptable) {
		okButton->setEnabled(true);
	} else {
		okButton->setEnabled(false);
	}
}
开发者ID:10110111,项目名称:GLSL-Debugger,代码行数:34,代码来源:jumpToDialog.cpp

示例2: setTitle

void
PluginsInstallPage::initializePage()
{
    setTitle( tr( "Your plugins are now being installed" ) );

    wizard()->setCommitPage( true );

    QAbstractButton* continueButton = wizard()->setButton( FirstRunWizard::NextButton, tr( "Continue" ) );
    if ( wizard()->canGoBack() )
        wizard()->setButton( FirstRunWizard::BackButton, tr( "<< Back" ) );

#ifdef Q_OS_WIN32
    if ( wizard()->pluginList()->installList().count() > 0 )
    {
        // get the install to happen a bit later so that
        // we actually show this page of the wizard
        // and the user has time to read what's happening
        QTimer::singleShot( 1000, this, SLOT(install()) );
        continueButton->setEnabled( false );
    }
    else
    {
        continueButton->click();
    }
#endif
}
开发者ID:Erkan-Yilmaz,项目名称:lastfm-desktop,代码行数:26,代码来源:PluginsInstallPage.cpp

示例3: updateRefButton

void TaskDatumParameters::updateRefButton(int idx)
{
    QAbstractButton* b;
    switch(idx){
        case 0: b = ui->buttonRef1; break;
        case 1: b = ui->buttonRef2; break;
        case 2: b = ui->buttonRef3; break;
        case 3: b = ui->buttonRef4; break;
        default: throw Base::Exception("button index out of range");
    }

    Part::Datum* pcDatum = static_cast<Part::Datum*>(DatumView->getObject());
    std::vector<App::DocumentObject*> refs = pcDatum->Support.getValues();

    int numrefs = refs.size();
    bool enable = true;
    if (idx > numrefs)
        enable = false;
    if (idx == numrefs && this->lastSuggestResult.nextRefTypeHint.size() == 0)
        enable = false;
    b->setEnabled(enable);

    b->setChecked(iActiveRef == idx);

    if (iActiveRef == idx) {
        b->setText(tr("Selecting..."));
    } else if (idx < static_cast<int>(this->lastSuggestResult.references_Types.size())){
        b->setText(AttacherGui::getShapeTypeText(this->lastSuggestResult.references_Types[idx]));
    } else {
        b->setText(tr("Reference%1").arg(idx+1));
    }
}
开发者ID:fandaL,项目名称:FreeCAD,代码行数:32,代码来源:TaskDatumParameters.cpp

示例4: ui

PreferencesDialog::PreferencesDialog( QMenuBar* menuBar, QWidget* parent )
    :unicorn::MainWindow( menuBar, parent ),
    ui( new Ui::PreferencesDialog )
{
    // Disable the minimize and maximize buttons.
    Qt::WindowFlags flags = this->windowFlags();
    flags &= ~Qt::WindowMinMaxButtonsHint;
    setWindowFlags(flags);

    ui->setupUi( this );

    setAttribute( Qt::WA_DeleteOnClose, true );

    static_cast<QAbstractButton*>( ui->toolBar->widgetForAction( ui->actionGeneral ) )->setAutoExclusive( true );
    static_cast<QAbstractButton*>( ui->toolBar->widgetForAction( ui->actionScrobbling ) )->setAutoExclusive( true );
    static_cast<QAbstractButton*>( ui->toolBar->widgetForAction( ui->actionDevices ) )->setAutoExclusive( true );
    static_cast<QAbstractButton*>( ui->toolBar->widgetForAction( ui->actionAccounts ) )->setAutoExclusive( true );
    static_cast<QAbstractButton*>( ui->toolBar->widgetForAction( ui->actionAdvanced ) )->setAutoExclusive( true );

    connect( ui->toolBar->widgetForAction( ui->actionGeneral ), SIGNAL(toggled(bool)), ui->actionGeneral, SLOT(setChecked(bool)) );
    connect( ui->toolBar->widgetForAction( ui->actionScrobbling ), SIGNAL(toggled(bool)), ui->actionScrobbling, SLOT(setChecked(bool)) );
    connect( ui->toolBar->widgetForAction( ui->actionDevices ), SIGNAL(toggled(bool)), ui->actionDevices, SLOT(setChecked(bool)) );
    connect( ui->toolBar->widgetForAction( ui->actionAccounts ), SIGNAL(toggled(bool)), ui->actionAccounts, SLOT(setChecked(bool)) );
    connect( ui->toolBar->widgetForAction( ui->actionAdvanced ), SIGNAL(toggled(bool)), ui->actionAdvanced, SLOT(setChecked(bool)) );

    connect( this, SIGNAL( saveNeeded() ), ui->general, SLOT( saveSettings() ) );
    connect( this, SIGNAL( saveNeeded() ), ui->scrobbling, SLOT( saveSettings() ) );
    connect( this, SIGNAL( saveNeeded() ), ui->ipod, SLOT( saveSettings() ) );
    connect( this, SIGNAL( saveNeeded() ), ui->accounts, SLOT( saveSettings() ) );
    connect( this, SIGNAL( saveNeeded() ), ui->advanced, SLOT( saveSettings() ) );

    connect( ui->general, SIGNAL( settingsChanged() ), SLOT( onSettingsChanged() ) );
    connect( ui->scrobbling, SIGNAL( settingsChanged() ), SLOT( onSettingsChanged() ) );
    connect( ui->ipod, SIGNAL( settingsChanged() ), SLOT( onSettingsChanged() ) );
    connect( ui->accounts, SIGNAL( settingsChanged() ), SLOT( onSettingsChanged() ) );
    connect( ui->advanced, SIGNAL( settingsChanged() ), SLOT( onSettingsChanged() ) );

    connect( ui->actionGeneral, SIGNAL(triggered()), SLOT(onTabButtonClicked()));
    connect( ui->actionScrobbling, SIGNAL(triggered()), SLOT(onTabButtonClicked()));
    connect( ui->actionDevices, SIGNAL(triggered()), SLOT(onTabButtonClicked()));
    connect( ui->actionAccounts, SIGNAL(triggered()), SLOT(onTabButtonClicked()));
    connect( ui->actionAdvanced, SIGNAL(triggered()), SLOT(onTabButtonClicked()));

    connect( ui->stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(onStackCurrentChanged(int)), Qt::QueuedConnection );

#ifdef Q_OS_MAC
    ui->buttonBox->hide();
#endif
    connect( ui->buttonBox, SIGNAL( accepted() ), SLOT( onAccepted() ) );
    connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( onRejected() ) );

    QAbstractButton* applyButton = ui->buttonBox->button( QDialogButtonBox::Apply );
    applyButton->setEnabled( false );
    connect( applyButton, SIGNAL( clicked() ), SLOT( onApplyButtonClicked() ) );

    setFixedWidth( 550 );

    ui->stackedWidget->setCurrentWidget( ui->accounts );
    ui->actionGeneral->trigger();
}
开发者ID:Timmmm,项目名称:lastfm-desktop,代码行数:60,代码来源:PreferencesDialog.cpp

示例5: Enable

bool wxRadioBox::Enable(unsigned int n, bool enable)
{
    QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, n );
    CHECK_BUTTON( qtButton, false );

    qtButton->setEnabled( enable );
    return true;
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:8,代码来源:radiobox.cpp

示例6: xmlWorkFinish

void ExportWizard::xmlWorkFinish()
{
    QAbstractButton *finishButton = button(QWizard::FinishButton);
    finishButton->setEnabled(true);
    setButtonText(QWizard::FinishButton, tr("Finish"));
    setOption(QWizard::DisabledBackButtonOnLastPage, false);
    delete xmlWorkThread;
}
开发者ID:Finalcheat,项目名称:SQLiteDatabaseManage,代码行数:8,代码来源:exportwizard.cpp

示例7: checkValidity

void EditCallDialog::checkValidity(void)
{
    QValidator::State state = QValidator::Acceptable;
    
    int i;
    for (i=0; i<m_qObjects.size(); i++) {
        const FunctionCall::Argument *arg = m_pChangedCall->getArgument(i);
        switch (arg->iType) {
            case DBG_TYPE_ENUM:
                {
                    QComboBox *cb = (QComboBox*)m_qObjects[i];
                    const QValidator *vldr = cb->validator();
                    QString s = cb->currentText();
                    int pos = 0;
                    if (vldr->validate(s, pos) != QValidator::Acceptable) {
                        state = QValidator::Invalid;
                    }
                    break;
                }
            default:
                break;
        }
    }

    /* Find OK button */
    QAbstractButton *okButton = NULL;
    QList<QAbstractButton*> buttonList;
    buttonList = buttonBox->buttons();
    for(i=0; i<buttonList.size(); i++) {
        if (buttonBox->buttonRole(buttonList[i]) == 
                QDialogButtonBox::AcceptRole) {
            okButton = buttonList[i];
        }
    }

    if (!okButton) {
        return;
    }

    if (state == QValidator::Acceptable) {
        okButton->setEnabled(true);
    } else {
        okButton->setEnabled(false);
    }
}
开发者ID:flyncode,项目名称:GLSL-Debugger,代码行数:45,代码来源:editCallDialog.cpp

示例8: excelWorkFinish

void ExportWizard::excelWorkFinish()
{
    QAbstractButton *finishButton = button(QWizard::FinishButton);
    finishButton->setEnabled(true);
    setButtonText(QWizard::FinishButton, tr("Finish"));
    setOption(QWizard::DisabledBackButtonOnLastPage, false);
    QSqlDatabase::removeDatabase("ExportExcel");
    delete excelWorkThread;  
}
开发者ID:Finalcheat,项目名称:SQLiteDatabaseManage,代码行数:9,代码来源:exportwizard.cpp

示例9: validatePage

bool LoadObjectsProgressPage::validatePage()
{
	// Re-Enable cancel button for the next step
	QAbstractButton* cancel = wizard()->button(QWizard::CancelButton);
	if(cancel)
	{
		cancel->setEnabled(true);
	}
	return true;
}
开发者ID:rcari,项目名称:libPantin,代码行数:10,代码来源:3dsFileImporterWizard.cpp

示例10: workFinish

void ExportWizard::workFinish()
{
    QAbstractButton *finishButton = button(QWizard::FinishButton);
    finishButton->setEnabled(true);
    setButtonText(QWizard::FinishButton, tr("Finish"));
    setOption(QWizard::DisabledBackButtonOnLastPage, false);
//    progressPage->progressBar->setMaximum(1);
    delete workThread;
    QSqlDatabase::removeDatabase("QODBCTempConnect");
}
开发者ID:Finalcheat,项目名称:SQLiteDatabaseManage,代码行数:10,代码来源:exportwizard.cpp

示例11: handle_selectionChanged

void StartPage::handle_selectionChanged()
{
    QItemSelectionModel * sel_model = qobject_cast<QItemSelectionModel *>(sender());
    Q_ASSERT(sel_model);
    QAbstractItemView * area = area_of(sel_model->model());
    Q_ASSERT(area);
    QString button_name = area->property("open_button_name").toString();
    QAbstractButton * button = findChild<QAbstractButton *>(button_name);
    Q_ASSERT(button);
    button->setEnabled( area->currentIndex().isValid() );
}
开发者ID:artm,项目名称:WatchThatSound3,代码行数:11,代码来源:StartPage.cpp

示例12: tabChanged

/**
  * @brief the current tab changed
  */
void OpenNIC::tabChanged(int tab)
{
	QDialogButtonBox* buttonBox = ui->buttonBox;
	QList<QAbstractButton *> buttons = buttonBox->buttons();
	for(int n=0; n < buttons.count(); n++)
	{
		QAbstractButton* button = buttons.at(n);
		if (buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole || buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole)
		{
			if ( tab == 1 || tab == 5 )
			{
				button->setEnabled(true);
			}
			else
			{
				button->setEnabled(false);
			}
		}
	}
}
开发者ID:8bitgeek,项目名称:OpenNIC-Wizard,代码行数:23,代码来源:opennic.cpp

示例13: foreach

void
PluginsInstallPage::install()
{
#ifdef Q_OS_WIN32
    foreach( IPluginInfo* plugin, wizard()->pluginList()->installList() )
        plugin->doInstall();
#endif

    QAbstractButton* continueButton = wizard()->setButton( FirstRunWizard::NextButton, tr( "Continue" ) );
    continueButton->setEnabled( true );
    QTimer::singleShot( 1000, continueButton, SLOT(click()) );
}
开发者ID:Erkan-Yilmaz,项目名称:lastfm-desktop,代码行数:12,代码来源:PluginsInstallPage.cpp

示例14: on_buttonNewGame_clicked

void TicTacToe::on_buttonNewGame_clicked()
{
	QListIterator<QAbstractButton *> i(gameField->buttons());
	while (i.hasNext())
	{
		QAbstractButton *qab = i.next();
		qab->setEnabled(true);
		qab->setIcon(QIcon());
		qab->setWhatsThis("");
	}
	buttonNewGame->setEnabled(false);
	switchPlayer();
}
开发者ID:CodeGamer,项目名称:Labyrinth,代码行数:13,代码来源:TicTacToe.cpp

示例15: onModeChanged

void PsdSettingsPopup::onModeChanged(const QString &mode) {
  if (mode == "Single Image") {
    m_mode = FLAT;
    m_modeDescription->setText(modesDescription[0]);
    m_createSubXSheet->setEnabled(false);
    m_levelNameType->setEnabled(false);
    QList<QAbstractButton *> buttons = m_psdFolderOptions->buttons();
    while (!buttons.isEmpty()) {
      QAbstractButton *btn = buttons.takeFirst();
      btn->setEnabled(false);
    }
  } else if (mode == "Frames") {
    m_mode = FRAMES;
    m_modeDescription->setText(modesDescription[1]);
    m_createSubXSheet->setEnabled(false);
    m_levelNameType->setEnabled(false);
    QList<QAbstractButton *> buttons = m_psdFolderOptions->buttons();
    while (!buttons.isEmpty()) {
      QAbstractButton *btn = buttons.takeFirst();
      btn->setEnabled(false);
    }
  } else if (mode == "Columns") {
    if (m_psdFolderOptions->checkedId() == 2 ||
        m_psdFolderOptions->checkedId() == 1)
      m_mode = FOLDER;
    else
      m_mode = COLUMNS;
    m_modeDescription->setText(modesDescription[2]);
    m_createSubXSheet->setEnabled(true);
    m_levelNameType->setEnabled(true);
    QList<QAbstractButton *> buttons = m_psdFolderOptions->buttons();
    while (!buttons.isEmpty()) {
      QAbstractButton *btn = buttons.takeFirst();
      btn->setEnabled(true);
    }
  } else {
    assert(false);
  }
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:39,代码来源:psdsettingspopup.cpp


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