![]() When we create a field using QWizardPage::registerField(), we pass a unique field name and a widget. ![]() The field's contents is returned as a QVariant. Here, we call QWizardPage::field() to access the contents of the className field (which was defined in the ClassInfoPage) and use it to initialize the OutputFilePage. OutputDirLineEdit - >setText( QDir ::toNativeSeparators( QDir ::tempPath())) ImplementationLineEdit - >setText(className. To register a field, call QWizardPage::registerField() field. It is also possible to specify mandatory fields (i.e., fields that must be filled before the user can advance to the next page). To make it easy to communicate between pages, QWizard supports a "field" mechanism that allows you to register a field (e.g., a QLineEdit) on a page and to access its value from any page. In many wizards, the contents of a page may affect the default values of the fields of a later page. The pixmaps can be set globally for the entire wizard using setPixmap(), or on a per-page basis using QWizardPage::setPixmap(). They may be plain text or HTML (see titleFormat and subTitleFormat). The title and subtitle are set by calling QWizardPage::setTitle() and QWizardPage::setSubTitle() on the individual pages. If the BackgroundPixmap is set, it is used as the background for the wizard otherwise, a default "assistant" image is used. The watermark, banner, and logo pixmaps are ignored by the MacStyle. If the wizard's style is MacStyle, the page looks radically different: Typically, the page is a QWizardPage on which a QGridLayout is installed, with standard child widgets ( QLabels, QLineEdits, etc.). ![]() The page itself (the QWizardPage widget) occupies the area between the header, the watermark, and the button row. At the bottom, there is a row of buttons allowing the user to navigate through the pages. The WatermarkPixmap is displayed on the left side, below the header. When a subTitle is set, QWizard displays it in a header, in which case it also uses the BannerPixmap and the LogoPixmap to decorate the header. The diagram belows shows how QWizard renders these attributes, assuming they are all present and ModernStyle is used: LogoPixmap (used by ClassicStyle and ModernStyle).WatermarkPixmap (used by ClassicStyle and ModernStyle).A set of pixmaps, which may or may not be honored, depending on the wizard's style:.Wizards consist of a sequence of QWizardPages. Wizard() - >setOption( QWizard ::HaveCustomButton1, true) Ĭonnect(wizard(), & QWizard ::customButtonClicked, this, &ConclusionPage ::printButtonClicked) Elements of a Wizard Page Wizard() - >setButtonText( QWizard ::CustomButton1, tr( "&Print")) You can explicitly set the look to use using setWizardStyle() (e.g., if you want the same look on all platforms). If (translator - >load(translatorFileName, QLibraryInfo ::path( QLibraryInfo ::TranslationsPath))) QTranslator *translator = new QTranslator( &app) TranslatorFileName + = QLocale ::system(). #ifndef QT_NO_TRANSLATION QString translatorFileName = QLatin1String( "qtbase_") QLabel *label = new QLabel( "This wizard will help you register your copy " "of Super Product Two.") TestOption(QWizard::WizardOption option) const SetWizardStyle(QWizard::WizardStyle style) SetPixmap(QWizard::WizardPixmap which, const QPixmap & pixmap) SetOptions(QWizard::WizardOptions options) SetOption(QWizard::WizardOption option, bool on = true) SetField(const QString & name, const QVariant & value) SetDefaultProperty(const char * className, const char * property, const char * changedSignal) SetButtonText(QWizard::WizardButton which, const QString & text) SetButton(QWizard::WizardButton which, QAbstractButton * button) ![]() Pixmap(QWizard::WizardPixmap which) const QWizard(QWidget * parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())īutton(QWizard::WizardButton which) constīuttonText(QWizard::WizardButton which) const
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |