tabNamePage
::tabNamePage(QWidget *parent
) : QWizardPage
(parent
){
setTitle(tr("Tab Selection"));
setSubTitle(tr("Please choose how many tabs "
"and specify the names of each."));
Qt::Alignment Left = Qt::AlignLeft;
numberTabLabel
= new QLabel(tr
("Number of tabs:"));
numberTabLabel->setMaximumWidth(100);
numberTabSpin->setFixedWidth(50);
numberTabSpin->setMinimum(1);
numberTabSpin->setMaximum(10);
tab1->setVisible(true);
tab1->setText("Tab 1");
tab1->setFixedWidth(220);
...
registerField("Number of tabs", numberTabSpin);
registerField("tab1", tab1);
registerField("Name of tab 2", tab2);
registerField("Name of tab 3", tab3);
registerField("Name of tab 4", tab4);
registerField("Name of tab 5", tab5);
registerField("Name of tab 6", tab6);
registerField("Name of tab 7", tab7);
registerField("Name of tab 8", tab8);
registerField("Name of tab 9", tab9);
registerField("Name of tab 10", tab10);
Hlayout->addWidget(numberTabLabel);
Hlayout->addWidget(numberTabSpin);
Hlayout->setAlignment(Left);
tab1Hlayout->addWidget(tab1);
tab1Hlayout->addWidget(tab2);
tab1Hlayout->setAlignment(Left);
...
Vlayout->addLayout(Hlayout);
Vlayout->addLayout(tab1Hlayout);
Vlayout->addLayout(tab2Hlayout);
Vlayout->addLayout(tab3Hlayout);
Vlayout->addLayout(tab4Hlayout);
Vlayout->addLayout(tab5Hlayout);
setLayout(Vlayout);
connect(numberTabSpin, SIGNAL(valueChanged(int)),this, SLOT(filltabnameboxes(int)));
}
whichVariablesPage1
::whichVariablesPage1(QWidget *parent
) : QWizardPage
(parent
){
QString tab1
= field
("tab1").
toString();
//QString title ="Variables Selection for ";
setTitle(tab1);
setSubTitle(tr("Specify which Variables you would like to include."));
tab5Hlayout->addWidget(tab2);
setLayout(tab5Hlayout);
}
int whichVariablesPage1::nextId() const
{
int tabs = field("Number of tabs").toInt();
if(tabs > 1)
{
return newWizard::Page_whichVariable2;
} else {
return newWizard::Page_conclusion;
}
}
tabNamePage::tabNamePage(QWidget *parent) : QWizardPage(parent)
{
setTitle(tr("Tab Selection"));
setSubTitle(tr("Please choose how many tabs "
"and specify the names of each."));
Qt::Alignment Left = Qt::AlignLeft;
numberTabLabel = new QLabel(tr("Number of tabs:"));
numberTabLabel->setMaximumWidth(100);
numberTabSpin = new QSpinBox;
numberTabSpin->setFixedWidth(50);
numberTabSpin->setMinimum(1);
numberTabSpin->setMaximum(10);
tab1 = new QLineEdit;
tab1->setVisible(true);
tab1->setText("Tab 1");
tab1->setFixedWidth(220);
...
registerField("Number of tabs", numberTabSpin);
registerField("tab1", tab1);
registerField("Name of tab 2", tab2);
registerField("Name of tab 3", tab3);
registerField("Name of tab 4", tab4);
registerField("Name of tab 5", tab5);
registerField("Name of tab 6", tab6);
registerField("Name of tab 7", tab7);
registerField("Name of tab 8", tab8);
registerField("Name of tab 9", tab9);
registerField("Name of tab 10", tab10);
QHBoxLayout *Hlayout = new QHBoxLayout;
Hlayout->addWidget(numberTabLabel);
Hlayout->addWidget(numberTabSpin);
Hlayout->setAlignment(Left);
QHBoxLayout *tab1Hlayout = new QHBoxLayout;
tab1Hlayout->addWidget(tab1);
tab1Hlayout->addWidget(tab2);
tab1Hlayout->setAlignment(Left);
...
Vlayout = new QVBoxLayout;
Vlayout->addLayout(Hlayout);
Vlayout->addLayout(tab1Hlayout);
Vlayout->addLayout(tab2Hlayout);
Vlayout->addLayout(tab3Hlayout);
Vlayout->addLayout(tab4Hlayout);
Vlayout->addLayout(tab5Hlayout);
setLayout(Vlayout);
connect(numberTabSpin, SIGNAL(valueChanged(int)),this, SLOT(filltabnameboxes(int)));
}
whichVariablesPage1::whichVariablesPage1(QWidget *parent) : QWizardPage(parent)
{
QString tab1 = field("tab1").toString();
//QString title ="Variables Selection for ";
setTitle(tab1);
setSubTitle(tr("Specify which Variables you would like to include."));
QHBoxLayout *tab5Hlayout = new QHBoxLayout;
QLabel *tab2 = new QLabel(tab1);
tab5Hlayout->addWidget(tab2);
setLayout(tab5Hlayout);
}
int whichVariablesPage1::nextId() const
{
int tabs = field("Number of tabs").toInt();
if(tabs > 1)
{
return newWizard::Page_whichVariable2;
} else {
return newWizard::Page_conclusion;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks