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


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

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


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

示例1: addRadioButton

// Create new radio button
QtWidgetObject* AtenTreeGuiDialog::addRadioButton(TreeGuiWidget* widget, TreeGuiWidget* groupWidget, QString name, QString label, int id)
{
	// Cast QObject in groupWidget into QButtonGroup
	QtWidgetObject* wo = groupWidget->qtWidgetObject();
	if (wo == NULL)
	{
		printf("Internal Error: Can't add button to radiogroup widget since supplied widget doesn't have an associated QtWidgetObject.\n");
		return NULL;
	}
	QButtonGroup *group = static_cast<QButtonGroup*>(wo->qObject());
	if (!group)
	{
		printf("Internal Error: Couldn't cast QObject into QButtonGroup.\n");
		return NULL;
	}
	// Create new QtWidgetObject for page
	QRadioButton *radio = new QRadioButton(label, this);
	group->addButton(radio, id);
	QtWidgetObject* qtwo = widgetObjects_.add();
	qtwo->set(widget, radio);
	radio->setEnabled(widget->enabled());
	radio->setVisible(widget->visible());
	radio->setChecked(widget->valueI() == 1);
	radio->setMinimumHeight(WIDGETHEIGHT);
	radio->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
	// Connect signal to master slot
	QObject::connect(radio, SIGNAL(clicked(bool)), this, SLOT(radioButtonWidget_clicked(bool)));
	return qtwo;
}
开发者ID:alinelena,项目名称:aten,代码行数:30,代码来源:treegui_funcs.cpp

示例2: QLabel

void ImportExport::MD5CheckPage::createRow( QGridLayout* layout, int& row, const QString& name, const QString& title, bool anyClashes, bool allowMerge )
{
    if ( row % 3 == 0 ) {
        QFrame* line = new QFrame;
        line->setFrameShape( QFrame::HLine );
        layout->addWidget( line, ++row, 0, 1, 4 );
    }

    QLabel* label = new QLabel( title );
    label->setEnabled( anyClashes );
    layout->addWidget( label, ++row, 0 );

    QButtonGroup* group = new QButtonGroup(this);
    m_groups[name]=group;

    for ( int i = 1; i<4;++i ) {
        if ( i == 3 && !allowMerge )
            continue;

        QRadioButton* rb = new QRadioButton;
        layout->addWidget( rb, row, i  );
        group->addButton( rb, i );
        rb->setEnabled( anyClashes );
        if (i == 1 )
            rb->setChecked(true);
    }
}
开发者ID:KDE,项目名称:kphotoalbum,代码行数:27,代码来源:MD5CheckPage.cpp

示例3: 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,代码来源:

示例4: setFieldConstituentButtons

//------------------------------------------------------------------------------------------------
// To create the group of radiobuttons for field constituent selection.
// This uses information about active constituents fetched from the DLL.
// Need to distinguish field constituent from cell constituent, because for the
// field we have only the dissolved constituents:
// oxygen, glucose, drugA, drugB, metabolites...
//------------------------------------------------------------------------------------------------
void Field::setFieldConstituentButtons(QGroupBox *gbox, QButtonGroup *bg, QVBoxLayout **vbox, QList<QRadioButton *> *rb_list, QString tag)
{
    int ivar;
    QString name, str, ivar_str;
    QRadioButton *rb;

    Global::nfieldvars_used = Global::nvars_used - Global::N_EXTRA;
//    LOG_QMSG("setFieldConstituentButtons: " + tag + " nfieldvars_used: "
//             + QString::number(Global::nfieldvars_used));
    if (rb_list->length() != 0) {
        LOG_MSG("rb_list not NULL, delete it");
        for (ivar=0; ivar<rb_list->length(); ivar++) {
            rb = (*rb_list)[ivar];
            bg->removeButton(rb);
            delete rb;
        }
        rb_list->clear();
    }
    if (!*vbox) {
        LOG_MSG("vbox = NULL, create it");
        *vbox = new QVBoxLayout;
        gbox->setLayout(*vbox);
    }
    name = "rb_field_constituent_"+tag;
//    LOG_QMSG(name);
    for (ivar=0; ivar<Global::nfieldvars_used; ivar++) {
        ivar_str = QString::number(ivar);
        str = Global::var_string[ivar+1];
        rb = new QRadioButton;
        rb->setText(str);
        QString objname = name+ivar_str;
        rb->setObjectName(objname);
        (*vbox)->addWidget(rb);
        rb->setEnabled(true);
        bg->addButton(rb,ivar);
        rb_list->append(rb);
//        QRadioButton *chkrb = gbox->findChild<QRadioButton *>(objname);
//        if (chkrb) {
//            QString chkstr = chkrb->objectName();
//            LOG_QMSG(chkstr);
//        } else {
//            chkrb = (*rb_list)[ivar];
//            LOG_QMSG("findChild failed, but: " + chkrb->objectName());
//        }
    }
    (*rb_list)[0]->setChecked(true);   // Oxygen
    QRect rect = gbox->geometry();
    rect.setHeight(25*(Global::nfieldvars_used + 1));
    gbox->setGeometry(rect);
    gbox->show();
}
开发者ID:gibbogle,项目名称:vspheroid-abm,代码行数:58,代码来源:field.cpp

示例5: addPlotRadioButton

/** Add a radio button to the plot options
 *
 * @param text :: text on the radio button
 * @param tooltip :: tooltip
 * @param bIntegrated :: flag to indicate that the dimension is integrated.
 */
void LinePlotOptions::addPlotRadioButton(const std::string &text,
                                         const std::string &tooltip,
                                         const bool bIntegrated) {
  QRadioButton *rad;
  rad = new QRadioButton(ui.widgetPlotAxis);
  rad->setText(QString::fromStdString(text));
  rad->setToolTip(QString::fromStdString(tooltip));
  rad->setEnabled(!bIntegrated);
  // Insert it one before the horizontal spacer.
  QBoxLayout *layout = qobject_cast<QBoxLayout *>(ui.widgetPlotAxis->layout());
  layout->insertWidget(layout->count() - 1, rad);
  m_radPlots.push_back(rad);
  QObject::connect(rad, SIGNAL(toggled(bool)), this, SLOT(radPlot_changed()));
}
开发者ID:mantidproject,项目名称:mantid,代码行数:20,代码来源:LinePlotOptions.cpp

示例6: setCellConstituentButtons

//------------------------------------------------------------------------------------------------
// To create the group of radiobuttons for cell constituent selection.
// This uses information about active constituents fetched from the DLL.
// Need to distinguish field constituent from cell constituent, because for the cell we are
// interested in CFSE, volume, O2byvol in addition to the dissolved constituents:
// oxygen, glucose, drugA, drugB, metabolites...
//------------------------------------------------------------------------------------------------
void Field::setCellConstituentButtons(QGroupBox *gbox, QButtonGroup *bg, QVBoxLayout **vbox, QList<QRadioButton *> *rb_list, QString tag)
{
    int ivar;
    QString name, str, ivar_str;
    QRadioButton *rb;

    LOG_QMSG("setCellConstituentButtons: " + tag);
    if (rb_list->length() != 0) {
        LOG_MSG("rb_list not NULL, delete it");
        for (ivar=0; ivar<rb_list->length(); ivar++) {
            rb = (*rb_list)[ivar];
            bg->removeButton(rb);
            delete rb;
        }
        rb_list->clear();
    }
    if (!*vbox) {
        LOG_MSG("vbox = NULL, create it");
        *vbox = new QVBoxLayout;
        gbox->setLayout(*vbox);
    }
    name = "rb_cell_constituent_"+tag;
    LOG_QMSG(name);
    sprintf(msg,"rb_list: %p vbox: %p bg: %p nvars_used: %d",rb_list,*vbox,bg,Global::nvars_used);
    LOG_MSG(msg);
    for (ivar=0; ivar<Global::nvars_used; ivar++) {
        ivar_str = QString::number(ivar);
        str = Global::var_string[ivar];
        rb = new QRadioButton;
        rb->setText(str);
        rb->setObjectName(name+ivar_str);
        (*vbox)->addWidget(rb);
        rb->setEnabled(true);
        bg->addButton(rb,ivar);
        rb_list->append(rb);
//        LOG_QMSG(rb->objectName());
    }
    LOG_MSG("added buttons");
    if (tag.contains("FACS")) {
        (*rb_list)[0]->setChecked(true);   // CFSE
    } else {
        (*rb_list)[1]->setChecked(true);   // Oxygen
    }
    QRect rect = gbox->geometry();
    rect.setHeight(25*Global::nvars_used);
    gbox->setGeometry(rect);
    gbox->show();
}
开发者ID:gibbogle,项目名称:vspheroid-abm,代码行数:55,代码来源:field.cpp

示例7: QWidget

SettingsPageTask::SettingsPageTask( QWidget *parent) :
  QWidget( parent ),
  m_selectedSwitchScheme(0),
  m_distUnit(Distance::getUnit()),
  m_startLineValue(0),
  m_startRingValue(0),
  m_startSectorInnerRadiusValue(0),
  m_startSectorOuterRadiusValue(0),
  m_startSectorAngleValue(0),
  m_finishLineValue(0),
  m_finishRingValue(0),
  m_finishSectorInnerRadiusValue(0),
  m_finishSectorOuterRadiusValue(0),
  m_finishSectorAngleValue(0),
  m_obsCircleRadiusValue(0),
  m_obsSectorInnerRadiusValue(0),
  m_obsSectorOuterRadiusValue(0),
  m_obsSectorAngleValue(0)
{
  setObjectName("SettingsPageTask");
  setWindowFlags( Qt::Tool );
  setWindowModality( Qt::WindowModal );
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowTitle( tr("Settings - Task") );

  if( parent )
    {
      resize( parent->size() );
    }

  // Layout used by scroll area
  QHBoxLayout *sal = new QHBoxLayout;

  // new widget used as container for the dialog layout.
  QWidget* sw = new QWidget;

  // Scroll area
  QScrollArea* sa = new QScrollArea;
  sa->setWidgetResizable( true );
  sa->setFrameStyle( QFrame::NoFrame );
  sa->setWidget( sw );

#ifdef ANDROID
  QScrollBar* lvsb = sa->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture( sa->viewport(), QScroller::LeftMouseButtonGesture );
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture( sa->viewport(), QtScroller::LeftMouseButtonGesture );
#endif

  // Add scroll area to its own layout
  sal->addWidget( sa );

  QHBoxLayout *contentLayout = new QHBoxLayout(this);

  // Pass scroll area layout to the content layout.
  contentLayout->addLayout( sal );

  GeneralConfig *conf = GeneralConfig::instance();
  int row = 0;

  QGridLayout *topLayout = new QGridLayout(sw);
  //contentLayout->addLayout(topLayout);

  topLayout->setMargin(10);
  topLayout->setSpacing(20);
  topLayout->setColumnStretch( 3, 5 );

  //---------------------------------------------------------------
  QGroupBox *ssBox = new QGroupBox( tr("Switch Scheme"), this );
  topLayout->addWidget( ssBox, row, 0 );

  ntScheme = new QButtonGroup(this);
  QRadioButton* nearest  = new QRadioButton( tr("Minimum"), this );
  QRadioButton* touched  = new QRadioButton( tr("Touched"), this );

  ntScheme->addButton( nearest, 0 );
  ntScheme->addButton( touched, 1 );

  m_reportSwitch = new QCheckBox( tr("Report"), this );

  QVBoxLayout* vbox = new QVBoxLayout;
  vbox->addWidget( nearest );
  vbox->addWidget( touched );
  vbox->addWidget( m_reportSwitch );
  vbox->addStretch(1);
  ssBox->setLayout(vbox);

  nearest->setEnabled(true);
  touched->setEnabled(true);
  touched->setChecked(true);

  // set active button as selected
  m_selectedSwitchScheme = (int) conf->getActiveTaskSwitchScheme();

//.........这里部分代码省略.........
开发者ID:Exadios,项目名称:Cumulus,代码行数:101,代码来源:settingspagetask.cpp

示例8: QDialog

PrintDialog::PrintDialog( QWidget *parent, const char *name, int maxPages,
							bool marked )		
	: QDialog( parent, name, TRUE )
{
	setFocusPolicy(QWidget::StrongFocus);
	
	pgMode = All;
	/*
	printerName.sprintf( "" ); // default printer will be chosen.
	spoolerCommand.sprintf( "lpr" );
	printerVariable.sprintf( "PRINTER" );
	*/

	KConfig *config = KApplication::getKApplication()->getConfig();
	/* Read in the default options. */
	config->setGroup( "Print" );
	printerName=config->readEntry ("Name","");
	spoolerCommand=config->readEntry ("Spool","lpr");
	printerVariable=config->readEntry ("Variable","PRINTER");


	pgMax = maxPages;
	pgStart=0; pgEnd=0;
	
	int border = 10;
	
	QBoxLayout *topLayout = new QVBoxLayout( this, border );
	
	cbFile = new QCheckBox( i18n("Print to file"), this );
	cbFile->setFixedHeight( cbFile->sizeHint().height() );
	
	topLayout->addWidget( cbFile );
	
	QGroupBox *group = new QGroupBox( i18n( "Pages" ), this );
	topLayout->addWidget( group, 10 );
	
	QGridLayout *grid = new QGridLayout( group, 5, 7, 5 );
	
	grid->setRowStretch( 0, 10 );
	grid->setRowStretch( 1, 100 );
	grid->setRowStretch( 2, 0 );
	grid->setRowStretch( 3, 100 );
	grid->setRowStretch( 4, 10 );
	
	grid->setColStretch( 0, 0 );
	grid->setColStretch( 1, 100 );
	grid->setColStretch( 2, 100 );
	grid->setColStretch( 3, 100 );
	grid->setColStretch( 4, 0 );
	grid->setColStretch( 5, 100 );
	grid->setColStretch( 6, 0 );
		
	pgGroup = new QButtonGroup( group );
	pgGroup->hide();
	pgGroup->setExclusive( true );
	connect( pgGroup, SIGNAL( clicked( int ) ), SLOT( slotPageMode( int ) ) );
	
	int widest = 0;
	
	QRadioButton *arb = new QRadioButton( i18n("&All"), group );
	arb->setFixedHeight( arb->sizeHint().height()+6 );
	arb->setChecked( true );
	pgGroup->insert( arb, All );
	
	grid->addWidget( arb, 1, 1 );
	
	if ( arb->sizeHint().width() > widest )
	  widest = arb->sizeHint().width();
	
	QRadioButton *rb = new QRadioButton( i18n("&Current"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	pgGroup->insert( rb, Current );
	
	grid->addWidget( rb, 1, 2 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	rb = new QRadioButton( i18n("&Marked"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	if ( !marked )
	  rb->setEnabled( false );
	else
	  {
	    arb->setChecked ( false );
	    rb->setChecked ( true );
	  }

	pgGroup->insert( rb, Marked );
	
	grid->addWidget( rb, 3, 1 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	rb = new QRadioButton( i18n("&Range"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	pgGroup->insert( rb, Range );
	
	grid->addWidget( rb, 3, 2 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
//.........这里部分代码省略.........
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:101,代码来源:print.cpp

示例9: Dialog

PsdSettingsPopup::PsdSettingsPopup()
    : Dialog(TApp::instance()->getMainWindow(), true, true, "PsdSettings")
    , m_mode(FLAT) {
  bool ret = true;

  setWindowTitle(tr("Load PSD File"));

  m_filename = new QLabel(tr(""));
  m_filename->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  m_filename->setFixedHeight(WidgetHeight);
  m_parentDir = new QLabel(tr(""));
  m_parentDir->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
  m_parentDir->setFixedHeight(WidgetHeight);
  QLabel *nmLbl = new QLabel(tr("Name:"));
  nmLbl->setObjectName("TitleTxtLabel");
  QLabel *ptLbl = new QLabel(tr("Path:"));
  ptLbl->setObjectName("TitleTxtLabel");
  QGridLayout *grid = new QGridLayout();
  grid->setColumnMinimumWidth(0, 65);
  grid->addWidget(nmLbl, 0, 0, Qt::AlignRight);
  grid->addWidget(m_filename, 0, 1, Qt::AlignLeft);
  grid->addWidget(ptLbl, 1, 0, Qt::AlignRight);
  grid->addWidget(m_parentDir, 1, 1, Qt::AlignLeft);
  QHBoxLayout *layinfo = new QHBoxLayout;
  layinfo->addLayout(grid);
  layinfo->addStretch();
  addLayout(layinfo, false);

  /*
          m_psdTree = new QTreeWidget();
          m_psdTree->setIconSize(QSize(21,17));
          m_psdTree->setColumnCount(1);
          m_psdTree->setMaximumHeight(7*WidgetHeight);
          m_psdTree->setHeaderLabel("PSD Info");
          addWidget(m_psdTree);			 */

  addSeparator();

  m_loadMode = new QComboBox();
  QStringList modes;
  modes.push_back("Single Image");
  modes.push_back("Frames");
  modes.push_back("Columns");
  m_loadMode->addItems(modes);
  m_loadMode->setFixedHeight(WidgetHeight);
  m_loadMode->setFixedWidth(120);

  m_modeDescription = new QTextEdit(modesDescription[0]);
  m_modeDescription->setFixedHeight(40);
  m_modeDescription->setMinimumWidth(250);
  m_modeDescription->setReadOnly(true);
  m_createSubXSheet = new CheckBox(tr("Expose in a Sub-xsheet"));
  m_createSubXSheet->setMaximumHeight(WidgetHeight);
  m_createSubXSheet->setEnabled(false);

  m_levelNameType = new QComboBox();
  QStringList types;
  types << tr("FileName#LayerName") << tr("LayerName");
  m_levelNameType->addItems(types);
  m_levelNameType->setFixedHeight(WidgetHeight);
  m_levelNameType->setEnabled(false);

  QLabel *modeLbl = new QLabel(tr("Load As:"));
  modeLbl->setObjectName("TitleTxtLabel");

  QLabel *levelNameLbl = new QLabel(tr("Level Name:"));
  levelNameLbl->setObjectName("TitleTxtLabel");

  QGridLayout *gridMode = new QGridLayout();
  gridMode->setColumnMinimumWidth(0, 65);
  gridMode->setMargin(0);
  gridMode->addWidget(modeLbl, 0, 0, Qt::AlignRight);
  gridMode->addWidget(m_loadMode, 0, 1, Qt::AlignLeft);
  gridMode->addWidget(m_modeDescription, 1, 1, Qt::AlignLeft);
  gridMode->addWidget(m_createSubXSheet, 2, 1, Qt::AlignLeft);
  gridMode->addWidget(levelNameLbl, 3, 0, Qt::AlignRight);
  gridMode->addWidget(m_levelNameType, 3, 1, Qt::AlignLeft);
  QHBoxLayout *modeLayout = new QHBoxLayout;
  modeLayout->addLayout(gridMode);
  modeLayout->addStretch();
  addLayout(modeLayout, false);

  addSeparator(tr("Group Option"));
  m_psdFolderOptions = new QButtonGroup(this);
  QList<QString> folderOptionsList;
  folderOptionsList << tr("Ignore groups");
  folderOptionsList << tr(
      "Expose layers in a group as columns in a sub-xsheet");
  folderOptionsList << tr("Expose layers in a group as frames in a column");

  QGridLayout *gridButton = new QGridLayout();
  gridButton->setColumnMinimumWidth(0, 70);
  int i;
  for (i = 0; i < folderOptionsList.count(); i++) {
    QRadioButton *radioButton = new QRadioButton(folderOptionsList.at(i));
    if (i == 0) radioButton->setChecked(true);

    radioButton->setMaximumHeight(WidgetHeight);
    if (m_mode != COLUMNS) {
      radioButton->setEnabled(false);
//.........这里部分代码省略.........
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:101,代码来源:psdsettingspopup.cpp

示例10: customizeGUI

void Clamp::customizeGUI(void) {

	QGridLayout *customlayout = DefaultGUIModel::getLayout(); 
	customlayout->setColumnStretch(1,1);

	//overall GUI layout with a "horizontal box" copied from DefaultGUIModel
	QGroupBox *plotBox = new QGroupBox("FI Plot");
	QHBoxLayout *plotBoxLayout = new QHBoxLayout;
	plotBox->setLayout(plotBoxLayout);

	QPushButton *clearButton = new QPushButton("&Clear");
	QPushButton *linearfitButton = new QPushButton("Linear &Fit");
	QPushButton *savePlotButton = new QPushButton("Screenshot");
	QPushButton *printButton = new QPushButton("Print");
	QPushButton *saveDataButton = new QPushButton("Save Data");
	plotBoxLayout->addWidget(clearButton);
	plotBoxLayout->addWidget(linearfitButton);
	plotBoxLayout->addWidget(printButton);
	plotBoxLayout->addWidget(savePlotButton);
	plotBoxLayout->addWidget(saveDataButton);
	QLineEdit *eqnLine = new QLineEdit("Linear Equation");
	eqnLine->setText("Y = c0 + c1 * X");
	eqnLine->setFrame(false);
	splot = new ScatterPlot(this);

	// Connect buttons to functions
	QObject::connect(clearButton, SIGNAL(clicked()), splot, SLOT(clear()));
	QObject::connect(clearButton, SIGNAL(clicked()), this, SLOT(clearData()));
	QObject::connect(savePlotButton, SIGNAL(clicked()), this, SLOT(exportSVG()));
	QObject::connect(printButton, SIGNAL(clicked()), this, SLOT(print()));
	QObject::connect(saveDataButton, SIGNAL(clicked()), this, SLOT(saveFIData()));
	QObject::connect(linearfitButton, SIGNAL(clicked()), this, SLOT(fitData()));
	clearButton->setToolTip("Clear");
	savePlotButton->setToolTip("Save screenshot");
	saveDataButton->setToolTip("Save data");
	linearfitButton->setToolTip("Perform linear least-squares regression");
	printButton->setToolTip("Print plot");

	plotBox->hide();
	eqnLine->hide();
//	splot->setMinimumSize(450, 270);
	splot->hide();
	customlayout->addWidget(plotBox, 0, 1, 1, 1);
	customlayout->addWidget(eqnLine, 10, 1, 1, 1);
	customlayout->addWidget(splot, 1, 1, 3, 1);

	QGroupBox *modeBox = new QGroupBox("Clamp Mode");
	QHBoxLayout *modeBoxLayout = new QHBoxLayout;
	modeBox->setLayout(modeBoxLayout);
	QButtonGroup *modeButtons = new QButtonGroup;
	modeButtons->setExclusive(true);
	QRadioButton *stepButton = new QRadioButton("Step");
	modeBoxLayout->addWidget(stepButton);
	modeButtons->addButton(stepButton);
	stepButton->setEnabled(true);
	QRadioButton *rampButton = new QRadioButton("Ramp"); 
	modeBoxLayout->addWidget(rampButton);
	modeButtons->addButton(rampButton);
	stepButton->setChecked(true);
	QObject::connect(modeButtons,SIGNAL(buttonClicked(int)),this,SLOT(updateClampMode(int)));
	stepButton->setToolTip("Set mode to current steps");
	rampButton->setToolTip("Set mode to triangular current ramps");
	customlayout->addWidget(modeBox, 0, 0);

	QHBoxLayout *optionBoxLayout = new QHBoxLayout;
	QGroupBox *optionBoxGroup = new QGroupBox;
	QCheckBox *randomCheckBox = new QCheckBox("Randomize");
	optionBoxLayout->addWidget(randomCheckBox);
	QCheckBox *plotFICheckBox = new QCheckBox("Plot FI Curve");
	optionBoxLayout->addWidget(plotFICheckBox);
	QObject::connect(randomCheckBox,SIGNAL(toggled(bool)),this,SLOT(togglerandom(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),eqnLine,SLOT(setVisible(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),splot,SLOT(setVisible(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),plotBox,SLOT(setVisible(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),this,SLOT(toggleFIplot(bool)));
	QObject::connect(plotFICheckBox,SIGNAL(toggled(bool)),this,SLOT(resizeMe()));
	randomCheckBox->setToolTip("Randomize input amplitudes within a cycle");
	plotFICheckBox->setToolTip("Show/Hide FI plot area");
	optionBoxGroup->setLayout(optionBoxLayout);
	customlayout->addWidget(optionBoxGroup, 3, 0);

	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),savePlotButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),printButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),saveDataButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),linearfitButton,SLOT(setEnabled(bool)));
	QObject::connect(DefaultGUIModel::pauseButton,SIGNAL(toggled(bool)),DefaultGUIModel::modifyButton,SLOT(setEnabled(bool)));
	DefaultGUIModel::pauseButton->setToolTip("Start/Stop current clamp protocol");
	DefaultGUIModel::modifyButton->setToolTip("Commit changes to parameter values");
	DefaultGUIModel::unloadButton->setToolTip("Close module");

	QObject::connect(this,SIGNAL(newDataPoint(double,double)),splot,SLOT(appendPoint(double,double)));
	QObject::connect(this,SIGNAL(setFIRange(double, double, double, double)),splot,SLOT(setAxes(double, double, double, double)));
	QObject::connect(this,SIGNAL(setPlotMode(bool)),plotFICheckBox,SLOT(setChecked(bool)));
	QObject::connect(this,SIGNAL(setStepMode(bool)),plotFICheckBox,SLOT(setEnabled(bool)));
	QObject::connect(this,SIGNAL(setStepMode(bool)),plotBox,SLOT(setEnabled(bool)));
	QObject::connect(this,SIGNAL(drawFit(double*, double*, int)),splot,SLOT(appendLine(double*, double*, int)));
	QObject::connect(this,SIGNAL(setEqnMsg(const QString &)), eqnLine,SLOT(setText(const QString &)));

	setLayout(customlayout);
}
开发者ID:RTXI,项目名称:current-clamp,代码行数:100,代码来源:current-clamp.cpp


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