本文整理汇总了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]);
}
示例2: insertWidget
int QStackedWidgetProto::insertWidget(int index, QWidget *widget)
{
QStackedWidget *item = qscriptvalue_cast<QStackedWidget*>(thisObject());
if (item)
return item->insertWidget(index, widget);
return 0;
}
示例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();
//.........这里部分代码省略.........
示例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);
}
}