本文整理汇总了C++中QWizard::addPage方法的典型用法代码示例。如果您正苦于以下问题:C++ QWizard::addPage方法的具体用法?C++ QWizard::addPage怎么用?C++ QWizard::addPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWizard
的用法示例。
在下文中一共展示了QWizard::addPage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitiateAccountAddition
void InitiateAccountAddition(QWidget *parent)
{
QWizard *wizard = new QWizard (parent);
wizard->setAttribute (Qt::WA_DeleteOnClose);
wizard->setWindowTitle (QObject::tr ("Add account"));
wizard->addPage (new AddAccountWizardFirstPage (wizard));
wizard->show ();
}
示例2: on_Add__released
void AccountsListWidget::on_Add__released ()
{
QWizard *wizard = new QWizard (this);
wizard->setAttribute (Qt::WA_DeleteOnClose);
wizard->setWindowTitle (tr ("Add account"));
wizard->addPage (new AddAccountWizardFirstPage (wizard));
wizard->show ();
}
示例3: QWizard
QWizard *ModelClassWizard::createWizardDialog(QWidget *parent,
const QString &defaultPath, const WizardPageList &extensionPages) const
{
// Create a wizard
QWizard *wizard = new QWizard(parent);
wizard->setWindowTitle(tr("Model Class Wizard"));
// Make our page as first page
ModelNamePage *page = new ModelNamePage(wizard);
int pageId = wizard->addPage(page);
wizard->setProperty("_PageId_", pageId);
page->setPath(defaultPath);
// Now add the remaining pages
foreach (QWizardPage *p, extensionPages)
wizard->addPage(p);
return wizard;
}
示例4: main
//! [9] //! [10]
int main(int argc, char *argv[])
//! [9] //! [11]
{
QApplication app(argc, argv);
QString translatorFileName = QLatin1String("qt_");
translatorFileName += QLocale::system().name();
QTranslator *translator = new QTranslator(&app);
if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
app.installTranslator(translator);
QWizard wizard;
wizard.addPage(createIntroPage());
wizard.addPage(createRegistrationPage());
wizard.addPage(createConclusionPage());
wizard.setWindowTitle("Trivial Wizard");
wizard.show();
return app.exec();
}
示例5: sceneFileConfig
void GameControllerAttachment::sceneFileConfig()
{
QDomDocument sceneFile(m_sceneFile->sceneFileDom());
QDomElement pathNode(sceneFile.documentElement().firstChildElement("EnginePath"));
// Create a wizard for the configuration of the directories
QWizard wizard;
PathPage* page = new PathPage(&wizard);
page->setDirectories(
pathNode.attribute("mediapath"),
pathNode.attribute("scriptpath")
);
wizard.addPage(page);
if (wizard.exec() == QDialog::Accepted)
{
pathNode.setAttribute("mediapath", wizard.field("mediadir").toString());
pathNode.setAttribute("scriptpath", wizard.field("scriptdir").toString());
}
}
示例6: ProfileCreationWizard
ModuleManagerImpl::ModuleManagerImpl()
{
ModuleManager::loadPlugins();
Config config = ProfileDialog::profilesInfo();
#ifdef QUTIM_SINGLE_PROFILE
bool singleProfile = true;
#else
bool singleProfile = false;
#endif
singleProfile = config.value("singleProfile", singleProfile);
QWizard *wizard = 0;
StatisticsHelper *helper = 0;
if (singleProfile) {
if (!config.hasChildGroup("profile")) {
wizard = new ProfileCreationWizard(this, QString(), QString(), true);
} else {
config.beginGroup("profile");
helper = new StatisticsHelper();
if (helper->action() == StatisticsHelper::NeedToAskInit
|| helper->action() == StatisticsHelper::NeedToAskUpdate) {
wizard = new QWizard();
wizard->addPage(new SubmitPage(helper, wizard));
}
if(ProfileDialog::acceptProfileInfo(config, QString())) {
QTimer::singleShot(0, this, SLOT(initExtensions()));
} else {
qWarning("Can't login");
QDialog *dialog = new ProfileDialog(config, this);
SystemIntegration::show(dialog);
}
config.endGroup();
}
} else {
QDialog *dialog = new ProfileDialog(config, this);
SystemIntegration::show(dialog);
}
if (wizard) {
wizard->setAttribute(Qt::WA_DeleteOnClose, true);
wizard->setAttribute(Qt::WA_QuitOnClose, false);
SystemIntegration::show(wizard);
}
}
示例7: actionWizard
//.........这里部分代码省略.........
QWizardPage *page1 = new QWizardPage;
{
page1->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
page1->setTitle(QObject::tr("Basic Layout I"));
page1->setSubTitle(QObject::tr("Breadcrumb and grouping"));
QVBoxLayout *layout = new QVBoxLayout;
QLabel *image = new QLabel;
image->setPixmap(QPixmap(":/images/page0.png"));
image->setAlignment(Qt::AlignHCenter);
QLabel *firstParagraph = new QLabel("(1) A simple to read breadcrumb at the top of each page will help you remember at which level of the tree you are");
firstParagraph->setWordWrap(true);
QLabel *secondParagraph = new QLabel("(2) All the fields within a form are grouped together, or at least sorted in a meaningful way. For any given types all the attributes are stacked at the top of the page, whereas inner elements occupy lower positions.");
secondParagraph->setWordWrap(true);
layout->addWidget(image);
layout->addWidget(firstParagraph);
layout->addWidget(secondParagraph);
page1->setLayout(layout);
}
// SECOND PAGE - Basic Layout Description II
// [0..1]
// TAB
QWizardPage *page2 = new QWizardPage;
{
page2->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
page2->setTitle(QObject::tr("Basic Layout II"));
page2->setSubTitle(QObject::tr("Simple elements and Tabs"));
QVBoxLayout *layout = new QVBoxLayout;
QLabel *image = new QLabel;
image->setPixmap(QPixmap(":/images/page1.png"));
image->setAlignment(Qt::AlignHCenter);
QLabel *firstParagraph = new QLabel("(1) Inner elements with cardinality of [0..1] are hadlled with a couple of buttons to add the element, or edit the existing one, and to remove it. An immutable edit box gives a direct feedback of the status of said element.");
firstParagraph->setWordWrap(true);
QLabel *secondParagraph = new QLabel("(2) To have a nicer and tidier appearence, in case of very rich panels, the content is divided among several tabs, with the aim to keep together correlated elements.");
secondParagraph->setWordWrap(true);
layout->addWidget(image);
layout->addWidget(firstParagraph);
layout->addWidget(secondParagraph);
page2->setLayout(layout);
}
// THIRD PAGE - Basic Layout Description III
// The Amazing ListView
// Mention to New Form vs Simple Dialog
QWizardPage *page3 = new QWizardPage;
{
page3->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
page3->setTitle(QObject::tr("Basic Layout III"));
page3->setSubTitle(QObject::tr("Listview"));
QVBoxLayout *layout = new QVBoxLayout;
QLabel *image = new QLabel;
image->setPixmap(QPixmap(":/images/page2.png"));
image->setAlignment(Qt::AlignHCenter);
QLabel *firstParagraph = new QLabel("In case of inner elements with [0..*] cardinality a custom list manager is provided, to manage the contents.");
firstParagraph->setWordWrap(true);
QLabel *secondParagraph = new QLabel("In presence of both single and multiple cardinality elements within the same form, to keep a coherent appearence all the items are managed with the proposed list view, that automatically forbids the insertion of more than one element, if needed.");
secondParagraph->setWordWrap(true);
layout->addWidget(image);
layout->addWidget(firstParagraph);
layout->addWidget(secondParagraph);
page3->setLayout(layout);
}
// FOURTH PAGE - Dates & Numbers
// Optional fields
// Checkboxes
// Compliance Check
QWizardPage *page4 = new QWizardPage;
{
page4->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
page4->setTitle(QObject::tr("About data"));
page4->setSubTitle(QObject::tr("Dates, numbers and validation"));
QVBoxLayout *layout = new QVBoxLayout;
QLabel *image = new QLabel;
image->setPixmap(QPixmap(":/images/page3.png").scaledToWidth(500, Qt::SmoothTransformation));
image->setAlignment(Qt::AlignHCenter);
QLabel *firstParagraph = new QLabel("(1) Unlike simple text fields, data and numeric related fields come with a checkbox to enable/disable its content from being saved to the XML files in creation. Upon a change of the represented value the checkboxes are automatically ticked off, whilst if unchecked their value is ignored or cleared if previusly modified.");
firstParagraph->setWordWrap(true);
QLabel *secondParagraph = new QLabel("(2) Upon clicking Apply a compliance check is run on the form contents, and an error message, preventing the user from continuing, appears in case of mistakes or shortcomings.");
secondParagraph->setWordWrap(true);
layout->addWidget(image);
layout->addWidget(firstParagraph);
layout->addWidget(secondParagraph);
page4->setLayout(layout);
}
// END OF TUTORIAL
wizard->addPage(intro);
wizard->addPage(page1);
page1->setFixedHeight(420);
wizard->addPage(page2);
wizard->addPage(page3);
wizard->addPage(page4);
wizard->exec();
}