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


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

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


在下文中一共展示了QRadioButton::setVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: rect

ThresholdDialog::ThresholdDialog(const GrayscaleImage* image, bool converted)  : _image(image){
    this->setWindowTitle(tr("ThresholdOp"));
    this->setMinimumWidth(160);

    QGridLayout * layout = new QGridLayout();
    this->setLayout(layout);

    QVBoxLayout* Vboxlayout = new QVBoxLayout();
    if(converted) {
        Vboxlayout->addWidget(new QLabel(tr("<font color=red><i>Information : The input image has been converted to grayscale.</i></font>")));
    }
    QGroupBox* threshGroup = new QGroupBox(tr("Threshold"), this);
    QHBoxLayout* threshLayout = new QHBoxLayout(threshGroup);
    _doubleBox = new QCheckBox(tr("Double threshold (right clic to move the second threshold)"));
    threshLayout->addWidget(_doubleBox);
    Vboxlayout->addWidget(threshGroup);

    QHBoxLayout* box1layout = new QHBoxLayout();
    _spin1label = new QLabel(tr("Threshold : "));
    _spinbox1 = new QSpinBox();
    _spinbox1->setRange(0, 255);
    _spinbox1->setValue(127);
    QPushButton* otsuButton = new QPushButton(tr("Otsu"));
    box1layout->addWidget(_spin1label);
    box1layout->addWidget(_spinbox1);
    box1layout->addWidget(otsuButton);
    Vboxlayout->addLayout(box1layout);

    QHBoxLayout* box2layout = new QHBoxLayout();
    QLabel* spin2label = new QLabel(tr("Threshold #2 : "));
    spin2label->setVisible(false);
    _spinbox2 = new QSpinBox();
    _spinbox2->setRange(0, 255);
    _spinbox2->setValue(255);
    _spinbox2->setVisible(false);
    box2layout->addWidget(spin2label);
    box2layout->addWidget(_spinbox2);
    Vboxlayout->addLayout(box2layout);

    QHBoxLayout* radiolayout = new QHBoxLayout();
    QLabel* radioLabel = new QLabel(tr("Color between thresholds :"));
    QRadioButton* whiteButton = new QRadioButton(tr("White"));
    _blackButton = new QRadioButton(tr("Black"));
    radiolayout->addWidget(radioLabel);
    radiolayout->addWidget(whiteButton);
    radiolayout->addWidget(_blackButton);
    whiteButton->setChecked(true);
    Vboxlayout->addLayout(radiolayout);
    radioLabel->setVisible(false);
    whiteButton->setVisible(false);
    _blackButton->setVisible(false);

    Rectangle rect(0, 0, image->getWidth(), image->getHeight());
    GenericHistogramView* histo = new GenericHistogramView(image, rect);
    QwtPlot* plot = histo->getGraphicalHistogram();


    _marker1 = new QwtPlotMarker();
    _marker1->setLineStyle(QwtPlotMarker::VLine);
    _marker1->setLinePen(QPen(Qt::black));
    _marker1->setXValue(127);
    _marker1->attach(plot);

    _marker2 = new QwtPlotMarker();
    _marker2->setLineStyle(QwtPlotMarker::VLine);
    _marker2->setLinePen(QPen(Qt::black));
    _marker2->setXValue(255);
    _marker2->attach(plot);
    _marker2->hide();

    _preview = new ImageWidget(this, _image);
    _preview->setFixedSize(256*_preview->pixmap().width()/_preview->pixmap().height(), 256);
    layout->setColumnMinimumWidth(0,256*_preview->pixmap().width()/_preview->pixmap().height());
    layout->addWidget(_preview,0,0,0,0,Qt::AlignTop);
    Vboxlayout->addWidget(plot);
    layout->setRowMinimumHeight(0,256);
    layout->setColumnMinimumWidth(1,20);
    layout->addLayout(Vboxlayout,0,2,0,2,Qt::AlignLeft);
    _previewBox = new QCheckBox(tr("Aperçu"));
    _previewBox->setChecked(true);
    updatePreview();
    layout->addWidget(_previewBox,1,0,1,0,Qt::AlignTop);


    layout->setSizeConstraint(QLayout::SetMinimumSize);

    QPushButton *okButton = new QPushButton(tr("Validate"), this);
    okButton->setDefault(true);
    Vboxlayout->addWidget(okButton);

    connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
    connect(histo, SIGNAL(leftMoved(const QPointF&)), this, SLOT(marker1Moved(const QPointF&)));
    connect(histo, SIGNAL(rightMoved(const QPointF&)), this, SLOT(marker2Moved(const QPointF&)));

    connect(_spinbox1, SIGNAL(valueChanged(int)), this, SLOT(spinbox1Changed(int)));
    connect(_spinbox2, SIGNAL(valueChanged(int)), this, SLOT(spinbox2Changed(int)));


    connect(_doubleBox, SIGNAL(toggled(bool)), _spinbox2, SLOT(setVisible(bool)));
    connect(_doubleBox, SIGNAL(toggled(bool)), spin2label, SLOT(setVisible(bool)));
//.........这里部分代码省略.........
开发者ID:eiimage,项目名称:eiimage,代码行数:101,代码来源:ThresholdDialog.cpp


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