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


C++ QStackedWidget::insertWidget方法代码示例

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


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

示例1: recreate_instruments_widget_from_state

static void recreate_instruments_widget_from_state(vector_t *state){
  QStackedWidget* tabs = instruments_widget->tabs;

  while(tabs->count()>0)
    tabs->removeWidget(tabs->currentWidget());

  //vector_t *names = (vector_t*)state->elements[0];
  vector_t *pages = (vector_t*)state->elements[0];

  for(int i=pages->num_elements-1; i>=0; i--){
    QWidget *page = (QWidget*)pages->elements[i];
    tabs->insertWidget(0,page);//,(const char*)names->elements[i]);
  }

  tabs->setCurrentWidget((QWidget*)state->elements[1]);
}
开发者ID:onukore,项目名称:radium,代码行数:16,代码来源:undo_instruments_widget.cpp

示例2: insertWidget

int QStackedWidgetProto::insertWidget(int index, QWidget *widget)
{
  QStackedWidget *item = qscriptvalue_cast<QStackedWidget*>(thisObject());
  if (item)
    return item->insertWidget(index, widget);
  return 0;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qstackedwidgetproto.cpp

示例3: QGroupBox

/*
 *  Exposure bracketing page.
 *
 *  Purpose:
 *  1. selecting best shot, and
 *  2. increase dynamic range (HDR).
 *
 *  For both of these purposes, it is best to maintain a fixed aperture,
 *  focal distance, focal length, ISO setting, subject distance, and white
 *  balance. That means Manual mode or Av mode, and no auto ISO, no auto
 *  white balance, no auto focus (or turn off auto focus once focus has
 *  been achieved when setting up the shot) and use a tripod if available
 *  (turn off image stabilization).
 *
 *  For purpose 2, want to take the frames as quickly as the exposure can
 *  be adjusted between images (to minimize movement of the subject).
 *  For static subjects, the exposure is usually adjusted by altering the
 *  shutter speed. For dynamic subjects, the exposure can be adjusted by
 *  altering the ISO (not yet implemented, but if shooting RAW this can
 *  be done in post-processing).
 */
QWidget *
MultiShot::getExposureBracketingPage()
{
    /*
     *  Settings.
     */
    const int MAX_Frames = 7; // range is 1 .. 2*MAX + 1

    QLabel *eFramesLabel = new QLabel( tr("Images:" ) );
    eFramesLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    QStackedWidget *eFramesDisplay = new QStackedWidget();
    eFramesDisplay->setFont( QFont("Calibri", 12) );
    QLabel *eFramePage[MAX_Frames+1];
    for( int i = 0; i <= MAX_Frames; i++ ) {
	eFramePage[i] = new QLabel( eFramesDisplay );
	eFramePage[i]->setText( QString::number((2*i)+1) );
	eFramePage[i]->setAlignment( Qt::AlignLeft );
	eFramesDisplay->insertWidget( i, eFramePage[i] );
    }
    eFramesDisplay->setCurrentIndex( 0 );

    eFrames = new QSlider();
    eFrames->setCursor( QCursor(Qt::SizeHorCursor) );
    eFrames->setValue( 0 );
    eFrames->setMinimum( 0 );
    eFrames->setMaximum( MAX_Frames );
    eFrames->setPageStep( 1 );
    eFrames->setOrientation( Qt::Horizontal );
    eFrames->setTickPosition( QSlider::TicksBelow );
    eFrames->setTickInterval( 1 );
    QObject::connect(
	eFrames, SIGNAL(valueChanged(int)),
	eFramesDisplay, SLOT(setCurrentIndex(int)));

    QLabel *eIncrementLabel = new QLabel( tr("Increment:" ) );
    eIncrementLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );

    QStackedWidget *eIncrementDisplay = new QStackedWidget();
    eIncrementDisplay->setFont( QFont("Calibri", 12) );
    for( int i = 0; i < 10; i++ ) {
	eIncrementPage[i] = new QLabel( eIncrementDisplay );
	eIncrementPage[i]->setAlignment( Qt::AlignLeft );
	eIncrementDisplay->insertWidget( i, eIncrementPage[i] );
    }
    eIncrementDisplay->setCurrentIndex( 0 );

    eIncrement = new QSlider();
    eIncrement->setCursor( QCursor(Qt::SizeHorCursor) );
    eIncrement->setValue( 0 );
    eIncrement->setMinimum( 0 );
    eIncrement->setPageStep( 1 );
    eIncrement->setOrientation( Qt::Horizontal );
    eIncrement->setTickPosition( QSlider::TicksBelow );
    eIncrement->setTickInterval( 1 );

    setIncrementPages();

    QObject::connect(
	eIncrement, SIGNAL(valueChanged(int)),
	eIncrementDisplay, SLOT(setCurrentIndex(int)));

    //QPushButton *autoButton = new QPushButton( tr("Auto") );

    eCompensation = new ExposureComp( camera, 5 );
    QObject::connect(
	eCompensation, SIGNAL(propertyChanged(int,int)),
	this, SIGNAL(propertyChanged(int,int)));
    QObject::connect(
	eFrames, SIGNAL(valueChanged(int)),
	eCompensation, SLOT(updateExposures(int)));
    QObject::connect(
	eIncrement, SIGNAL(valueChanged(int)),
	eCompensation, SLOT(updateIncrement(int)));

    /*
     *  Final layout.
     */
    QGridLayout *settingsLayout = new QGridLayout();
//.........这里部分代码省略.........
开发者ID:rudi-c,项目名称:computational-photography-research,代码行数:101,代码来源:MultiShot.cpp

示例4: CreateWidgets


//.........这里部分代码省略.........
            listWindow.insert(idTab,stWidget);
            idTab++;
            //idVal = 0;

            // —оздаем левое меню
            xmlItem childrenItem = xml.find(childItem,md_left_menu,0);
            while (!childrenItem.isNull() && childrenItem.nodeName() == md_left_menu){
                name = xml.attr(childrenItem,mda_name);
                type = xml.attr(childrenItem,mda_type);
                title = xml.attr(childrenItem,mda_title);
                wight = xml.attr(childrenItem,mda_width);

                iisTaskPanel *tskPanel = new iisTaskPanel(Tab);
                if (!wight.isEmpty())
                    tskPanel->setMinimumWidth(wight.toInt());

                vb->addWidget(tskPanel,0);
                vb->setAlignment(tskPanel,Qt::AlignLeft);
                // √руппы меню
                tskPanel->layout()->setAlignment(Qt::AlignTop);
                xmlItem xmlGr = xml.find(childrenItem,md_group);
                while (!xmlGr.isNull()){
                    name = xml.attr(xmlGr,mda_name);
                    type = xml.attr(xmlGr,mda_type);
                    title = xml.attr(xmlGr,mda_title);


                    //QGroupBox *Gr = new QGroupBox(name,prev);
                    iisTaskBox *Gr = new iisTaskBox(title);
                    tskPanel->addWidget(Gr);
                    Gr->setObjectName(name);

                    //Ёлементы меню
                    xmlItem xmlValue = xml.find(xmlGr,md_value);
                    while (!xmlValue.isNull()){
                        name    = xml.attr(xmlValue,mda_name);
                        id      = xml.attr(xmlValue,mda_id);
                        title   = xml.attr(xmlValue,mda_title);
                        act     = xml.sText(xmlValue,md_comaction);

                        iisIconLabel *val = new iisIconLabel(title);
                        val->setObjectName(name);
                        connect(val,SIGNAL(clicked()),this,SLOT(on_clicked_item()));
                        Gr->addIconLabel(val);
                        list.insert(val,idVal);

                        xmlItem iact = xml.findId(itActions,"",act);
                        xmlItem iObj, iFrm;
                        if (!iact.isNull()){
                            QString idObj = xml.sText(iact,md_objectid);
                            xmlItem tmp =  xml.firstChild(md);
                            while (!tmp.isNull()){
                                iObj = xml.findId(tmp,"",idObj);
                                tmp = xml.nextSibling(tmp);
                                if (!iObj.isNull()) break;
                            }
                        }
                        if (!iObj.isNull()){
                            QString idFrm = xml.sText(iact,md_formid);
                            iObj = xml.find(iObj,md_forms);
                            iFrm = xml.findId(iObj,"",idFrm);
                            // —оздаем форму
                            QWidget *form =eng->OpenForm(iFrm);
                            if (form){
                                stWidget->insertWidget(idVal,form);
                                idVal++;
                            }
                        }

                        xmlValue = xml.nextSibling(xmlValue);
                    }

                    xmlGr = xml.nextSibling(xmlGr);
                }
                childrenItem = xml.nextSibling(childrenItem);
            }


            // ѕрава¤ панель
            childrenItem = xml.find(childItem,md_panel);
            while (!childrenItem.isNull()){
                name = xml.attr(childrenItem,mda_name);
                type = xml.attr(childrenItem,mda_type);
                title = xml.attr(childrenItem,mda_title);
                wight = xml.attr(childrenItem,mda_width);
                if (!wight.isEmpty())
                    stWidget->setMinimumWidth(wight.toInt());
                stWidget->setObjectName(name);
                stWidget->setFrameStyle(1);
                stWidget->setFrameShadow(QFrame::Raised);
                vb->addWidget(stWidget,2);

                childrenItem = xml.nextSibling(childrenItem);
            }
            childItem = xml.nextSibling(childItem);
        }
        ifTabs = xml.nextSibling(ifTabs);
    }

}
开发者ID:sergey4475,项目名称:SProject,代码行数:101,代码来源:interface.cpp


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