Trivial Wizard Example | Qt 4.8 (original) (raw)

Introduction Page

The introduction page is created with the createIntroPage() function where a QWizardPage is created and its title is set to "Introduction". A QLabel is used to hold the description of page. A QVBoxLayout is used to hold the label. This page is returned when the createIntroPage() function is called.
Registration Page

The registration page is created with the createRegistrationPage() function. QLineEdit objects are used to allow the user to input a name and an e-mail address. A QGridLayout is used to hold the QLabel and QLineEdit objects.
Conclusion Page

The conclusion page is created in the createConclusionPage() function. This function's content is similar to createIntroPage(). A QLabel is used to inform the user that the registration process has completed successfully.
main() Function
The main() function instantiates a QWizard object, wizard, and adds all three QWizardPage objects to it. The wizard window title is set to "Trivial Wizard" and its show() function is invoked to display it.
int main(int argc, char *argv[]) { QApplication app(argc, argv);
[QString](qstring.html) translatorFileName = QLatin1String("qt_");
translatorFileName += [QLocale](qlocale.html)::system().name();
[QTranslator](qtranslator.html) *translator = new [QTranslator](qtranslator.html)(&app);
if (translator->load(translatorFileName, [QLibraryInfo](qlibraryinfo.html)::location([QLibraryInfo](qlibraryinfo.html)::TranslationsPath)))
app.installTranslator(translator);
[QWizard](qwizard.html) wizard;
wizard.addPage(createIntroPage());
wizard.addPage(createRegistrationPage());
wizard.addPage(createConclusionPage());
wizard.setWindowTitle("Trivial Wizard");#ifdef Q_OS_SYMBIAN wizard.showMaximized(); #else wizard.show(); #endif
return app.exec();}
Files:
See also QWizard, Class Wizard Example, and License Wizard Example.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.