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


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

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


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

示例1: createUi

  void createUi(PlotViewInterpolation* plot_view) {
    _b1_rbtn = new QRadioButton("no boundary", plot_view);
    _b2_rbtn = new QRadioButton("c1 boundary", plot_view);
    _b3_rbtn = new QRadioButton("c2 boundary", plot_view);
    _b1_rbtn->setDown(true);

    _lbl_weight = new QLabel("lambda", plot_view);
    _lbl_weight->setAlignment(Qt::AlignRight);
    _lbl_weight->adjustSize();

    _sld_precision = new QSlider(Qt::Horizontal, plot_view);
    _sld_precision->setMinimum(1);
    _sld_precision->setMaximum(1000);
    _sld_precision->setTickInterval(1);
    _sld_precision->setValue(20);
    _sld_precision->adjustSize();

    _sld_alpha = new QSlider(Qt::Horizontal, plot_view);
    _sld_alpha->setMinimum(1);
    _sld_alpha->setMaximum(1000);
    _sld_alpha->setTickInterval(1);
    _sld_alpha->setValue(50);
    _sld_alpha->adjustSize();

    _lbl_knot = new QLabel("initial knots", plot_view);
    _lbl_knot->setAlignment(Qt::AlignRight);
    _lbl_knot->adjustSize();

    _lbl_level = new QLabel("level", plot_view);
    _lbl_level->setAlignment(Qt::AlignRight);
    _lbl_knot->adjustSize();

    _sld_level = new QSlider(Qt::Horizontal, plot_view);
    _sld_level->setMinimum(1);
    _sld_level->setMaximum(10);
    _sld_level->setTickInterval(1);
    _sld_level->setValue(1);
    _sld_level->adjustSize();

    QSignalMapper* signal_map = new QSignalMapper(plot_view);
    signal_map->setMapping(_b1_rbtn, 0);  // no boundary
    signal_map->setMapping(_b2_rbtn, 1);  // c1 boundary
    signal_map->setMapping(_b3_rbtn, 2);  // c2 boundary

    QObject::connect(_b1_rbtn, SIGNAL(clicked()), signal_map, SLOT(map()));
    QObject::connect(_b2_rbtn, SIGNAL(clicked()), signal_map, SLOT(map()));
    QObject::connect(_b3_rbtn, SIGNAL(clicked()), signal_map, SLOT(map()));
    QObject::connect(signal_map, SIGNAL(mapped(int)), plot_view,
                     SLOT(setBoundary(int)));
    QObject::connect(_sld_precision, &QSlider::valueChanged, plot_view,
                     &PlotViewInterpolation::changePrecision);
    QObject::connect(_sld_alpha, &QSlider::valueChanged, plot_view,
                     &PlotViewInterpolation::changeAlpha);
    QObject::connect(_sld_level, &QSlider::valueChanged, plot_view,
                     &PlotViewInterpolation::changeLevel);
  }
开发者ID:litlpoet,项目名称:interpolation,代码行数:56,代码来源:plotviewinterpolation.cpp

示例2: KDialogBase

EmailSelectDialog::EmailSelectDialog( const QStringList &emails, const QString &current,
                                      QWidget *parent ) :
  KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok,
               parent )
{
  QFrame *topFrame = plainPage();
  QBoxLayout *topLayout = new QVBoxLayout( topFrame );

  mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"),
                                   topFrame );
  mButtonGroup->setRadioButtonExclusive( true );
  topLayout->addWidget( mButtonGroup );

  QStringList::ConstIterator it;
  for( it = emails.begin(); it != emails.end(); ++it ) {
    QRadioButton *button = new QRadioButton( *it, mButtonGroup );
    if ( (*it) == current ) {
      button->setDown( true );
    }
  }
}
开发者ID:,项目名称:,代码行数:21,代码来源:

示例3: QMainWindow

