7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qdialog.h>
18class Q_WIDGETS_EXPORT
QWizard :
public QDialog
21 Q_PROPERTY(WizardStyle wizardStyle READ wizardStyle WRITE setWizardStyle)
22 Q_PROPERTY(WizardOptions options READ options WRITE setOptions)
23 Q_PROPERTY(Qt::TextFormat titleFormat READ titleFormat WRITE setTitleFormat)
24 Q_PROPERTY(Qt::TextFormat subTitleFormat READ subTitleFormat WRITE setSubTitleFormat)
25 Q_PROPERTY(
int startId READ startId WRITE setStartId)
26 Q_PROPERTY(
int currentId READ currentId WRITE setCurrentId NOTIFY currentIdChanged)
64 IndependentPages = 0x00000001,
65 IgnoreSubTitles = 0x00000002,
66 ExtendedWatermarkPixmap = 0x00000004,
67 NoDefaultButton = 0x00000008,
68 NoBackButtonOnStartPage = 0x00000010,
69 NoBackButtonOnLastPage = 0x00000020,
70 DisabledBackButtonOnLastPage = 0x00000040,
71 HaveNextButtonOnLastPage = 0x00000080,
72 HaveFinishButtonOnEarlyPages = 0x00000100,
73 NoCancelButton = 0x00000200,
74 CancelButtonOnLeft = 0x00000400,
75 HaveHelpButton = 0x00000800,
76 HelpButtonOnRight = 0x00001000,
77 HaveCustomButton1 = 0x00002000,
78 HaveCustomButton2 = 0x00004000,
79 HaveCustomButton3 = 0x00008000,
80 NoCancelButtonOnLastPage = 0x00010000
84 Q_DECLARE_FLAGS(WizardOptions, WizardOption)
87 explicit QWizard(QWidget *parent =
nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
90 int addPage(QWizardPage *page);
91 void setPage(
int id, QWizardPage *page);
92 void removePage(
int id);
93 QWizardPage *page(
int id)
const;
94 bool hasVisitedPage(
int id)
const;
95 QList<
int> visitedIds()
const;
96 QList<
int> pageIds()
const;
97 void setStartId(
int id);
99 QWizardPage *currentPage()
const;
100 int currentId()
const;
102 virtual bool validateCurrentPage();
103 virtual int nextId()
const;
105 void setField(
const QString &name,
const QVariant &value);
106 QVariant field(
const QString &name)
const;
108 void setWizardStyle(WizardStyle style);
109 WizardStyle wizardStyle()
const;
111 void setOption(WizardOption option,
bool on =
true);
112 bool testOption(WizardOption option)
const;
113 void setOptions(WizardOptions options);
114 WizardOptions options()
const;
116 void setButtonText(WizardButton which,
const QString &text);
117 QString buttonText(WizardButton which)
const;
118 void setButtonLayout(
const QList<WizardButton> &layout);
119 void setButton(WizardButton which, QAbstractButton *button);
120 QAbstractButton *button(WizardButton which)
const;
122 void setTitleFormat(Qt::TextFormat format);
123 Qt::TextFormat titleFormat()
const;
124 void setSubTitleFormat(Qt::TextFormat format);
125 Qt::TextFormat subTitleFormat()
const;
126 void setPixmap(WizardPixmap which,
const QPixmap &pixmap);
127 QPixmap pixmap(WizardPixmap which)
const;
129 void setSideWidget(QWidget *widget);
130 QWidget *sideWidget()
const;
132 void setDefaultProperty(
const char *className,
const char *property,
133 const char *changedSignal);
135 void setVisible(
bool visible) override;
136 QSize sizeHint()
const override;
139 void currentIdChanged(
int id);
140 void helpRequested();
141 void customButtonClicked(
int which);
142 void pageAdded(
int id);
143 void pageRemoved(
int id);
148 void setCurrentId(
int id);
152 bool event(QEvent *event) override;
153 void resizeEvent(QResizeEvent *event) override;
154 void paintEvent(QPaintEvent *event) override;
155#if defined(Q_OS_WIN) || defined(Q_QDOC)
156 bool nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result) override;
158 void done(
int result) override;
159 virtual void initializePage(
int id);
160 virtual void cleanupPage(
int id);
163 Q_DISABLE_COPY(QWizard)
164 Q_DECLARE_PRIVATE(QWizard)
165 Q_PRIVATE_SLOT(d_func(),
void _q_emitCustomButtonClicked())
166 Q_PRIVATE_SLOT(d_func(),
void _q_updateButtonStates())
167 Q_PRIVATE_SLOT(d_func(),
void _q_handleFieldObjectDestroyed(QObject *))
169 friend class QWizardPage;
172Q_DECLARE_OPERATORS_FOR_FLAGS(QWizard::WizardOptions)
174class QWizardPagePrivate;
179 Q_PROPERTY(QString title READ title WRITE setTitle)
180 Q_PROPERTY(QString subTitle READ subTitle WRITE setSubTitle)
183 explicit QWizardPage(QWidget *parent =
nullptr);
186 void setTitle(
const QString &title);
187 QString title()
const;
188 void setSubTitle(
const QString &subTitle);
189 QString subTitle()
const;
190 void setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap);
191 QPixmap pixmap(QWizard::WizardPixmap which)
const;
192 void setFinalPage(
bool finalPage);
193 bool isFinalPage()
const;
194 void setCommitPage(
bool commitPage);
195 bool isCommitPage()
const;
196 void setButtonText(QWizard::WizardButton which,
const QString &text);
197 QString buttonText(QWizard::WizardButton which)
const;
199 virtual void initializePage();
200 virtual void cleanupPage();
201 virtual bool validatePage();
202 virtual bool isComplete()
const;
203 virtual int nextId()
const;
206 void completeChanged();
209 void setField(
const QString &name,
const QVariant &value);
210 QVariant field(
const QString &name)
const;
211 void registerField(
const QString &name, QWidget *widget,
const char *property =
nullptr,
212 const char *changedSignal =
nullptr);
213 QWizard *wizard()
const;
216 Q_DISABLE_COPY(QWizardPage)
217 Q_DECLARE_PRIVATE(QWizardPage)
218 Q_PRIVATE_SLOT(d_func(),
void _q_maybeEmitCompleteChanged())
219 Q_PRIVATE_SLOT(d_func(),
void _q_updateCachedCompleteState())
221 friend class QWizard;
222 friend class QWizardPrivate;
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
QSize minimumSizeHint() const override
\reimp
void setSideWidget(QWidget *widget)
QWatermarkLabel(QWidget *parent, QWidget *sideWidget)
QWidget * sideWidget() const
QWizardDefaultProperty(const char *className, const char *property, const char *changedSignal)
void resolve(const QList< QWizardDefaultProperty > &defaultPropertyTable)
QWizardField(QWizardPage *page, const QString &spec, QObject *object, const char *property, const char *changedSignal)
void findProperty(const QWizardDefaultProperty *properties, int propertyCount)
bool operator!=(const QWizardLayoutInfo &other) const
bool operator==(const QWizardLayoutInfo &other) const
void _q_maybeEmitCompleteChanged()
QMap< int, QString > buttonCustomTexts
void _q_updateCachedCompleteState()
bool cachedIsComplete() const
QPixmap pixmaps[QWizard::NPixmaps]
QList< QWizardField > pendingFields
The QWizardPage class is the base class for wizard pages.
QMap< int, QString > buttonCustomTexts
QMap< QString, int > fieldIndexMap
void setStyle(QStyle *style)
QList< QWizardDefaultProperty > defaultPropertyTable
bool buttonLayoutContains(QWizard::WizardButton which)
void _q_updateButtonStates()
QVBoxLayout * pageVBoxLayout
QWatermarkLabel * watermarkLabel
QWizardLayoutInfo layoutInfoForCurrentPage()
void connectButton(QWizard::WizardButton which) const
void removeFieldAt(int index)
void recreateLayout(const QWizardLayoutInfo &info)
QWizardAntiFlickerWidget * antiFlickerWidget
QWizardHeader * headerWidget
QHBoxLayout * buttonLayout
void updateMinMaxSizes(const QWizardLayoutInfo &info)
void _q_emitCustomButtonClicked()
void setButtonLayout(const QWizard::WizardButton *array, int size)
bool isVistaThemeEnabled() const
void updatePixmap(QWizard::WizardPixmap which)
void _q_handleFieldObjectDestroyed(QObject *)
void switchToPage(int newId, Direction direction)
QList< QWizard::WizardButton > buttonsCustomLayout
QPixmap defaultPixmaps[QWizard::NPixmaps]
QWidget * placeholderWidget2
QWizardRuler * bottomRuler
Qt::TextFormat subTitleFmt
void updateButtonLayout()
QList< QWizardField > fields
bool ensureButton(QWizard::WizardButton which) const
bool buttonsHaveCustomLayout
void cleanupPagesNotInHistory()
QAbstractButton * btns[QWizard::NButtons]
QWidget * placeholderWidget1
void addField(const QWizardField &field)
QWizardLayoutInfo layoutInfo
QWizardRuler(QWidget *parent=nullptr)
The QWizard class provides a framework for wizards.
Combined button and popup list for selecting options.
static const char * buttonSlots(QWizard::WizardButton which)
static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate)
static QString object_name_for_button(QWizard::WizardButton which)
Q_DECLARE_TYPEINFO(QWizardDefaultProperty, Q_RELOCATABLE_TYPE)
const int ModernHeaderTopMargin
static void changeSpacerSize(QLayout *layout, int index, int width, int height)
const int MacLayoutLeftMargin
const int GapBetweenLogoAndRightEdge
static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX, const QByteArray &classY)
static QWidget * iWantTheFocus(QWidget *ancestor)
Q_DECLARE_TYPEINFO(QWizardField, Q_RELOCATABLE_TYPE)
const int MacLayoutBottomMargin
const int MacLayoutRightMargin
static const char * changed_signal(int which)
const size_t NFallbackDefaultProperties
const int MacButtonTopMargin
const char className[16]
[1]
QT_REQUIRE_CONFIG(wizard)