6#include <QtWidgets/private/qtwidgetsglobal_p.h>
9#include "qabstractspinbox.h"
18#if QT_CONFIG(lineedit)
26#if QT_CONFIG(shortcut)
27# include "qshortcut.h"
32#if defined(Q_OS_MACOS)
33#include <AppKit/AppKit.h>
34#include <QtGui/private/qcoregraphics_p.h>
35#elif QT_CONFIG(style_windowsvista)
36#include "qwizard_win_p.h"
39#include "private/qdialog_p.h"
47using namespace Qt::StringLiterals;
61 QSpacerItem *spacer = layout->itemAt(index)->spacerItem();
64 spacer->changeSize(width, height);
69 const int MaxIterations = 100;
72 for (
int i = 0; i < MaxIterations; ++i) {
73 candidate = candidate->nextInFocusChain();
77 if (candidate->focusPolicy() & Qt::TabFocus) {
78 if (candidate != ancestor && ancestor->isAncestorOf(candidate))
86 const QByteArray &classY)
88 const QMetaObject *metaObject = object->metaObject();
90 if (metaObject->className() == classX)
92 if (metaObject->className() == classY)
94 metaObject = metaObject->superClass();
102} fallbackProperties[] = {
104 {
"QAbstractButton",
"checked" },
105 {
"QAbstractSlider",
"value" },
106 {
"QComboBox",
"currentIndex" },
107 {
"QDateTimeEdit",
"dateTime" },
108 {
"QLineEdit",
"text" },
109 {
"QListWidget",
"currentRow" },
110 {
"QSpinBox",
"value" },
122 case 0:
return SIGNAL(toggled(
bool));
123 case 1:
return SIGNAL(valueChanged(
int));
124 case 2:
return SIGNAL(currentIndexChanged(
int));
125 case 3:
return SIGNAL(dateTimeChanged(QDateTime));
126 case 4:
return SIGNAL(textChanged(QString));
127 case 5:
return SIGNAL(currentRowChanged(
int));
128 case 6:
return SIGNAL(valueChanged(
int));
130 static_assert(7 == NFallbackDefaultProperties);
131 Q_UNREACHABLE_RETURN(
nullptr);
143 const char *changedSignal)
152 QWizardField(QWizardPage *page,
const QString &spec, QObject *object,
const char *property,
153 const char *changedSignal);
155 void resolve(
const QList<QWizardDefaultProperty> &defaultPropertyTable);
169 const char *property,
const char *changedSignal)
173 if (name.endsWith(u'*')) {
181 if (property.isEmpty())
182 findProperty(defaultPropertyTable.constData()
, defaultPropertyTable.size()
);
183 initialValue = object->property(property);
188 QByteArray className;
190 for (
int i = 0; i < propertyCount; ++i) {
191 if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)) {
192 className = properties[i].className;
193 property = properties[i].property;
194 changedSignal = properties[i].changedSignal;
227 return topLevelMarginLeft == other.topLevelMarginLeft
228 && topLevelMarginRight == other.topLevelMarginRight
229 && topLevelMarginTop == other.topLevelMarginTop
230 && topLevelMarginBottom == other.topLevelMarginBottom
231 && childMarginLeft == other.childMarginLeft
232 && childMarginRight == other.childMarginRight
233 && childMarginTop == other.childMarginTop
234 && childMarginBottom == other.childMarginBottom
235 && hspacing == other.hspacing
236 && vspacing == other.vspacing
237 && buttonSpacing == other.buttonSpacing
238 && wizStyle == other.wizStyle
239 && header == other.header
240 && watermark == other.watermark
241 && title == other.title
242 && subTitle == other.subTitle
243 && extension == other.extension
244 && sideWidget == other.sideWidget;
260 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
261 Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat,
262 QWizard::BannerSizePolicy bannerSizePolicy);
266#if QT_CONFIG(style_windowsvista)
272 QLabel *subTitleLabel;
275 QPixmap bannerPixmap;
282 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
283 setBackgroundRole(QPalette::Base);
285 titleLabel =
new QLabel(
this);
286 titleLabel->setBackgroundRole(QPalette::Base);
288 subTitleLabel =
new QLabel(
this);
289 subTitleLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
290 subTitleLabel->setWordWrap(
true);
292 logoLabel =
new QLabel(
this);
294 QFont font = titleLabel->font();
296 titleLabel->setFont(font);
298 layout =
new QGridLayout(
this);
299 layout->setContentsMargins(QMargins());
300 layout->setSpacing(0);
302 layout->setRowMinimumHeight(3, 1);
303 layout->setRowStretch(4, 1);
305 layout->setColumnStretch(2, 1);
306 layout->setColumnMinimumWidth(4, 2 * GapBetweenLogoAndRightEdge);
307 layout->setColumnMinimumWidth(6, GapBetweenLogoAndRightEdge);
309 layout->addWidget(titleLabel, 2, 1, 1, 2);
310 layout->addWidget(subTitleLabel, 4, 2);
311 layout->addWidget(logoLabel, 1, 5, 5, 1);
314#if QT_CONFIG(style_windowsvista)
315bool QWizardHeader::vistaDisabled()
const
317 bool styleDisabled =
false;
318 QWizard *wiz = parentWidget() ? qobject_cast <QWizard *>(parentWidget()->parentWidget()) : 0;
322 const QVariant v = wiz->property(
"_q_wizard_vista_off");
323 styleDisabled = v.isValid() && v.toBool();
325 return styleDisabled;
330 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
331 Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat,
332 QWizard::BannerSizePolicy bannerSizePolicy)
334 bool modern = ((info.wizStyle == QWizard::ModernStyle)
335#if QT_CONFIG(style_windowsvista)
340 wizardBannerSizePolicy = bannerSizePolicy;
342 layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0);
343 layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0);
344 layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2);
349 layout->setColumnMinimumWidth(0, minColumnWidth0);
350 layout->setColumnMinimumWidth(1, minColumnWidth1);
352 titleLabel->setTextFormat(titleFormat);
353 titleLabel->setText(title);
354 logoLabel->setPixmap(logo);
356 subTitleLabel->setTextFormat(subTitleFormat);
357 subTitleLabel->setText(
"Pq\nPq"_L1);
358 int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
359 subTitleLabel->setText(subTitle);
362 bannerPixmap = banner;
364 bannerPixmap = QPixmap();
367 if (bannerPixmap.isNull() || wizardBannerSizePolicy != QWizard::BannerSizePolicy::NoStretch) {
369
370
371 int candidateSubTitleWidth = qMin(512, 2 * QGuiApplication::primaryScreen()->virtualGeometry().width() / 3);
372 int delta = candidateSubTitleWidth >> 1;
374 if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
375 <= desiredSubTitleHeight)
376 candidateSubTitleWidth -= delta;
380 subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight);
382 QSize size = layout->totalMinimumSize();
383 setMinimumSize(size);
384 setMaximumSize(QWIDGETSIZE_MAX, size.height());
386 subTitleLabel->setMinimumSize(0, 0);
387 setFixedSize(banner.size() + QSize(0, 2));
395 switch (wizardBannerSizePolicy) {
396 case QWizard::BannerSizePolicy::Stretch:
397 painter.setRenderHint(QPainter::SmoothPixmapTransform);
398 painter.drawPixmap(0, 0, width(), height(), bannerPixmap);
400 case QWizard::BannerSizePolicy::NoStretch:
401 painter.drawPixmap(0, 0, bannerPixmap);
406 int y = height() - 2;
407 const QPalette &pal = palette();
408 painter.setPen(pal.mid().color());
409 painter.drawLine(0, y, x, y);
410 painter.setPen(pal.base().color());
411 painter.drawPoint(x + 1, y);
412 painter.drawLine(0, y + 1, x + 1, y + 1);
427 m_layout =
new QVBoxLayout(
this);
429 m_layout->addWidget(m_sideWidget);
433 if (!pixmap().isNull())
434 return pixmap().deviceIndependentSize().toSize();
435 return QFrame::minimumSizeHint();
439 if (m_sideWidget == widget)
442 m_layout->removeWidget(m_sideWidget);
443 m_sideWidget->hide();
445 m_sideWidget = widget;
447 m_layout->addWidget(m_sideWidget);
453 QVBoxLayout *m_layout;
459 Q_DECLARE_PUBLIC(QWizardPage)
482 Q_Q(
const QWizardPage);
483 if (completeState == Tri_Unknown)
484 completeState = q->isComplete() ? Tri_True : Tri_False;
485 return completeState == Tri_True;
491 TriState newState = q->isComplete() ? Tri_True : Tri_False;
492 if (newState != completeState)
493 emit q->completeChanged();
499 completeState = q->isComplete() ? Tri_True : Tri_False;
505#if QT_CONFIG(style_windowsvista)
521 Q_DECLARE_PUBLIC(QWizard)
550#if QT_CONFIG(style_windowsvista)
598 mutable QAbstractButton *
btns[QWizard::NButtons];
615#if QT_CONFIG(style_windowsvista)
617# if QT_CONFIG(shortcut)
633#if !QT_CONFIG(style_windowsvista)
634 Q_UNUSED(wizardPrivate);
636 const bool macStyle = (wstyle == QWizard::MacStyle);
638 case QWizard::BackButton:
639 return macStyle ? QWizard::tr(
"Go Back") : QWizard::tr(
"< &Back");
640 case QWizard::NextButton:
642 return QWizard::tr(
"Continue");
645 ? QWizard::tr(
"&Next") : QWizard::tr(
"&Next >");
646 case QWizard::CommitButton:
647 return QWizard::tr(
"Commit");
648 case QWizard::FinishButton:
649 return macStyle ? QWizard::tr(
"Done") : QWizard::tr(
"&Finish");
650 case QWizard::CancelButton:
651 return QWizard::tr(
"Cancel");
652 case QWizard::HelpButton:
653 return macStyle ? QWizard::tr(
"Help") : QWizard::tr(
"&Help");
663 std::fill(btns, btns + QWizard::NButtons,
nullptr);
665 antiFlickerWidget =
new QWizardAntiFlickerWidget(q,
this);
666 wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle,
nullptr, q));
667 if (wizStyle == QWizard::MacStyle) {
668 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
669 }
else if (wizStyle == QWizard::ModernStyle) {
670 opts = QWizard::HelpButtonOnRight;
673#if QT_CONFIG(style_windowsvista)
674 vistaHelper =
new QVistaHelper(q);
678 ensureButton(QWizard::BackButton);
679 ensureButton(QWizard::NextButton);
680 ensureButton(QWizard::CommitButton);
681 ensureButton(QWizard::FinishButton);
683 pageFrame =
new QFrame(antiFlickerWidget);
684 pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
686 pageVBoxLayout =
new QVBoxLayout(pageFrame);
687 pageVBoxLayout->setSpacing(0);
688 pageVBoxLayout->addSpacing(0);
689 QSpacerItem *spacerItem =
new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
690 pageVBoxLayout->addItem(spacerItem);
692 buttonLayout =
new QHBoxLayout;
693 mainLayout =
new QGridLayout(antiFlickerWidget);
694 mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
698 defaultPropertyTable.reserve(NFallbackDefaultProperties);
699 for (uint i = 0; i < NFallbackDefaultProperties; ++i)
700 defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
701 fallbackProperties[i].property,
709 q->currentPage()->hide();
711 const auto end = history.crend();
712 for (
auto it = history.crbegin(); it != end; ++it)
715 for (QWizardPage *page : std::as_const(pageMap))
716 page->d_func()->initialized =
false;
719 emit q->currentIdChanged(-1);
727 for (
auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
728 const auto idx = it.key();
729 const auto page = it.value()->d_func();
730 if (page->initialized && !history.contains(idx)) {
732 page->initialized =
false;
742 myField.resolve(defaultPropertyTable);
744 if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
745 qWarning(
"QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
749 fieldIndexMap.insert(myField.name, fields.size());
751 if (myField.mandatory && !myField.changedSignal.isEmpty())
752 QObject::connect(myField.object, myField.changedSignal,
753 myField.page, SLOT(_q_maybeEmitCompleteChanged()));
755 myField.object, SIGNAL(destroyed(QObject*)), q,
756 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
764 fieldIndexMap.remove(field.name);
765 if (field.mandatory && !field.changedSignal.isEmpty())
766 QObject::disconnect(field.object, field.changedSignal,
767 field.page, SLOT(_q_maybeEmitCompleteChanged()));
769 field.object, SIGNAL(destroyed(QObject*)), q,
770 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
771 fields.remove(index);
781 if (QWizardPage *oldPage = q->currentPage()) {
785 if (!(opts & QWizard::IndependentPages)) {
786 q->cleanupPage(oldId);
787 oldPage->d_func()->initialized =
false;
789 Q_ASSERT(history.constLast() == oldId);
790 history.removeLast();
791 Q_ASSERT(history.constLast() == newId);
797 QWizardPage *newPage = q->currentPage();
800 if (!newPage->d_func()->initialized) {
801 newPage->d_func()->initialized =
true;
802 q->initializePage(current);
804 history.append(current);
809 canContinue = (q->nextId() != -1);
810 canFinish = (newPage && newPage->isFinalPage());
815 const QWizard::WizardButton nextOrCommit =
816 newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
817 QAbstractButton *nextOrFinishButton =
818 btns[canContinue ? nextOrCommit : QWizard::FinishButton];
822
823
824
825
826
827
828
829
830 if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
831 candidate = nextOrFinishButton;
832 }
else if (newPage) {
833 candidate = iWantTheFocus(newPage);
836 candidate = nextOrFinishButton;
837 candidate->setFocus();
839 if (wizStyle == QWizard::MacStyle)
846 emit q->currentIdChanged(current);
853 case QWizard::BackButton:
855 case QWizard::NextButton:
856 case QWizard::CommitButton:
858 case QWizard::FinishButton:
859 return SLOT(accept());
860 case QWizard::CancelButton:
861 return SLOT(reject());
862 case QWizard::HelpButton:
863 return SIGNAL(helpRequested());
864 case QWizard::CustomButton1:
865 case QWizard::CustomButton2:
866 case QWizard::CustomButton3:
867 case QWizard::Stretch:
868 case QWizard::NoButton:
877 QStyle *style = q->style();
883 const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option, q);
884 info.topLevelMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, q);
885 info.topLevelMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, q);
886 info.topLevelMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, q);
887 info.topLevelMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, q);
888 info.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, titleLabel);
889 info.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, titleLabel);
890 info.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, titleLabel);
891 info.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, titleLabel);
892 info.hspacing = (layoutHorizontalSpacing == -1)
893 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
894 : layoutHorizontalSpacing;
895 info.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option, q);
896 info.buttonSpacing = (layoutHorizontalSpacing == -1)
897 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)
898 : layoutHorizontalSpacing;
900 if (wizStyle == QWizard::MacStyle)
903 info.wizStyle = wizStyle;
904 if (info.wizStyle == QWizard::AeroStyle
905#if QT_CONFIG(style_windowsvista)
909 info.wizStyle = QWizard::ModernStyle;
912 QString subTitleText;
913 QPixmap backgroundPixmap;
914 QPixmap watermarkPixmap;
916 if (QWizardPage *page = q->currentPage()) {
917 titleText = page->title();
918 subTitleText = page->subTitle();
919 backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
920 watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
923 info.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
924 && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
926 info.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
927 && !watermarkPixmap.isNull();
929 info.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
930 info.extension = (info.watermark || info.sideWidget) && (opts & QWizard::ExtendedWatermarkPixmap);
940
941
942 for (
int i = mainLayout->count() - 1; i >= 0; --i) {
943 QLayoutItem *item = mainLayout->takeAt(i);
944 if (item->layout()) {
945 item->layout()->setParent(
nullptr);
950 for (
int i = mainLayout->columnCount() - 1; i >= 0; --i)
951 mainLayout->setColumnMinimumWidth(i, 0);
952 for (
int i = mainLayout->rowCount() - 1; i >= 0; --i)
953 mainLayout->setRowMinimumHeight(i, 0);
956
957
959 bool mac = (info.wizStyle == QWizard::MacStyle);
960 bool classic = (info.wizStyle == QWizard::ClassicStyle);
961 bool modern = (info.wizStyle == QWizard::ModernStyle);
962 bool aero = (info.wizStyle == QWizard::AeroStyle);
978 int pageColumn = qMin(1, numColumns - 1);
981 mainLayout->setContentsMargins(QMargins());
982 mainLayout->setSpacing(0);
983 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);
984 pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
987 mainLayout->setContentsMargins(QMargins());
988 mainLayout->setSpacing(0);
989 pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
990 deltaMarginRight, deltaMarginBottom);
991 buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
992 info.topLevelMarginRight, info.topLevelMarginBottom);
994 mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
995 info.topLevelMarginRight, info.topLevelMarginBottom);
996 mainLayout->setHorizontalSpacing(info.hspacing);
997 mainLayout->setVerticalSpacing(info.vspacing);
998 pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
999 buttonLayout->setContentsMargins(0, 0, 0, 0);
1002 buttonLayout->setSpacing(info.buttonSpacing);
1006 headerWidget =
new QWizardHeader(antiFlickerWidget);
1008 mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
1013 int watermarkStartRow = row;
1016 mainLayout->setRowMinimumHeight(row++, 10);
1020 titleLabel =
new QLabel(antiFlickerWidget);
1021 titleLabel->setBackgroundRole(QPalette::Base);
1022 titleLabel->setWordWrap(
true);
1025 QFont titleFont = q->font();
1026 titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4));
1027 titleFont.setBold(
true);
1028 titleLabel->setPalette(QPalette());
1032 titleFont = QFont(
"Segoe UI"_L1, 12);
1033 QPalette pal(titleLabel->palette());
1034 pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1035 titleLabel->setPalette(pal);
1038 titleLabel->setFont(titleFont);
1039 const int aeroTitleIndent = 25;
1041 titleLabel->setIndent(aeroTitleIndent);
1043 titleLabel->setIndent(2);
1045 titleLabel->setIndent(info.childMarginLeft);
1047 titleLabel->setIndent(info.topLevelMarginLeft);
1050 placeholderWidget1 =
new QWidget(antiFlickerWidget);
1051 placeholderWidget1->setBackgroundRole(QPalette::Base);
1054 mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1056 mainLayout->addWidget(titleLabel, row++, pageColumn);
1059 placeholderWidget2 =
new QWidget(antiFlickerWidget);
1060 placeholderWidget2->setBackgroundRole(QPalette::Base);
1063 mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1066 mainLayout->setRowMinimumHeight(row++, 7);
1074 if (!subTitleLabel) {
1075 subTitleLabel =
new QLabel(pageFrame);
1076 subTitleLabel->setWordWrap(
true);
1078 subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1079 info.childMarginRight , 0);
1081 pageVBoxLayout->insertWidget(1, subTitleLabel);
1086 changeSpacerSize(pageVBoxLayout, 0, 0, info.subTitle ? info.childMarginLeft : 0);
1088 int hMargin = mac ? 1 : 0;
1089 int vMargin = hMargin;
1091 pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame);
1092 pageFrame->setLineWidth(0);
1093 pageFrame->setMidLineWidth(hMargin);
1098 vMargin = deltaMarginBottom;
1099 }
else if (classic) {
1106 int leftMargin = 18;
1107 int topMargin = vMargin;
1108 int rightMargin = hMargin;
1109 int bottomMargin = vMargin;
1110 pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1112 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1116 watermarkLabel =
new QWatermarkLabel(antiFlickerWidget, sideWidget);
1117 watermarkLabel->setBackgroundRole(QPalette::Base);
1119 watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
1120 watermarkLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
1124 const bool wasSemiTransparent =
1125 pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
1126 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1128 pageFrame->setAutoFillBackground(
true);
1131 if (wasSemiTransparent)
1132 pageFrame->setPalette(QPalette());
1134 bool baseBackground = (modern && !info
.header);
1135 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);
1138 titleLabel->setAutoFillBackground(baseBackground);
1139 pageFrame->setAutoFillBackground(baseBackground);
1148 QPalette pal = pageFrame->palette();
1149 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1150 pageFrame->setPalette(pal);
1151 pageFrame->setAutoFillBackground(
true);
1153 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1159 mainLayout->addWidget(pageFrame, row++, pageColumn);
1161 int watermarkEndRow = row;
1163 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1166 buttonLayout->setContentsMargins(9, 9, 9, 9);
1167 mainLayout->setContentsMargins(0, 11, 0, 0);
1170 int buttonStartColumn = info
.extension ? 1 : 0;
1171 int buttonNumColumns = info
.extension ? 1 : numColumns;
1173 if (classic || modern) {
1175 bottomRuler =
new QWizardRuler(antiFlickerWidget);
1176 mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1180 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1182 mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1186 watermarkEndRow = row;
1187 mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1188 watermarkEndRow - watermarkStartRow, 1);
1191 mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1193 mainLayout->setColumnMinimumWidth(2, 21);
1198 titleLabel->setVisible(info.title);
1200 subTitleLabel->setVisible(info.subTitle);
1216 if (layoutInfo != info)
1218 QWizardPage *page = q->currentPage();
1226 bool expandPage = !page->layout();
1228 const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page));
1229 expandPage = pageItem->expandingDirections() & Qt::Vertical;
1231 QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1232 Q_ASSERT(bottomSpacer);
1233 bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding);
1234 pageVBoxLayout->invalidate();
1239 headerWidget->setup(info, page->title(), page->subTitle(),
1240 page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap),
1241 titleFmt, subTitleFmt, bannerSizePolicy);
1248 pix = page->pixmap(QWizard::WatermarkPixmap);
1250 pix = q->pixmap(QWizard::WatermarkPixmap);
1257 titleLabel->setTextFormat(titleFmt);
1258 titleLabel->setText(page->title());
1262 subTitleLabel->setTextFormat(subTitleFmt);
1263 subTitleLabel->setText(page->subTitle());
1271 if (wizStyle == QWizard::MacStyle) {
1280 QPalette newPalette = QApplication::palette(pageFrame);
1282 QColor windowColor = newPalette.brush(QPalette::Window).color();
1283 windowColor.setAlpha(153);
1284 newPalette.setBrush(QPalette::Window, windowColor);
1286 QColor baseColor = newPalette.brush(QPalette::Base).color();
1287 baseColor.setAlpha(153);
1288 newPalette.setBrush(QPalette::Base, baseColor);
1290 pageFrame->setPalette(newPalette);
1298 int extraHeight = 0;
1299#if QT_CONFIG(style_windowsvista)
1300 if (isVistaThemeEnabled())
1301 extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1303 QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1304 QSize maximumSize = mainLayout->totalMaximumSize();
1305 if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1310 minimumSize.setHeight(mainLayout->totalSizeHint().height());
1312 if (q->minimumWidth() == minimumWidth) {
1314 q->setMinimumWidth(minimumWidth);
1316 if (q->minimumHeight() == minimumHeight) {
1318 q->setMinimumHeight(minimumHeight);
1320 if (q->maximumWidth() == maximumWidth) {
1321 maximumWidth = maximumSize.width();
1322 q->setMaximumWidth(maximumWidth);
1324 if (q->maximumHeight() == maximumHeight) {
1325 maximumHeight = maximumSize.height();
1326 q->setMaximumHeight(maximumHeight);
1333 if (q->currentPage()) {
1334 canContinue = (q->nextId() != -1);
1335 canFinish = q->currentPage()->isFinalPage();
1347 case QWizard::CommitButton:
1348 return u"qt_wizard_commit"_s;
1349 case QWizard::FinishButton:
1350 return u"qt_wizard_finish"_s;
1351 case QWizard::CancelButton:
1352 return u"qt_wizard_cancel"_s;
1353 case QWizard::BackButton:
1354 case QWizard::NextButton:
1355 case QWizard::HelpButton:
1356 case QWizard::CustomButton1:
1357 case QWizard::CustomButton2:
1358 case QWizard::CustomButton3:
1360 return "__qt__passive_wizardbutton"_L1 + QString::number(which);
1361 case QWizard::Stretch:
1362 case QWizard::NoButton:
1367 Q_UNREACHABLE_RETURN(QString());
1373 if (uint(which) >= QWizard::NButtons)
1377 QPushButton *pushButton =
new QPushButton(antiFlickerWidget);
1378 QStyle *style = q->style();
1379 if (style != QApplication::style())
1380 pushButton->setStyle(style);
1381 pushButton->setObjectName(object_name_for_button(which));
1383 pushButton->setAutoDefault(
false);
1387 const_cast<QWizardPrivate *>(
this)->btns[which] = pushButton;
1389 btns[which] = pushButton;
1391 if (which < QWizard::NStandardButtons)
1392 pushButton->setText(buttonDefaultText(wizStyle, which,
this));
1394 connectButton(which);
1402 if (which < QWizard::NStandardButtons) {
1403 QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1405 QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1412 for (
int i = 0; i < QWizard::NButtons; ++i) {
1414 if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1415 btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1416 else if (buttonCustomTexts.contains(i))
1417 btns[i]->setText(buttonCustomTexts.value(i));
1418 else if (i < QWizard::NStandardButtons)
1419 btns[i]->setText(buttonDefaultText(wizStyle, i,
this));
1425#if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1426 if (btns[QWizard::NextButton] && isVistaThemeEnabled()) {
1427 if (vistaNextShortcut.isNull()) {
1429 new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right),
1430 btns[QWizard::NextButton], SLOT(animateClick()));
1433 delete vistaNextShortcut;
1441 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array{
1442 buttonsCustomLayout.cbegin(), buttonsCustomLayout.cend()};
1443 setButtonLayout(array.constData(),
int(array.size()));
1448 const int ArraySize = 12;
1449 QWizard::WizardButton array[ArraySize];
1450 memset(array, -1,
sizeof(array));
1451 Q_ASSERT(array[0] == QWizard::NoButton);
1453 if (opts & QWizard::HaveHelpButton) {
1454 int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1455 array[i] = QWizard::HelpButton;
1457 array[1] = QWizard::Stretch;
1458 if (opts & QWizard::HaveCustomButton1)
1459 array[2] = QWizard::CustomButton1;
1460 if (opts & QWizard::HaveCustomButton2)
1461 array[3] = QWizard::CustomButton2;
1462 if (opts & QWizard::HaveCustomButton3)
1463 array[4] = QWizard::CustomButton3;
1465 if (!(opts & QWizard::NoCancelButton)) {
1466 int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1467 array[i] = QWizard::CancelButton;
1469 array[6] = QWizard::BackButton;
1470 array[7] = QWizard::NextButton;
1471 array[8] = QWizard::CommitButton;
1472 array[9] = QWizard::FinishButton;
1474 setButtonLayout(array, ArraySize);
1482 for (
int i = buttonLayout->count() - 1; i >= 0; --i) {
1483 QLayoutItem *item = buttonLayout->takeAt(i);
1484 if (
QWidget *widget = item->widget())
1489 for (
int i = 0; i < size; ++i) {
1490 QWizard::WizardButton which = array[i];
1491 if (which == QWizard::Stretch) {
1492 buttonLayout->addStretch(1);
1493 }
else if (which != QWizard::NoButton) {
1494 ensureButton(which);
1495 buttonLayout->addWidget(btns[which]);
1498 if (which != QWizard::BackButton && which != QWizard::NextButton
1499 && which != QWizard::CommitButton && which != QWizard::FinishButton)
1500 btns[which]->show();
1503 QWidget::setTabOrder(prev, btns[which]);
1513 return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
1519 if (which == QWizard::BackgroundPixmap) {
1520 if (wizStyle == QWizard::MacStyle) {
1522 q->updateGeometry();
1529#if QT_CONFIG(style_windowsvista)
1530bool QWizardPrivate::vistaDisabled()
const
1533 const QVariant v = q->property(
"_q_wizard_vista_off");
1534 return v.isValid() && v.toBool();
1537bool QWizardPrivate::handleAeroStyleChange()
1541 if (inHandleAeroStyleChange)
1547 const bool isWindow = q->isWindow();
1548 if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1550 inHandleAeroStyleChange =
true;
1552 vistaHelper->disconnectBackButton();
1553 q->removeEventFilter(vistaHelper);
1555 bool vistaMargins =
false;
1557 if (isVistaThemeEnabled()) {
1558 const int topOffset = vistaHelper->topOffset(q);
1559 const int topPadding = vistaHelper->topPadding(q);
1561 vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1562 q->installEventFilter(vistaHelper);
1564 q->setMouseTracking(
true);
1565 antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1566 vistaHelper->backButton()->move(
1568 - qMin(topOffset, topPadding + 1));
1569 vistaMargins =
true;
1570 vistaHelper->backButton()->show();
1572 vistaHelper->setTitleBarIconAndCaptionVisible(
false);
1574 vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1575 vistaHelper->backButton()->show();
1577 q->setMouseTracking(
true);
1581 antiFlickerWidget->move(0, 0);
1582 vistaHelper->hideBackButton();
1584 vistaHelper->setTitleBarIconAndCaptionVisible(
true);
1587 _q_updateButtonStates();
1589 vistaHelper->updateCustomMargins(vistaMargins);
1591 inHandleAeroStyleChange =
false;
1598#if QT_CONFIG(style_windowsvista)
1599 return wizStyle == QWizard::AeroStyle && !vistaDisabled();
1609 q->setUpdatesEnabled(
false);
1619 q->setUpdatesEnabled(
true);
1626 QObject *button = q->sender();
1627 for (
int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1628 if (btns[i] == button) {
1629 emit q->customButtonClicked(QWizard::WizardButton(i));
1641 const QWizardPage *page = q->currentPage();
1642 bool complete = page && page->isComplete();
1644 btn.back->setEnabled(history.size() > 1
1645 && !q->page(history.at(history.size() - 2))->isCommitPage()
1646 && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage)));
1647 btn.next->setEnabled(canContinue && complete);
1648 btn.commit->setEnabled(canContinue && complete);
1649 btn.finish->setEnabled(canFinish && complete);
1651 const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1652 && (history.size() > 1 || !(opts & QWizard::NoBackButtonOnStartPage))
1653 && (canContinue || !(opts & QWizard::NoBackButtonOnLastPage));
1654 bool commitPage = page && page->isCommitPage();
1655 btn.back->setVisible(backButtonVisible);
1656 btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1657 && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage)));
1658 btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1660 btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1661 && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
1663 if (!(opts & QWizard::NoCancelButton))
1664 btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1665 && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
1667 bool useDefault = !(opts & QWizard::NoDefaultButton);
1668 if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1669 nextPush->setDefault(canContinue && useDefault && !commitPage);
1670 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1671 commitPush->setDefault(canContinue && useDefault && commitPage);
1672 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1673 finishPush->setDefault(!canContinue && useDefault);
1675#if QT_CONFIG(style_windowsvista)
1676 if (isVistaThemeEnabled()) {
1677 vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1678 vistaHelper->backButton()->setVisible(backButtonVisible);
1679 btn.back->setVisible(
false);
1688 int destroyed_index = -1;
1689 QList<QWizardField>::iterator it = fields.begin();
1690 while (it != fields.end()) {
1692 if (field.object == object) {
1693 destroyed_index = fieldIndexMap.value(field.name, -1);
1694 fieldIndexMap.remove(field.name);
1695 it = fields.erase(it);
1700 if (destroyed_index != -1) {
1701 QMap<QString,
int>::iterator it2 = fieldIndexMap.begin();
1702 while (it2 != fieldIndexMap.end()) {
1703 int index = it2.value();
1704 if (index > destroyed_index) {
1705 QString field_name = it2.key();
1706 fieldIndexMap.insert(field_name, index-1);
1715 for (
int i = 0; i < QWizard::NButtons; i++)
1717 btns[i]->setStyle(style);
1718 const PageMap::const_iterator pcend = pageMap.constEnd();
1719 for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1720 it.value()->setStyle(style);
1724QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1726 auto *keyboardAssistantURL = [NSWorkspace.sharedWorkspace
1727 URLForApplicationWithBundleIdentifier:@
"com.apple.KeyboardSetupAssistant"];
1728 auto *keyboardAssistantBundle = [NSBundle bundleWithURL:keyboardAssistantURL];
1729 auto *assistantBackground = [keyboardAssistantBundle imageForResource:@
"Background"];
1730 auto size = QSizeF::fromCGSize(assistantBackground.size);
1731 static const QSizeF expectedSize(242, 414);
1732 if (size == expectedSize)
1733 return qt_mac_toQPixmap(assistantBackground, size);
1739#if QT_CONFIG(style_windowsvista)
1740void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
1742 if (wizardPrivate->isVistaThemeEnabled()) {
1743 int leftMargin, topMargin, rightMargin, bottomMargin;
1744 wizardPrivate->buttonLayout->getContentsMargins(
1745 &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1746 const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1747 QPainter painter(
this);
1748 const QBrush brush(QColor(240, 240, 240));
1749 painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1750 painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0));
1751 painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2100
2101
2102
2103
2104
2105
2106
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2142
2143
2144
2145
2146QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
2147 : QDialog(*
new QWizardPrivate, parent, flags)
2154
2155
2159 delete d->buttonLayout;
2163
2164
2165
2166
2167
2168
2169
2170int QWizard::addPage(QWizardPage *page)
2174 if (!d->pageMap.isEmpty())
2175 theid = d->pageMap.lastKey() + 1;
2176 setPage(theid, page);
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190void QWizard::setPage(
int theid, QWizardPage *page)
2194 if (Q_UNLIKELY(!page)) {
2195 qWarning(
"QWizard::setPage: Cannot insert null page");
2199 if (Q_UNLIKELY(theid == -1)) {
2200 qWarning(
"QWizard::setPage: Cannot insert page with ID -1");
2204 if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2205 qWarning(
"QWizard::setPage: Page with duplicate ID %d ignored", theid);
2209 page->setParent(d->pageFrame);
2211 QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2212 for (
const auto &field : std::as_const(pendingFields))
2214 pendingFields.clear();
2216 connect(page, SIGNAL(completeChanged()),
this, SLOT(_q_updateButtonStates()));
2218 d->pageMap.insert(theid, page);
2219 page->d_func()->wizard =
this;
2221 int n = d->pageVBoxLayout->count();
2224 bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2225 d->pageVBoxLayout->setEnabled(
false);
2227 d->pageVBoxLayout->insertWidget(n - 1, page);
2231 d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2233 if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2235 emit pageAdded(theid);
2239
2240
2241
2242
2243
2244
2245void QWizard::removePage(
int id)
2249 QWizardPage *removedPage =
nullptr;
2252 if (d->pageMap.size() > 0) {
2253 if (d->start == id) {
2254 const int firstId = d->pageMap.constBegin().key();
2255 if (firstId == id) {
2256 if (d->pageMap.size() > 1)
2257 d->start = (++d->pageMap.constBegin()).key();
2263 d->startSetByUser =
false;
2267 if (d->pageMap.contains(id))
2268 emit pageRemoved(id);
2270 if (!d->history.contains(id)) {
2272 removedPage = d->pageMap.take(id);
2273 d->updateCurrentPage();
2274 }
else if (id != d->current) {
2276 removedPage = d->pageMap.take(id);
2277 d->history.removeOne(id);
2278 d->_q_updateButtonStates();
2279 }
else if (d->history.size() == 1) {
2282 removedPage = d->pageMap.take(id);
2283 if (d->pageMap.isEmpty())
2284 d->updateCurrentPage();
2290 removedPage = d->pageMap.take(id);
2291 d->updateCurrentPage();
2295 if (removedPage->d_func()->initialized) {
2297 removedPage->d_func()->initialized =
false;
2300 d->pageVBoxLayout->removeWidget(removedPage);
2302 for (
int i = d->fields.size() - 1; i >= 0; --i) {
2303 if (d->fields.at(i).page == removedPage) {
2304 removedPage->d_func()->pendingFields += d->fields.at(i);
2305 d->removeFieldAt(i);
2312
2313
2314
2315
2316
2317
2318
2319QWizardPage *QWizard::page(
int theid)
const
2322 return d->pageMap.value(theid);
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335bool QWizard::hasVisitedPage(
int theid)
const
2338 return d->history.contains(theid);
2342
2343
2344
2345
2346
2347
2348
2349QList<
int> QWizard::visitedIds()
const
2356
2357
2358QList<
int> QWizard::pageIds()
const
2361 return d->pageMap.keys();
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374void QWizard::setStartId(
int theid)
2377 int newStart = theid;
2379 newStart = d->pageMap.size() ? d->pageMap.constBegin().key() : -1;
2381 if (d->start == newStart) {
2382 d->startSetByUser = theid != -1;
2386 if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2387 qWarning(
"QWizard::setStartId: Invalid page ID %d", newStart);
2390 d->start = newStart;
2391 d->startSetByUser = theid != -1;
2394int QWizard::startId()
const
2401
2402
2403
2404
2405
2406
2407
2408QWizardPage *QWizard::currentPage()
const
2411 return page(d->current);
2415
2416
2417
2418
2419
2420
2421
2422
2423int QWizard::currentId()
const
2430
2431
2432
2433
2434
2435
2436void QWizard::setField(
const QString &name,
const QVariant &value)
2440 int index = d->fieldIndexMap.value(name, -1);
2441 if (Q_UNLIKELY(index == -1)) {
2442 qWarning(
"QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2446 const QWizardField &field = d->fields.at(index);
2447 if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2448 qWarning(
"QWizard::setField: Couldn't write to property '%s'",
2449 field.property.constData());
2453
2454
2455
2456
2457
2458
2459QVariant QWizard::field(
const QString &name)
const
2463 int index = d->fieldIndexMap.value(name, -1);
2464 if (Q_UNLIKELY(index == -1)) {
2465 qWarning(
"QWizard::field: No such field '%ls'", qUtf16Printable(name));
2469 const QWizardField &field = d->fields.at(index);
2470 return field.object->property(field.property);
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485void QWizard::setWizardStyle(WizardStyle style)
2489 const bool styleChange = style != d->wizStyle;
2491#if QT_CONFIG(style_windowsvista)
2492 const bool aeroStyleChange =
2493 d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2494 d->vistaStateChanged =
false;
2495 d->vistaInitPending =
false;
2499#if QT_CONFIG(style_windowsvista)
2503 d->disableUpdates();
2504 d->wizStyle = style;
2505 d->updateButtonTexts();
2506#if QT_CONFIG(style_windowsvista)
2507 if (aeroStyleChange) {
2510 QResizeEvent ev(geometry().size(), geometry().size());
2511 QCoreApplication::sendEvent(
this, &ev);
2517#if QT_CONFIG(style_windowsvista)
2519 if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2520 d->vistaInitPending =
true;
2525QWizard::WizardStyle QWizard::wizardStyle()
const
2532
2533
2534
2535
2536
2537void QWizard::setOption(WizardOption option,
bool on)
2540 if (!(d->opts & option) != !on)
2541 setOptions(d->opts ^ option);
2545
2546
2547
2548
2549
2550bool QWizard::testOption(WizardOption option)
const
2553 return (d->opts & option) != 0;
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570void QWizard::setOptions(WizardOptions options)
2574 WizardOptions changed = (options ^ d->opts);
2578 d->disableUpdates();
2581 if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2582 d->cleanupPagesNotInHistory();
2584 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
2585 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
2586 | HaveCustomButton3)) {
2587 d->updateButtonLayout();
2588 }
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2589 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
2590 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
2591 d->_q_updateButtonStates();
2598QWizard::WizardOptions QWizard::options()
const
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621void QWizard::setButtonText(WizardButton which,
const QString &text)
2625 if (!d->ensureButton(which))
2628 d->buttonCustomTexts.insert(which, text);
2630 if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2631 d->btns[which]->setText(text);
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646QString QWizard::buttonText(WizardButton which)
const
2650 if (!d->ensureButton(which))
2653 if (d->buttonCustomTexts.contains(which))
2654 return d->buttonCustomTexts.value(which);
2656 const QString defText = buttonDefaultText(d->wizStyle, which, d);
2657 if (!defText.isNull())
2660 return d->btns[which]->text();
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681void QWizard::setButtonLayout(
const QList<WizardButton> &layout)
2685 for (
int i = 0; i < layout.size(); ++i) {
2686 WizardButton button1 = layout.at(i);
2688 if (button1 == NoButton || button1 == Stretch)
2690 if (!d->ensureButton(button1))
2694 for (
int j = 0; j < i; ++j) {
2695 WizardButton button2 = layout.at(j);
2696 if (Q_UNLIKELY(button2 == button1)) {
2697 qWarning(
"QWizard::setButtonLayout: Duplicate button in layout");
2703 d->buttonsHaveCustomLayout =
true;
2704 d->buttonsCustomLayout = layout;
2705 d->updateButtonLayout();
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718void QWizard::setButton(WizardButton which, QAbstractButton *button)
2722 if (uint(which) >= NButtons || d->btns[which] == button)
2725 if (QAbstractButton *oldButton = d->btns[which]) {
2726 d->buttonLayout->removeWidget(oldButton);
2730 d->btns[which] = button;
2732 button->setParent(d->antiFlickerWidget);
2733 d->buttonCustomTexts.insert(which, button->text());
2734 d->connectButton(which);
2736 d->buttonCustomTexts.remove(which);
2737 d->ensureButton(which);
2740 d->updateButtonLayout();
2744
2745
2746
2747
2748QAbstractButton *QWizard::button(WizardButton which)
const
2751#if QT_CONFIG(style_windowsvista)
2752 if (d->wizStyle == AeroStyle && which == BackButton)
2753 return d->vistaHelper->backButton();
2755 if (!d->ensureButton(which))
2757 return d->btns[which];
2761
2762
2763
2764
2765
2766
2767
2768void QWizard::setTitleFormat(Qt::TextFormat format)
2771 d->titleFmt = format;
2775Qt::TextFormat QWizard::titleFormat()
const
2782
2783
2784
2785
2786
2787
2788
2789void QWizard::setSubTitleFormat(Qt::TextFormat format)
2792 d->subTitleFmt = format;
2796Qt::TextFormat QWizard::subTitleFormat()
const
2799 return d->subTitleFmt;
2803
2804
2805
2806
2807
2808void QWizard::setBannerSizePolicy(QWizard::BannerSizePolicy bannerSizePolicy)
2811 if (d->bannerSizePolicy == bannerSizePolicy)
2814 d->bannerSizePolicy = bannerSizePolicy;
2818QWizard::BannerSizePolicy QWizard::bannerSizePolicy()
const
2821 return d->bannerSizePolicy;
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836void QWizard::setPixmap(WizardPixmap which,
const QPixmap &pixmap)
2839 Q_ASSERT(uint(which) < NPixmaps);
2840 d->defaultPixmaps[which] = pixmap;
2841 d->updatePixmap(which);
2845
2846
2847
2848
2849
2850
2851
2852QPixmap QWizard::pixmap(WizardPixmap which)
const
2855 Q_ASSERT(uint(which) < NPixmaps);
2857 if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2858 d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2860 return d->defaultPixmaps[which];
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888void QWizard::setDefaultProperty(
const char *className,
const char *property,
2889 const char *changedSignal)
2892 for (
int i = d->defaultPropertyTable.size() - 1; i >= 0; --i) {
2893 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2894 d->defaultPropertyTable.remove(i);
2898 d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923void QWizard::setSideWidget(QWidget *widget)
2927 d->sideWidget = widget;
2928 if (d->watermarkLabel) {
2929 d->watermarkLabel->setSideWidget(widget);
2935
2936
2937
2938
2939QWidget *QWizard::sideWidget()
const
2943 return d->sideWidget;
2947
2948
2949void QWizard::setVisible(
bool visible)
2953 if (d->current == -1)
2956 QDialog::setVisible(visible);
2960
2961
2962QSize QWizard::sizeHint()
const
2965 QSize result = d->mainLayout->totalSizeHint();
2966 QSize extra(500, 360);
2967 if (d->wizStyle == MacStyle && d->current != -1) {
2968 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());
2969 extra.setWidth(616);
2970 if (!pixmap.isNull()) {
2971 extra.setHeight(pixmap.height());
2974
2975
2976
2977
2978
2979 if (pixmap.width() >= pixmap.height())
2980 extra.setWidth(pixmap.width());
2983 return result.expandedTo(extra);
2987
2988
2989
2990
2991
2992
2993
2996
2997
2998
2999
3000
3001
3002
3005
3006
3007
3008
3009
3010
3011
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3055
3056
3057
3058
3059
3060
3064 int n = d->history.size() - 2;
3067 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3071
3072
3073
3074
3075
3076
3081 if (d->current == -1)
3084 if (validateCurrentPage()) {
3085 int next = nextId();
3087 if (Q_UNLIKELY(d->history.contains(next))) {
3088 qWarning(
"QWizard::next: Page %d already met", next);
3091 if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3092 qWarning(
"QWizard::next: No such page %d", next);
3095 d->switchToPage(next, QWizardPrivate::Forward);
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3115void QWizard::setCurrentId(
int id)
3119 if (d->current == -1)
3122 if (currentId() == id)
3125 if (!validateCurrentPage())
3128 if (id < 0 || Q_UNLIKELY(!d->pageMap.contains(id))) {
3129 qWarning(
"QWizard::setCurrentId: No such page: %d", id);
3133 d->switchToPage(id, (id < currentId()) ? QWizardPrivate::Backward : QWizardPrivate::Forward);
3137
3138
3139
3140
3141
3142void QWizard::restart()
3145 d->disableUpdates();
3147 d->switchToPage(startId(), QWizardPrivate::Forward);
3152
3153
3154bool QWizard::event(QEvent *event)
3157 if (event->type() == QEvent::StyleChange) {
3158 d->setStyle(style());
3160 }
else if (event->type() == QEvent::PaletteChange) {
3163#if QT_CONFIG(style_windowsvista)
3164 else if (event->type() == QEvent::Show && d->vistaInitPending) {
3165 d->vistaInitPending =
false;
3166 d->wizStyle = AeroStyle;
3167 d->handleAeroStyleChange();
3169 else if (d->isVistaThemeEnabled()) {
3170 if (event->type() == QEvent::Resize
3171 || event->type() == QEvent::LayoutDirectionChange) {
3172 const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3173 ? width() - d->vistaHelper->backButton()->sizeHint().width()
3176 d->vistaHelper->backButton()->move(buttonLeft,
3177 d->vistaHelper->backButton()->y());
3180 d->vistaHelper->mouseEvent(event);
3183 return QDialog::event(event);
3187
3188
3189void QWizard::resizeEvent(QResizeEvent *event)
3192 int heightOffset = 0;
3193#if QT_CONFIG(style_windowsvista)
3194 if (d->isVistaThemeEnabled()) {
3195 heightOffset = d->vistaHelper->topOffset(
this);
3196 heightOffset += d->vistaHelper->titleBarSize();
3199 d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3200#if QT_CONFIG(style_windowsvista)
3201 if (d->isVistaThemeEnabled())
3202 d->vistaHelper->resizeEvent(event);
3204 QDialog::resizeEvent(event);
3208
3209
3210void QWizard::paintEvent(QPaintEvent * event)
3213 if (d->wizStyle == MacStyle && currentPage()) {
3214 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3215 if (backgroundPixmap.isNull())
3218 QStylePainter painter(
this);
3219 painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3221#if QT_CONFIG(style_windowsvista)
3222 else if (d->isVistaThemeEnabled()) {
3223 d->vistaHelper->paintEvent(event);
3230#if defined(Q_OS_WIN) || defined(Q_QDOC)
3232
3233
3234bool QWizard::nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result)
3236#if QT_CONFIG(style_windowsvista)
3238 if (d->isVistaThemeEnabled() && eventType ==
"windows_generic_MSG") {
3239 MSG *windowsMessage =
static_cast<MSG *>(message);
3240 const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3241 if (d->vistaDirty) {
3244 if (windowsMessage->message == WM_GETICON) {
3245 d->vistaStateChanged =
true;
3246 d->vistaDirty =
false;
3247 setWizardStyle(AeroStyle);
3250 return winEventResult;
3252 return QDialog::nativeEvent(eventType, message, result);
3255 return QDialog::nativeEvent(eventType, message, result);
3261
3262
3263void QWizard::done(
int result)
3267 if (result == Rejected) {
3270 if (!validateCurrentPage())
3273 QDialog::done(result);
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294void QWizard::initializePage(
int theid)
3296 QWizardPage *page =
this->page(theid);
3298 page->initializePage();
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312void QWizard::cleanupPage(
int theid)
3314 QWizardPage *page =
this->page(theid);
3316 page->cleanupPage();
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335bool QWizard::validateCurrentPage()
3337 QWizardPage *page = currentPage();
3341 return page->validatePage();
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358int QWizard::nextId()
const
3360 const QWizardPage *page = currentPage();
3364 return page->nextId();
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3435
3436
3437
3438
3439
3440
3441
3442
3443QWizardPage::QWizardPage(QWidget *parent)
3444 : QWidget(*
new QWizardPagePrivate, parent, { })
3446 connect(
this, SIGNAL(completeChanged()),
this, SLOT(_q_updateCachedCompleteState()));
3450
3451
3452QWizardPage::~QWizardPage()
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470void QWizardPage::setTitle(
const QString &title)
3474 if (d->wizard && d->wizard->currentPage() ==
this)
3475 d->wizard->d_func()->updateLayout();
3478QString QWizardPage::title()
const
3480 Q_D(
const QWizardPage);
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503void QWizardPage::setSubTitle(
const QString &subTitle)
3506 d->subTitle = subTitle;
3507 if (d->wizard && d->wizard->currentPage() ==
this)
3508 d->wizard->d_func()->updateLayout();
3511QString QWizardPage::subTitle()
const
3513 Q_D(
const QWizardPage);
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530void QWizardPage::setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap)
3533 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3534 d->pixmaps[which] = pixmap;
3535 if (d->wizard && d->wizard->currentPage() ==
this)
3536 d->wizard->d_func()->updatePixmap(which);
3540
3541
3542
3543
3544
3545
3546
3547
3548QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which)
const
3550 Q_D(
const QWizardPage);
3551 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3553 const QPixmap &pixmap = d->pixmaps[which];
3554 if (!pixmap.isNull())
3558 return wizard()->pixmap(which);
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580void QWizardPage::initializePage()
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595void QWizardPage::cleanupPage()
3599 const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3600 for (
const auto &field : fields) {
3601 if (field.page ==
this)
3602 field.object->setProperty(field.property, field.initialValue);
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621bool QWizardPage::validatePage()
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643bool QWizardPage::isComplete()
const
3645 Q_D(
const QWizardPage);
3650 const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3651 const auto end = wizardFields.crend();
3652 for (
auto it = wizardFields.crbegin(); it != end; ++it) {
3653 const QWizardField &field = *it;
3654 if (field.page ==
this && field.mandatory) {
3655 QVariant value = field.object->property(field.property);
3656 if (value == field.initialValue)
3659#if QT_CONFIG(lineedit)
3660 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3661 if (!lineEdit->hasAcceptableInput())
3665#if QT_CONFIG(spinbox)
3666 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3667 if (!spinBox->hasAcceptableInput())
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688void QWizardPage::setFinalPage(
bool finalPage)
3691 d->explicitlyFinal = finalPage;
3692 QWizard *wizard =
this->wizard();
3693 if (wizard && wizard->currentPage() ==
this)
3694 wizard->d_func()->updateCurrentPage();
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709bool QWizardPage::isFinalPage()
const
3711 Q_D(
const QWizardPage);
3712 if (d->explicitlyFinal)
3715 QWizard *wizard =
this->wizard();
3716 if (wizard && wizard->currentPage() ==
this) {
3718 return wizard->nextId() == -1;
3720 return nextId() == -1;
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738void QWizardPage::setCommitPage(
bool commitPage)
3741 d->commit = commitPage;
3742 QWizard *wizard =
this->wizard();
3743 if (wizard && wizard->currentPage() ==
this)
3744 wizard->d_func()->updateCurrentPage();
3748
3749
3750
3751
3752bool QWizardPage::isCommitPage()
const
3754 Q_D(
const QWizardPage);
3759
3760
3761
3762
3763
3764
3765
3766void QWizardPage::setButtonText(QWizard::WizardButton which,
const QString &text)
3769 d->buttonCustomTexts.insert(which, text);
3770 if (wizard() && wizard()->currentPage() ==
this && wizard()->d_func()->btns[which])
3771 wizard()->d_func()->btns[which]->setText(text);
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787QString QWizardPage::buttonText(QWizard::WizardButton which)
const
3789 Q_D(
const QWizardPage);
3791 if (d->buttonCustomTexts.contains(which))
3792 return d->buttonCustomTexts.value(which);
3795 return wizard()->buttonText(which);
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816int QWizardPage::nextId()
const
3818 Q_D(
const QWizardPage);
3823 bool foundCurrentPage =
false;
3825 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3826 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();
3827 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();
3829 for (; i != end; ++i) {
3830 if (i.value() ==
this) {
3831 foundCurrentPage =
true;
3832 }
else if (foundCurrentPage) {
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3854
3855
3856
3857
3858
3859
3860
3861
3862void QWizardPage::setField(
const QString &name,
const QVariant &value)
3867 d->wizard->setField(name, value);
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883QVariant QWizardPage::field(
const QString &name)
const
3885 Q_D(
const QWizardPage);
3888 return d->wizard->field(name);
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937void QWizardPage::registerField(
const QString &name, QWidget *widget,
const char *property,
3938 const char *changedSignal)
3941 QWizardField field(
this, name, widget, property, changedSignal);
3943 d->wizard->d_func()->addField(field);
3945 d->pendingFields += field;
3950
3951
3952
3953
3954
3955QWizard *QWizardPage::wizard()
const
3957 Q_D(
const QWizardPage);
3963#include "moc_qwizard.cpp"
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
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)
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