MainWindow::MainWindow( QWidget *_parent ): QMainWindow(_parent)
{
	this->resize(QSize(1024,800));
	m_kinect=QKinect::instance();
	QToolBar *toolbar = new QToolBar(this);
	toolbar->setObjectName("KinectToolbar");
	QLabel *label= new QLabel(toolbar);
	label->setText("angle");
	toolbar->addWidget(label);
	QDoubleSpinBox *angle = new QDoubleSpinBox(this);
	angle->setMaximum(30.0);
	angle->setMinimum(-30.0);
	angle->setSingleStep(1.0);
	QObject::connect(angle,SIGNAL(valueChanged(double)),m_kinect,SLOT(setAngle(double)));

	toolbar->addWidget(angle);
	QPushButton *reset = new QPushButton("reset");
	QObject::connect(reset,SIGNAL(clicked()),m_kinect,SLOT(resetAngle()));

	toolbar->addWidget(reset);
	QLabel *label2= new QLabel(toolbar);
	label2->setText("Camera Mode");
	toolbar->addWidget(label2);
	QComboBox *videoMode= new QComboBox(toolbar);

	videoMode->addItem("RGB");
	videoMode->addItem("Bayer");
	videoMode->addItem("IR 8");
	videoMode->addItem("IR 10");
	videoMode->addItem("IR 10 P");
	videoMode->addItem("YUV_RGB");
	videoMode->addItem("YUV_RAW");
	QObject::connect(videoMode,SIGNAL(currentIndexChanged(int)),m_kinect,SLOT(setVideoMode(int)));

	toolbar->addWidget(videoMode);

	QRadioButton *off = new QRadioButton("LED off",toolbar);
	off->setDown(true);
	QObject::connect(off,SIGNAL(clicked()),m_kinect,SLOT(setLedOff()));
	toolbar->addWidget(off);
	QRadioButton *red = new QRadioButton("LED red",toolbar);
	QObject::connect(red,SIGNAL(clicked()),m_kinect,SLOT(setRedLed()));

	toolbar->addWidget(red);
	QRadioButton *green = new QRadioButton("LED green",toolbar);
	QObject::connect(green,SIGNAL(clicked()),m_kinect,SLOT(setGreenLed()));

	toolbar->addWidget(green);
	QRadioButton *yellow = new QRadioButton("LED yellow",toolbar);
	QObject::connect(yellow,SIGNAL(clicked()),m_kinect,SLOT(setYellowLed()));

	toolbar->addWidget(yellow);

  QRadioButton *redF = new QRadioButton("flash red ",toolbar);
  QObject::connect(redF,SIGNAL(clicked()),m_kinect,SLOT(setRedLedFlash()));

	toolbar->addWidget(redF);
	QRadioButton *greenF = new QRadioButton("flash green",toolbar);

	QObject::connect(greenF,SIGNAL(clicked()),m_kinect,SLOT(setGreenLedFlash()));
	toolbar->addWidget(greenF);
	QRadioButton *yellowF = new QRadioButton("flash yellow",toolbar);
	QObject::connect(yellowF,SIGNAL(clicked()),m_kinect,SLOT(setYellowLedFlash()));

	toolbar->addWidget(yellowF);

	this->addToolBar(toolbar);

	m_mdiArea = new QMdiArea;
	m_mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
	m_mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
	setCentralWidget(m_mdiArea);
	this->setWindowTitle(QString("Kinect Demo"));

	QGLFormat format;
	format.setVersion(4,1);
	format.setProfile( QGLFormat::CoreProfile);
	format.setSwapInterval(1);


	QMdiSubWindow *subWindow1 = new QMdiSubWindow;
	VideoWindow *rgb = new VideoWindow(VideoWindow::RGB);
	QWidget *container = QWidget::createWindowContainer(rgb);
	subWindow1->setWidget(container);
	subWindow1->setAttribute(Qt::WA_DeleteOnClose);
	subWindow1->setWindowTitle("RGB Output");
	subWindow1->resize(500,350);
	m_mdiArea->addSubWindow(subWindow1);
	VideoWindow *depth = new VideoWindow(VideoWindow::DEPTH);
	container = QWidget::createWindowContainer(depth);
	QMdiSubWindow *subWindow2 = new QMdiSubWindow;
	subWindow2->setWidget(container);
	subWindow2->setAttribute(Qt::WA_DeleteOnClose);
	subWindow2->setWindowTitle("Depth Output");
	subWindow2->resize(500,350);
	m_mdiArea->addSubWindow(subWindow2);


	PointCloud *cloud = new PointCloud();
	container = QWidget::createWindowContainer(cloud);
//.........这里部分代码省略.........
开发者ID:Ewibd,项目名称:KinectMDI,代码行数:101,代码来源:MainWindow.cpp


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