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


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

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


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

示例1: updateProfiles

void SelectProfileWidget::updateProfiles()
{
	IDiscoIdentity identity;
	identity.category = "gateway";
	identity.type = FDescriptor.type;

	QList<Jid> nativeGates;
	if (FDescriptor.id == GSID_RAMBLER)
		nativeGates.append(streamJid());

	QList<Jid> gates = FGateways->gateDescriptorServices(streamJid(),FDescriptor,FDescriptor.needLogin);
	for (QList<Jid>::iterator it=gates.begin(); it!=gates.end(); )
	{
		if (!(FGateways->serviceRestrictions(streamJid(),*it) & GSR_ADD_CONTACT))
		{
			IGateServiceDescriptor descriptor = FGateways->serviceDescriptor(streamJid(),*it);
			if (FDescriptor.id == descriptor.id)
				nativeGates.append(*it);
			it++;
		}
		else
		{
			it = gates.erase(it);
		}
	}

	Jid oldSelected = selectedProfile();
	QList<Jid> newProfiles = (gates.toSet() - FProfiles.keys().toSet()).toList();
	QList<Jid> oldProfiles = (FProfiles.keys().toSet() - gates.toSet()).toList();

	qSort(newProfiles);
	if (!FDescriptor.needGate && !FProfiles.contains(streamJid()))
		newProfiles.prepend(streamJid());
	else if (FDescriptor.needGate && FProfiles.contains(streamJid()))
		oldProfiles.prepend(streamJid());
	else
		oldProfiles.removeAll(streamJid());

	foreach(Jid serviceJid, newProfiles)
	{
		QRadioButton *button = new QRadioButton(ui.wdtProfiles);
		button->setAutoExclusive(true);
		connect(button,SIGNAL(toggled(bool)),SLOT(onProfileButtonToggled(bool)));
		FProfiles.insert(serviceJid,button);

		QLabel *label = new QLabel(ui.wdtProfiles);
		connect(label,SIGNAL(linkActivated(const QString &)),SLOT(onProfileLabelLinkActivated(const QString &)));
		FProfileLabels.insert(serviceJid,label);

		QHBoxLayout *layout = new QHBoxLayout();
		layout->setMargin(0);
		layout->setSpacing(0);
		layout->addWidget(button);
		layout->addWidget(label);
		layout->addStretch();
		qobject_cast<QVBoxLayout *>(ui.wdtProfiles->layout())->addLayout(layout);
	}
开发者ID:RandomWalkEagle,项目名称:Contacts,代码行数:57,代码来源:selectprofilewidget.cpp

示例2: resetInput

void GUI_FunctionForm::resetInput()
{
    ui->checkBox->setChecked(false);
    ui->comboBox->setCurrentIndex(0);
    ui->label->setText("Description");
    ui->lineEdit->clear();
    int btn = this->getValue();
    if (btn != -1) {
        QRadioButton* selectedBtn = 0;
        switch (btn) {
        case 0 : selectedBtn = ui->radioButton;
            break;
        case 1 : selectedBtn = ui->radioButton_2;
            break;
        case 2 : selectedBtn = ui->radioButton_3;
            break;
        case 3 : selectedBtn = ui->radioButton_4;
            break;
        case 4 : selectedBtn = ui->radioButton_5;
            break;
        case 5 : selectedBtn = ui->radioButton_6;
            break;
        case 6 : selectedBtn = ui->radioButton_7;
            break;
        case 7 : selectedBtn = ui->radioButton_8;
            break;
        case 8 : selectedBtn = ui->radioButton_9;
            break;
        default :;
        }
        if (selectedBtn) {
            selectedBtn->setAutoExclusive(false);
            selectedBtn->setChecked(false);
            selectedBtn->setAutoExclusive(true);
        }
    }
}
开发者ID:loaded02,项目名称:ICF_Report,代码行数:37,代码来源:gui_functionform.cpp

示例3: rotate

bool RotateDlg::rotate(Rotation & map)
{
	Dimension dim = map.size();
    assert( dim == int(d_labels.size()) );
	d_buttons.resize( Extension( dim, dim ) );
	const int ncol = 2;
    const int nrow = (d_editAtomType)?3:2;
	d_cbs.assign( dim, 0 );

	QVBoxLayout* top = new QVBoxLayout(this);
	top->setMargin( 10 );
	QGridLayout* contents = new QGridLayout();
	QHBoxLayout* buttons = new QHBoxLayout();

    QLabel* l = new QLabel( d_colLabel.data(), this );
	l->setAlignment( Qt::AlignCenter | Qt::AlignVCenter );
	l->setFrameStyle( QFrame::Panel );
	l->setFrameShadow( QFrame::Sunken );
	contents->addWidget( l, 0, 2, 1, dim + 1 - 2 + 1 );

    l = new QLabel( d_rowLabel.data(), this );
	l->setAlignment( Qt::AlignCenter | Qt::AlignVCenter );
	l->setFrameStyle( QFrame::Panel );
	l->setFrameShadow( QFrame::Sunken );
	contents->addWidget( l, nrow, 0, dim, 1 );

	Dimension row;
	for( row = 0; row < dim; row++ )
	{
		QString str;

        // Set row headers
        if( !d_labels[ row ].first.isEmpty() )
            str.sprintf( "Dim. %s: %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row), d_labels[ row ].first.data() );
        else
            str.sprintf( "Dim. %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row) );
		l = new QLabel( str, this );
		l->setAlignment( Qt::AlignCenter | Qt::AlignVCenter );
		l->setFrameStyle( QFrame::Panel );
		l->setFrameShadow( QFrame::Sunken );
		contents->addWidget( l, 1, row + ncol ); 

        // Set column headers
        if( !d_labels[ row ].second.isEmpty() )
            str.sprintf( "Dim. %s: %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row), d_labels[ row ].second.data() );
        else
            str.sprintf( "Dim. %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row) );
        l = new QLabel( str, this );
		l->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
		l->setFrameStyle( QFrame::Panel );
		l->setFrameShadow( QFrame::Sunken );
		contents->addWidget( l, row + nrow, 1 );

        if( d_editAtomType )
		{
			d_cbs[ row ] = new QComboBox( this );
			for( int i = AtomType::None; i <= AtomType::Lr; i++ )
				d_cbs[ row ]->addItem( AtomType::s_labels[ i ] );
			d_cbs[ row ]->setCurrentIndex( d_clr[ row ].getIsoType() );
			contents->addWidget( d_cbs[ row ], nrow - 1, row + ncol );
		}
		
		for( Dimension col = 0; col < dim; col++ )
		{
			QRadioButton* b = new QRadioButton( this );
			b->setAutoExclusive( false );
			//b->setToggleButton( true );
			contents->addWidget( b, row + nrow, col + ncol, Qt::AlignHCenter ); 
			d_buttons.setAt( row, col, b );
			connect( b, SIGNAL( toggled(bool) ), this, SLOT( toggled(bool) ) );
		}
	}
	// Toggle erst zuletzt, da vorher noch nicht alle Buttons existieren.
	for( row = 0; row < dim; row++ )
		for( Dimension col = 0; col < dim; col++ )
		{
			if( map[ row ] == col )
				d_buttons.getAt( row, col )->setChecked( true );
		}

	QPushButton* ok = new QPushButton( "&OK", this );
	connect( ok, SIGNAL( clicked() ), SLOT( accept() ) );
	buttons->addWidget( ok );
	ok->setDefault( true );

	QPushButton* cancel = new QPushButton( "&Cancel", this );
	connect( cancel, SIGNAL( clicked() ), SLOT( reject() ) );
	buttons->addWidget( cancel );

	top->addLayout( contents );
	top->addLayout( buttons );

	while( true )
	{
		if( exec() == QDialog::Accepted )
		{
			Rotation map2 = map;
			bool clrOk = true;
			for( int row = 0; row < dim; row++ )
			{
//.........这里部分代码省略.........
开发者ID:Wushaowei001,项目名称:NAF,代码行数:101,代码来源:RotateDlg.cpp


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