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::WizardOptions wizardOptions);
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::WizardOptions options)
334 bool modern = ((info.wizStyle == QWizard::ModernStyle)
335#if QT_CONFIG(style_windowsvista)
339 wizardOptions = options;
340 layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0);
341 layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0);
342 layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2);
347 layout->setColumnMinimumWidth(0, minColumnWidth0);
348 layout->setColumnMinimumWidth(1, minColumnWidth1);
350 titleLabel->setTextFormat(titleFormat);
351 titleLabel->setText(title);
352 logoLabel->setPixmap(logo);
354 subTitleLabel->setTextFormat(subTitleFormat);
355 subTitleLabel->setText(
"Pq\nPq"_L1);
356 int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
357 subTitleLabel->setText(subTitle);
360 bannerPixmap = banner;
362 bannerPixmap = QPixmap();
365 if (bannerPixmap.isNull() || wizardOptions.testFlag(QWizard::StretchBanner)) {
367
368
369 int candidateSubTitleWidth = qMin(512, 2 * QGuiApplication::primaryScreen()->virtualGeometry().width() / 3);
370 int delta = candidateSubTitleWidth >> 1;
372 if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
373 <= desiredSubTitleHeight)
374 candidateSubTitleWidth -= delta;
378 subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight);
380 QSize size = layout->totalMinimumSize();
381 setMinimumSize(size);
382 setMaximumSize(QWIDGETSIZE_MAX, size.height());
384 subTitleLabel->setMinimumSize(0, 0);
385 setFixedSize(banner.size() + QSize(0, 2));
393 if (wizardOptions.testFlag(QWizard::StretchBanner)) {
394 painter.setRenderHint(QPainter::SmoothPixmapTransform);
395 painter.drawPixmap(0, 0, width(), height(), bannerPixmap);
397 painter.drawPixmap(0, 0, bannerPixmap);
401 int y = height() - 2;
402 const QPalette &pal = palette();
403 painter.setPen(pal.mid().color());
404 painter.drawLine(0, y, x, y);
405 painter.setPen(pal.base().color());
406 painter.drawPoint(x + 1, y);
407 painter.drawLine(0, y + 1, x + 1, y + 1);
422 m_layout =
new QVBoxLayout(
this);
424 m_layout->addWidget(m_sideWidget);
428 if (!pixmap().isNull())
429 return pixmap().deviceIndependentSize().toSize();
430 return QFrame::minimumSizeHint();
434 if (m_sideWidget == widget)
437 m_layout->removeWidget(m_sideWidget);
438 m_sideWidget->hide();
440 m_sideWidget = widget;
442 m_layout->addWidget(m_sideWidget);
448 QVBoxLayout *m_layout;
454 Q_DECLARE_PUBLIC(QWizardPage)
477 Q_Q(
const QWizardPage);
478 if (completeState == Tri_Unknown)
479 completeState = q->isComplete() ? Tri_True : Tri_False;
480 return completeState == Tri_True;
486 TriState newState = q->isComplete() ? Tri_True : Tri_False;
487 if (newState != completeState)
488 emit q->completeChanged();
494 completeState = q->isComplete() ? Tri_True : Tri_False;
500#if QT_CONFIG(style_windowsvista)
516 Q_DECLARE_PUBLIC(QWizard)
545#if QT_CONFIG(style_windowsvista)
592 mutable QAbstractButton *
btns[QWizard::NButtons];
609#if QT_CONFIG(style_windowsvista)
611# if QT_CONFIG(shortcut)
627#if !QT_CONFIG(style_windowsvista)
628 Q_UNUSED(wizardPrivate);
630 const bool macStyle = (wstyle == QWizard::MacStyle);
632 case QWizard::BackButton:
633 return macStyle ? QWizard::tr(
"Go Back") : QWizard::tr(
"< &Back");
634 case QWizard::NextButton:
636 return QWizard::tr(
"Continue");
639 ? QWizard::tr(
"&Next") : QWizard::tr(
"&Next >");
640 case QWizard::CommitButton:
641 return QWizard::tr(
"Commit");
642 case QWizard::FinishButton:
643 return macStyle ? QWizard::tr(
"Done") : QWizard::tr(
"&Finish");
644 case QWizard::CancelButton:
645 return QWizard::tr(
"Cancel");
646 case QWizard::HelpButton:
647 return macStyle ? QWizard::tr(
"Help") : QWizard::tr(
"&Help");
657 std::fill(btns, btns + QWizard::NButtons,
nullptr);
659 antiFlickerWidget =
new QWizardAntiFlickerWidget(q,
this);
660 wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle,
nullptr, q));
661 if (wizStyle == QWizard::MacStyle) {
662 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
663 }
else if (wizStyle == QWizard::ModernStyle) {
664 opts = QWizard::HelpButtonOnRight;
667#if QT_CONFIG(style_windowsvista)
668 vistaHelper =
new QVistaHelper(q);
672 ensureButton(QWizard::BackButton);
673 ensureButton(QWizard::NextButton);
674 ensureButton(QWizard::CommitButton);
675 ensureButton(QWizard::FinishButton);
677 pageFrame =
new QFrame(antiFlickerWidget);
678 pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
680 pageVBoxLayout =
new QVBoxLayout(pageFrame);
681 pageVBoxLayout->setSpacing(0);
682 pageVBoxLayout->addSpacing(0);
683 QSpacerItem *spacerItem =
new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
684 pageVBoxLayout->addItem(spacerItem);
686 buttonLayout =
new QHBoxLayout;
687 mainLayout =
new QGridLayout(antiFlickerWidget);
688 mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
692 defaultPropertyTable.reserve(NFallbackDefaultProperties);
693 for (uint i = 0; i < NFallbackDefaultProperties; ++i)
694 defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
695 fallbackProperties[i].property,
703 q->currentPage()->hide();
705 const auto end = history.crend();
706 for (
auto it = history.crbegin(); it != end; ++it)
709 for (QWizardPage *page : std::as_const(pageMap))
710 page->d_func()->initialized =
false;
713 emit q->currentIdChanged(-1);
721 for (
auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
722 const auto idx = it.key();
723 const auto page = it.value()->d_func();
724 if (page->initialized && !history.contains(idx)) {
726 page->initialized =
false;
736 myField.resolve(defaultPropertyTable);
738 if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
739 qWarning(
"QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
743 fieldIndexMap.insert(myField.name, fields.size());
745 if (myField.mandatory && !myField.changedSignal.isEmpty())
746 QObject::connect(myField.object, myField.changedSignal,
747 myField.page, SLOT(_q_maybeEmitCompleteChanged()));
749 myField.object, SIGNAL(destroyed(QObject*)), q,
750 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
758 fieldIndexMap.remove(field.name);
759 if (field.mandatory && !field.changedSignal.isEmpty())
760 QObject::disconnect(field.object, field.changedSignal,
761 field.page, SLOT(_q_maybeEmitCompleteChanged()));
763 field.object, SIGNAL(destroyed(QObject*)), q,
764 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
765 fields.remove(index);
775 if (QWizardPage *oldPage = q->currentPage()) {
779 if (!(opts & QWizard::IndependentPages)) {
780 q->cleanupPage(oldId);
781 oldPage->d_func()->initialized =
false;
783 Q_ASSERT(history.constLast() == oldId);
784 history.removeLast();
785 Q_ASSERT(history.constLast() == newId);
791 QWizardPage *newPage = q->currentPage();
794 if (!newPage->d_func()->initialized) {
795 newPage->d_func()->initialized =
true;
796 q->initializePage(current);
798 history.append(current);
803 canContinue = (q->nextId() != -1);
804 canFinish = (newPage && newPage->isFinalPage());
809 const QWizard::WizardButton nextOrCommit =
810 newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
811 QAbstractButton *nextOrFinishButton =
812 btns[canContinue ? nextOrCommit : QWizard::FinishButton];
816
817
818
819
820
821
822
823
824 if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
825 candidate = nextOrFinishButton;
826 }
else if (newPage) {
827 candidate = iWantTheFocus(newPage);
830 candidate = nextOrFinishButton;
831 candidate->setFocus();
833 if (wizStyle == QWizard::MacStyle)
840 emit q->currentIdChanged(current);
847 case QWizard::BackButton:
849 case QWizard::NextButton:
850 case QWizard::CommitButton:
852 case QWizard::FinishButton:
853 return SLOT(accept());
854 case QWizard::CancelButton:
855 return SLOT(reject());
856 case QWizard::HelpButton:
857 return SIGNAL(helpRequested());
858 case QWizard::CustomButton1:
859 case QWizard::CustomButton2:
860 case QWizard::CustomButton3:
861 case QWizard::Stretch:
862 case QWizard::NoButton:
871 QStyle *style = q->style();
877 const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option, q);
882 info
.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, titleLabel);
883 info
.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, titleLabel);
884 info
.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, titleLabel);
885 info
.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, titleLabel);
886 info
.hspacing = (layoutHorizontalSpacing == -1)
887 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
888 : layoutHorizontalSpacing;
889 info
.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option, q);
891 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)
892 : layoutHorizontalSpacing;
894 if (wizStyle == QWizard::MacStyle)
897 info.wizStyle = wizStyle;
898 if (info.wizStyle == QWizard::AeroStyle
899#if QT_CONFIG(style_windowsvista)
903 info.wizStyle = QWizard::ModernStyle;
906 QString subTitleText;
907 QPixmap backgroundPixmap;
908 QPixmap watermarkPixmap;
910 if (QWizardPage *page = q->currentPage()) {
911 titleText = page->title();
912 subTitleText = page->subTitle();
913 backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
914 watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
917 info.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
918 && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
920 info.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
921 && !watermarkPixmap.isNull();
923 info.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
924 info.extension = (info.watermark || info.sideWidget) && (opts & QWizard::ExtendedWatermarkPixmap);
934
935
936 for (
int i = mainLayout->count() - 1; i >= 0; --i) {
937 QLayoutItem *item = mainLayout->takeAt(i);
938 if (item->layout()) {
939 item->layout()->setParent(
nullptr);
944 for (
int i = mainLayout->columnCount() - 1; i >= 0; --i)
945 mainLayout->setColumnMinimumWidth(i, 0);
946 for (
int i = mainLayout->rowCount() - 1; i >= 0; --i)
947 mainLayout->setRowMinimumHeight(i, 0);
950
951
953 bool mac = (info.wizStyle == QWizard::MacStyle);
954 bool classic = (info.wizStyle == QWizard::ClassicStyle);
955 bool modern = (info.wizStyle == QWizard::ModernStyle);
956 bool aero = (info.wizStyle == QWizard::AeroStyle);
972 int pageColumn = qMin(1, numColumns - 1);
975 mainLayout->setContentsMargins(QMargins());
976 mainLayout->setSpacing(0);
977 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);
978 pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
981 mainLayout->setContentsMargins(QMargins());
982 mainLayout->setSpacing(0);
983 pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
984 deltaMarginRight, deltaMarginBottom);
985 buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
986 info.topLevelMarginRight, info.topLevelMarginBottom);
988 mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
989 info.topLevelMarginRight, info.topLevelMarginBottom);
990 mainLayout->setHorizontalSpacing(info.hspacing);
991 mainLayout->setVerticalSpacing(info.vspacing);
992 pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
993 buttonLayout->setContentsMargins(0, 0, 0, 0);
996 buttonLayout->setSpacing(info.buttonSpacing);
1000 headerWidget =
new QWizardHeader(antiFlickerWidget);
1002 mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
1007 int watermarkStartRow = row;
1010 mainLayout->setRowMinimumHeight(row++, 10);
1014 titleLabel =
new QLabel(antiFlickerWidget);
1015 titleLabel->setBackgroundRole(QPalette::Base);
1016 titleLabel->setWordWrap(
true);
1019 QFont titleFont = q->font();
1020 titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4));
1021 titleFont.setBold(
true);
1022 titleLabel->setPalette(QPalette());
1026 titleFont = QFont(
"Segoe UI"_L1, 12);
1027 QPalette pal(titleLabel->palette());
1028 pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1029 titleLabel->setPalette(pal);
1032 titleLabel->setFont(titleFont);
1033 const int aeroTitleIndent = 25;
1035 titleLabel->setIndent(aeroTitleIndent);
1037 titleLabel->setIndent(2);
1039 titleLabel->setIndent(info.childMarginLeft);
1041 titleLabel->setIndent(info.topLevelMarginLeft);
1044 placeholderWidget1 =
new QWidget(antiFlickerWidget);
1048 mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1050 mainLayout->addWidget(titleLabel, row++, pageColumn);
1053 placeholderWidget2 =
new QWidget(antiFlickerWidget);
1057 mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1060 mainLayout->setRowMinimumHeight(row++, 7);
1068 if (!subTitleLabel) {
1069 subTitleLabel =
new QLabel(pageFrame);
1070 subTitleLabel->setWordWrap(
true);
1072 subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1073 info.childMarginRight , 0);
1075 pageVBoxLayout->insertWidget(1, subTitleLabel);
1082 int hMargin = mac ? 1 : 0;
1083 int vMargin = hMargin;
1085 pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame);
1086 pageFrame->setLineWidth(0);
1087 pageFrame->setMidLineWidth(hMargin);
1092 vMargin = deltaMarginBottom;
1093 }
else if (classic) {
1100 int leftMargin = 18;
1101 int topMargin = vMargin;
1102 int rightMargin = hMargin;
1103 int bottomMargin = vMargin;
1104 pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1106 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1110 watermarkLabel =
new QWatermarkLabel(antiFlickerWidget, sideWidget);
1113 watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
1118 const bool wasSemiTransparent =
1119 pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
1120 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1122 pageFrame->setAutoFillBackground(
true);
1125 if (wasSemiTransparent)
1126 pageFrame->setPalette(QPalette());
1128 bool baseBackground = (modern && !info
.header);
1129 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);
1132 titleLabel->setAutoFillBackground(baseBackground);
1133 pageFrame->setAutoFillBackground(baseBackground);
1142 QPalette pal = pageFrame->palette();
1143 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1144 pageFrame->setPalette(pal);
1145 pageFrame->setAutoFillBackground(
true);
1147 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1153 mainLayout->addWidget(pageFrame, row++, pageColumn);
1155 int watermarkEndRow = row;
1157 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1160 buttonLayout->setContentsMargins(9, 9, 9, 9);
1161 mainLayout->setContentsMargins(0, 11, 0, 0);
1164 int buttonStartColumn = info
.extension ? 1 : 0;
1165 int buttonNumColumns = info
.extension ? 1 : numColumns;
1167 if (classic || modern) {
1169 bottomRuler =
new QWizardRuler(antiFlickerWidget);
1170 mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1174 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1176 mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1180 watermarkEndRow = row;
1181 mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1182 watermarkEndRow - watermarkStartRow, 1);
1185 mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1187 mainLayout->setColumnMinimumWidth(2, 21);
1192 titleLabel->setVisible(info.title);
1194 subTitleLabel->setVisible(info.subTitle);
1210 if (layoutInfo != info)
1212 QWizardPage *page = q->currentPage();
1220 bool expandPage = !page->layout();
1222 const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page));
1223 expandPage = pageItem->expandingDirections() & Qt::Vertical;
1225 QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1226 Q_ASSERT(bottomSpacer);
1227 bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding);
1228 pageVBoxLayout->invalidate();
1233 headerWidget->setup(info, page->title(), page->subTitle(),
1234 page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap),
1235 titleFmt, subTitleFmt, opts);
1242 pix = page->pixmap(QWizard::WatermarkPixmap);
1244 pix = q->pixmap(QWizard::WatermarkPixmap);
1251 titleLabel->setTextFormat(titleFmt);
1252 titleLabel->setText(page->title());
1256 subTitleLabel->setTextFormat(subTitleFmt);
1257 subTitleLabel->setText(page->subTitle());
1265 if (wizStyle == QWizard::MacStyle) {
1274 QPalette newPalette = QApplication::palette(pageFrame);
1276 QColor windowColor = newPalette.brush(QPalette::Window).color();
1277 windowColor.setAlpha(153);
1278 newPalette.setBrush(QPalette::Window, windowColor);
1280 QColor baseColor = newPalette.brush(QPalette::Base).color();
1281 baseColor.setAlpha(153);
1282 newPalette.setBrush(QPalette::Base, baseColor);
1284 pageFrame->setPalette(newPalette);
1292 int extraHeight = 0;
1293#if QT_CONFIG(style_windowsvista)
1294 if (isVistaThemeEnabled())
1295 extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1297 QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1298 QSize maximumSize = mainLayout->totalMaximumSize();
1299 if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1304 minimumSize.setHeight(mainLayout->totalSizeHint().height());
1306 if (q->minimumWidth() == minimumWidth) {
1308 q->setMinimumWidth(minimumWidth);
1310 if (q->minimumHeight() == minimumHeight) {
1312 q->setMinimumHeight(minimumHeight);
1314 if (q->maximumWidth() == maximumWidth) {
1315 maximumWidth = maximumSize.width();
1316 q->setMaximumWidth(maximumWidth);
1318 if (q->maximumHeight() == maximumHeight) {
1319 maximumHeight = maximumSize.height();
1320 q->setMaximumHeight(maximumHeight);
1327 if (q->currentPage()) {
1328 canContinue = (q->nextId() != -1);
1329 canFinish = q->currentPage()->isFinalPage();
1341 case QWizard::CommitButton:
1342 return u"qt_wizard_commit"_s;
1343 case QWizard::FinishButton:
1344 return u"qt_wizard_finish"_s;
1345 case QWizard::CancelButton:
1346 return u"qt_wizard_cancel"_s;
1347 case QWizard::BackButton:
1348 case QWizard::NextButton:
1349 case QWizard::HelpButton:
1350 case QWizard::CustomButton1:
1351 case QWizard::CustomButton2:
1352 case QWizard::CustomButton3:
1354 return "__qt__passive_wizardbutton"_L1 + QString::number(which);
1355 case QWizard::Stretch:
1356 case QWizard::NoButton:
1361 Q_UNREACHABLE_RETURN(QString());
1367 if (uint(which) >= QWizard::NButtons)
1371 QPushButton *pushButton =
new QPushButton(antiFlickerWidget);
1372 QStyle *style = q->style();
1373 if (style != QApplication::style())
1374 pushButton->setStyle(style);
1375 pushButton->setObjectName(object_name_for_button(which));
1377 pushButton->setAutoDefault(
false);
1381 const_cast<QWizardPrivate *>(
this)->btns[which] = pushButton;
1383 btns[which] = pushButton;
1385 if (which < QWizard::NStandardButtons)
1386 pushButton->setText(buttonDefaultText(wizStyle, which,
this));
1388 connectButton(which);
1396 if (which < QWizard::NStandardButtons) {
1397 QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1399 QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1406 for (
int i = 0; i < QWizard::NButtons; ++i) {
1408 if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1409 btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1410 else if (buttonCustomTexts.contains(i))
1411 btns[i]->setText(buttonCustomTexts.value(i));
1412 else if (i < QWizard::NStandardButtons)
1413 btns[i]->setText(buttonDefaultText(wizStyle, i,
this));
1419#if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1420 if (btns[QWizard::NextButton] && isVistaThemeEnabled()) {
1421 if (vistaNextShortcut.isNull()) {
1423 new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right),
1424 btns[QWizard::NextButton], SLOT(animateClick()));
1427 delete vistaNextShortcut;
1435 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array{
1436 buttonsCustomLayout.cbegin(), buttonsCustomLayout.cend()};
1437 setButtonLayout(array.constData(),
int(array.size()));
1442 const int ArraySize = 12;
1443 QWizard::WizardButton array[ArraySize];
1444 memset(array, -1,
sizeof(array));
1445 Q_ASSERT(array[0] == QWizard::NoButton);
1447 if (opts & QWizard::HaveHelpButton) {
1448 int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1449 array[i] = QWizard::HelpButton;
1451 array[1] = QWizard::Stretch;
1452 if (opts & QWizard::HaveCustomButton1)
1453 array[2] = QWizard::CustomButton1;
1454 if (opts & QWizard::HaveCustomButton2)
1455 array[3] = QWizard::CustomButton2;
1456 if (opts & QWizard::HaveCustomButton3)
1457 array[4] = QWizard::CustomButton3;
1459 if (!(opts & QWizard::NoCancelButton)) {
1460 int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1461 array[i] = QWizard::CancelButton;
1463 array[6] = QWizard::BackButton;
1464 array[7] = QWizard::NextButton;
1465 array[8] = QWizard::CommitButton;
1466 array[9] = QWizard::FinishButton;
1468 setButtonLayout(array, ArraySize);
1476 for (
int i = buttonLayout->count() - 1; i >= 0; --i) {
1477 QLayoutItem *item = buttonLayout->takeAt(i);
1478 if (
QWidget *widget = item->widget())
1483 for (
int i = 0; i < size; ++i) {
1484 QWizard::WizardButton which = array[i];
1485 if (which == QWizard::Stretch) {
1486 buttonLayout->addStretch(1);
1487 }
else if (which != QWizard::NoButton) {
1488 ensureButton(which);
1489 buttonLayout->addWidget(btns[which]);
1492 if (which != QWizard::BackButton && which != QWizard::NextButton
1493 && which != QWizard::CommitButton && which != QWizard::FinishButton)
1494 btns[which]->show();
1497 QWidget::setTabOrder(prev, btns[which]);
1507 return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
1513 if (which == QWizard::BackgroundPixmap) {
1514 if (wizStyle == QWizard::MacStyle) {
1516 q->updateGeometry();
1523#if QT_CONFIG(style_windowsvista)
1524bool QWizardPrivate::vistaDisabled()
const
1527 const QVariant v = q->property(
"_q_wizard_vista_off");
1528 return v.isValid() && v.toBool();
1531bool QWizardPrivate::handleAeroStyleChange()
1535 if (inHandleAeroStyleChange)
1541 const bool isWindow = q->isWindow();
1542 if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1544 inHandleAeroStyleChange =
true;
1546 vistaHelper->disconnectBackButton();
1547 q->removeEventFilter(vistaHelper);
1549 bool vistaMargins =
false;
1551 if (isVistaThemeEnabled()) {
1552 const int topOffset = vistaHelper->topOffset(q);
1553 const int topPadding = vistaHelper->topPadding(q);
1555 vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1556 q->installEventFilter(vistaHelper);
1558 q->setMouseTracking(
true);
1559 antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1560 vistaHelper->backButton()->move(
1562 - qMin(topOffset, topPadding + 1));
1563 vistaMargins =
true;
1564 vistaHelper->backButton()->show();
1566 vistaHelper->setTitleBarIconAndCaptionVisible(
false);
1568 vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1569 vistaHelper->backButton()->show();
1571 q->setMouseTracking(
true);
1575 antiFlickerWidget->move(0, 0);
1576 vistaHelper->hideBackButton();
1578 vistaHelper->setTitleBarIconAndCaptionVisible(
true);
1581 _q_updateButtonStates();
1583 vistaHelper->updateCustomMargins(vistaMargins);
1585 inHandleAeroStyleChange =
false;
1592#if QT_CONFIG(style_windowsvista)
1593 return wizStyle == QWizard::AeroStyle && !vistaDisabled();
1603 q->setUpdatesEnabled(
false);
1613 q->setUpdatesEnabled(
true);
1620 QObject *button = q->sender();
1621 for (
int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1622 if (btns[i] == button) {
1623 emit q->customButtonClicked(QWizard::WizardButton(i));
1635 const QWizardPage *page = q->currentPage();
1636 bool complete = page && page->isComplete();
1638 btn.back->setEnabled(history.size() > 1
1639 && !q->page(history.at(history.size() - 2))->isCommitPage()
1640 && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage)));
1641 btn.next->setEnabled(canContinue && complete);
1642 btn.commit->setEnabled(canContinue && complete);
1643 btn.finish->setEnabled(canFinish && complete);
1645 const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1646 && (history.size() > 1 || !(opts & QWizard::NoBackButtonOnStartPage))
1647 && (canContinue || !(opts & QWizard::NoBackButtonOnLastPage));
1648 bool commitPage = page && page->isCommitPage();
1649 btn.back->setVisible(backButtonVisible);
1650 btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1651 && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage)));
1652 btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1654 btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1655 && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
1657 if (!(opts & QWizard::NoCancelButton))
1658 btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1659 && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
1661 bool useDefault = !(opts & QWizard::NoDefaultButton);
1662 if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1663 nextPush->setDefault(canContinue && useDefault && !commitPage);
1664 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1665 commitPush->setDefault(canContinue && useDefault && commitPage);
1666 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1667 finishPush->setDefault(!canContinue && useDefault);
1669#if QT_CONFIG(style_windowsvista)
1670 if (isVistaThemeEnabled()) {
1671 vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1672 vistaHelper->backButton()->setVisible(backButtonVisible);
1673 btn.back->setVisible(
false);
1682 int destroyed_index = -1;
1683 QList<QWizardField>::iterator it = fields.begin();
1684 while (it != fields.end()) {
1686 if (field.object == object) {
1687 destroyed_index = fieldIndexMap.value(field.name, -1);
1688 fieldIndexMap.remove(field.name);
1689 it = fields.erase(it);
1694 if (destroyed_index != -1) {
1695 QMap<QString,
int>::iterator it2 = fieldIndexMap.begin();
1696 while (it2 != fieldIndexMap.end()) {
1697 int index = it2.value();
1698 if (index > destroyed_index) {
1699 QString field_name = it2.key();
1700 fieldIndexMap.insert(field_name, index-1);
1709 for (
int i = 0; i < QWizard::NButtons; i++)
1711 btns[i]->setStyle(style);
1712 const PageMap::const_iterator pcend = pageMap.constEnd();
1713 for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1714 it.value()->setStyle(style);
1718QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1720 auto *keyboardAssistantURL = [NSWorkspace.sharedWorkspace
1721 URLForApplicationWithBundleIdentifier:@
"com.apple.KeyboardSetupAssistant"];
1722 auto *keyboardAssistantBundle = [NSBundle bundleWithURL:keyboardAssistantURL];
1723 auto *assistantBackground = [keyboardAssistantBundle imageForResource:@
"Background"];
1724 auto size = QSizeF::fromCGSize(assistantBackground.size);
1725 static const QSizeF expectedSize(242, 414);
1726 if (size == expectedSize)
1727 return qt_mac_toQPixmap(assistantBackground, size);
1733#if QT_CONFIG(style_windowsvista)
1734void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
1736 if (wizardPrivate->isVistaThemeEnabled()) {
1737 int leftMargin, topMargin, rightMargin, bottomMargin;
1738 wizardPrivate->buttonLayout->getContentsMargins(
1739 &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1740 const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1741 QPainter painter(
this);
1742 const QBrush brush(QColor(240, 240, 240));
1743 painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1744 painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0));
1745 painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
1751
1752
1753
1754
1755
1756
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
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2129
2130
2131
2132
2133QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
2134 : QDialog(*
new QWizardPrivate, parent, flags)
2141
2142
2146 delete d->buttonLayout;
2150
2151
2152
2153
2154
2155
2156
2157int QWizard::addPage(QWizardPage *page)
2161 if (!d->pageMap.isEmpty())
2162 theid = d->pageMap.lastKey() + 1;
2163 setPage(theid, page);
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177void QWizard::setPage(
int theid, QWizardPage *page)
2181 if (Q_UNLIKELY(!page)) {
2182 qWarning(
"QWizard::setPage: Cannot insert null page");
2186 if (Q_UNLIKELY(theid == -1)) {
2187 qWarning(
"QWizard::setPage: Cannot insert page with ID -1");
2191 if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2192 qWarning(
"QWizard::setPage: Page with duplicate ID %d ignored", theid);
2196 page->setParent(d->pageFrame);
2198 QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2199 for (
const auto &field : std::as_const(pendingFields))
2201 pendingFields.clear();
2203 connect(page, SIGNAL(completeChanged()),
this, SLOT(_q_updateButtonStates()));
2205 d->pageMap.insert(theid, page);
2206 page->d_func()->wizard =
this;
2208 int n = d->pageVBoxLayout->count();
2211 bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2212 d->pageVBoxLayout->setEnabled(
false);
2214 d->pageVBoxLayout->insertWidget(n - 1, page);
2218 d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2220 if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2222 emit pageAdded(theid);
2226
2227
2228
2229
2230
2231
2232void QWizard::removePage(
int id)
2236 QWizardPage *removedPage =
nullptr;
2239 if (d->pageMap.size() > 0) {
2240 if (d->start == id) {
2241 const int firstId = d->pageMap.constBegin().key();
2242 if (firstId == id) {
2243 if (d->pageMap.size() > 1)
2244 d->start = (++d->pageMap.constBegin()).key();
2250 d->startSetByUser =
false;
2254 if (d->pageMap.contains(id))
2255 emit pageRemoved(id);
2257 if (!d->history.contains(id)) {
2259 removedPage = d->pageMap.take(id);
2260 d->updateCurrentPage();
2261 }
else if (id != d->current) {
2263 removedPage = d->pageMap.take(id);
2264 d->history.removeOne(id);
2265 d->_q_updateButtonStates();
2266 }
else if (d->history.size() == 1) {
2269 removedPage = d->pageMap.take(id);
2270 if (d->pageMap.isEmpty())
2271 d->updateCurrentPage();
2277 removedPage = d->pageMap.take(id);
2278 d->updateCurrentPage();
2282 if (removedPage->d_func()->initialized) {
2284 removedPage->d_func()->initialized =
false;
2287 d->pageVBoxLayout->removeWidget(removedPage);
2289 for (
int i = d->fields.size() - 1; i >= 0; --i) {
2290 if (d->fields.at(i).page == removedPage) {
2291 removedPage->d_func()->pendingFields += d->fields.at(i);
2292 d->removeFieldAt(i);
2299
2300
2301
2302
2303
2304
2305
2306QWizardPage *QWizard::page(
int theid)
const
2309 return d->pageMap.value(theid);
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322bool QWizard::hasVisitedPage(
int theid)
const
2325 return d->history.contains(theid);
2329
2330
2331
2332
2333
2334
2335
2336QList<
int> QWizard::visitedIds()
const
2343
2344
2345QList<
int> QWizard::pageIds()
const
2348 return d->pageMap.keys();
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361void QWizard::setStartId(
int theid)
2364 int newStart = theid;
2366 newStart = d->pageMap.size() ? d->pageMap.constBegin().key() : -1;
2368 if (d->start == newStart) {
2369 d->startSetByUser = theid != -1;
2373 if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2374 qWarning(
"QWizard::setStartId: Invalid page ID %d", newStart);
2377 d->start = newStart;
2378 d->startSetByUser = theid != -1;
2381int QWizard::startId()
const
2388
2389
2390
2391
2392
2393
2394
2395QWizardPage *QWizard::currentPage()
const
2398 return page(d->current);
2402
2403
2404
2405
2406
2407
2408
2409
2410int QWizard::currentId()
const
2417
2418
2419
2420
2421
2422
2423void QWizard::setField(
const QString &name,
const QVariant &value)
2427 int index = d->fieldIndexMap.value(name, -1);
2428 if (Q_UNLIKELY(index == -1)) {
2429 qWarning(
"QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2433 const QWizardField &field = d->fields.at(index);
2434 if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2435 qWarning(
"QWizard::setField: Couldn't write to property '%s'",
2436 field.property.constData());
2440
2441
2442
2443
2444
2445
2446QVariant QWizard::field(
const QString &name)
const
2450 int index = d->fieldIndexMap.value(name, -1);
2451 if (Q_UNLIKELY(index == -1)) {
2452 qWarning(
"QWizard::field: No such field '%ls'", qUtf16Printable(name));
2456 const QWizardField &field = d->fields.at(index);
2457 return field.object->property(field.property);
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472void QWizard::setWizardStyle(WizardStyle style)
2476 const bool styleChange = style != d->wizStyle;
2478#if QT_CONFIG(style_windowsvista)
2479 const bool aeroStyleChange =
2480 d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2481 d->vistaStateChanged =
false;
2482 d->vistaInitPending =
false;
2486#if QT_CONFIG(style_windowsvista)
2490 d->disableUpdates();
2491 d->wizStyle = style;
2492 d->updateButtonTexts();
2493#if QT_CONFIG(style_windowsvista)
2494 if (aeroStyleChange) {
2497 QResizeEvent ev(geometry().size(), geometry().size());
2498 QCoreApplication::sendEvent(
this, &ev);
2504#if QT_CONFIG(style_windowsvista)
2506 if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2507 d->vistaInitPending =
true;
2512QWizard::WizardStyle QWizard::wizardStyle()
const
2519
2520
2521
2522
2523
2524void QWizard::setOption(WizardOption option,
bool on)
2527 if (!(d->opts & option) != !on)
2528 setOptions(d->opts ^ option);
2532
2533
2534
2535
2536
2537bool QWizard::testOption(WizardOption option)
const
2540 return (d->opts & option) != 0;
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557void QWizard::setOptions(WizardOptions options)
2561 WizardOptions changed = (options ^ d->opts);
2565 d->disableUpdates();
2568 if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2569 d->cleanupPagesNotInHistory();
2571 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
2572 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
2573 | HaveCustomButton3)) {
2574 d->updateButtonLayout();
2575 }
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2576 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
2577 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
2578 d->_q_updateButtonStates();
2585QWizard::WizardOptions QWizard::options()
const
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608void QWizard::setButtonText(WizardButton which,
const QString &text)
2612 if (!d->ensureButton(which))
2615 d->buttonCustomTexts.insert(which, text);
2617 if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2618 d->btns[which]->setText(text);
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633QString QWizard::buttonText(WizardButton which)
const
2637 if (!d->ensureButton(which))
2640 if (d->buttonCustomTexts.contains(which))
2641 return d->buttonCustomTexts.value(which);
2643 const QString defText = buttonDefaultText(d->wizStyle, which, d);
2644 if (!defText.isNull())
2647 return d->btns[which]->text();
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668void QWizard::setButtonLayout(
const QList<WizardButton> &layout)
2672 for (
int i = 0; i < layout.size(); ++i) {
2673 WizardButton button1 = layout.at(i);
2675 if (button1 == NoButton || button1 == Stretch)
2677 if (!d->ensureButton(button1))
2681 for (
int j = 0; j < i; ++j) {
2682 WizardButton button2 = layout.at(j);
2683 if (Q_UNLIKELY(button2 == button1)) {
2684 qWarning(
"QWizard::setButtonLayout: Duplicate button in layout");
2690 d->buttonsHaveCustomLayout =
true;
2691 d->buttonsCustomLayout = layout;
2692 d->updateButtonLayout();
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705void QWizard::setButton(WizardButton which, QAbstractButton *button)
2709 if (uint(which) >= NButtons || d->btns[which] == button)
2712 if (QAbstractButton *oldButton = d->btns[which]) {
2713 d->buttonLayout->removeWidget(oldButton);
2717 d->btns[which] = button;
2719 button->setParent(d->antiFlickerWidget);
2720 d->buttonCustomTexts.insert(which, button->text());
2721 d->connectButton(which);
2723 d->buttonCustomTexts.remove(which);
2724 d->ensureButton(which);
2727 d->updateButtonLayout();
2731
2732
2733
2734
2735QAbstractButton *QWizard::button(WizardButton which)
const
2738#if QT_CONFIG(style_windowsvista)
2739 if (d->wizStyle == AeroStyle && which == BackButton)
2740 return d->vistaHelper->backButton();
2742 if (!d->ensureButton(which))
2744 return d->btns[which];
2748
2749
2750
2751
2752
2753
2754
2755void QWizard::setTitleFormat(Qt::TextFormat format)
2758 d->titleFmt = format;
2762Qt::TextFormat QWizard::titleFormat()
const
2769
2770
2771
2772
2773
2774
2775
2776void QWizard::setSubTitleFormat(Qt::TextFormat format)
2779 d->subTitleFmt = format;
2783Qt::TextFormat QWizard::subTitleFormat()
const
2786 return d->subTitleFmt;
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801void QWizard::setPixmap(WizardPixmap which,
const QPixmap &pixmap)
2804 Q_ASSERT(uint(which) < NPixmaps);
2805 d->defaultPixmaps[which] = pixmap;
2806 d->updatePixmap(which);
2810
2811
2812
2813
2814
2815
2816
2817QPixmap QWizard::pixmap(WizardPixmap which)
const
2820 Q_ASSERT(uint(which) < NPixmaps);
2822 if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2823 d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2825 return d->defaultPixmaps[which];
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853void QWizard::setDefaultProperty(
const char *className,
const char *property,
2854 const char *changedSignal)
2857 for (
int i = d->defaultPropertyTable.size() - 1; i >= 0; --i) {
2858 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2859 d->defaultPropertyTable.remove(i);
2863 d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888void QWizard::setSideWidget(QWidget *widget)
2892 d->sideWidget = widget;
2893 if (d->watermarkLabel) {
2894 d->watermarkLabel->setSideWidget(widget);
2900
2901
2902
2903
2904QWidget *QWizard::sideWidget()
const
2908 return d->sideWidget;
2912
2913
2914void QWizard::setVisible(
bool visible)
2918 if (d->current == -1)
2921 QDialog::setVisible(visible);
2925
2926
2927QSize QWizard::sizeHint()
const
2930 QSize result = d->mainLayout->totalSizeHint();
2931 QSize extra(500, 360);
2932 if (d->wizStyle == MacStyle && d->current != -1) {
2933 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());
2934 extra.setWidth(616);
2935 if (!pixmap.isNull()) {
2936 extra.setHeight(pixmap.height());
2939
2940
2941
2942
2943
2944 if (pixmap.width() >= pixmap.height())
2945 extra.setWidth(pixmap.width());
2948 return result.expandedTo(extra);
2952
2953
2954
2955
2956
2957
2958
2961
2962
2963
2964
2965
2966
2967
2970
2971
2972
2973
2974
2975
2976
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3020
3021
3022
3023
3024
3025
3029 int n = d->history.size() - 2;
3032 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3036
3037
3038
3039
3040
3041
3046 if (d->current == -1)
3049 if (validateCurrentPage()) {
3050 int next = nextId();
3052 if (Q_UNLIKELY(d->history.contains(next))) {
3053 qWarning(
"QWizard::next: Page %d already met", next);
3056 if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3057 qWarning(
"QWizard::next: No such page %d", next);
3060 d->switchToPage(next, QWizardPrivate::Forward);
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3080void QWizard::setCurrentId(
int id)
3084 if (d->current == -1)
3087 if (currentId() == id)
3090 if (!validateCurrentPage())
3093 if (id < 0 || Q_UNLIKELY(!d->pageMap.contains(id))) {
3094 qWarning(
"QWizard::setCurrentId: No such page: %d", id);
3098 d->switchToPage(id, (id < currentId()) ? QWizardPrivate::Backward : QWizardPrivate::Forward);
3102
3103
3104
3105
3106
3107void QWizard::restart()
3110 d->disableUpdates();
3112 d->switchToPage(startId(), QWizardPrivate::Forward);
3117
3118
3119bool QWizard::event(QEvent *event)
3122 if (event->type() == QEvent::StyleChange) {
3123 d->setStyle(style());
3125 }
else if (event->type() == QEvent::PaletteChange) {
3128#if QT_CONFIG(style_windowsvista)
3129 else if (event->type() == QEvent::Show && d->vistaInitPending) {
3130 d->vistaInitPending =
false;
3131 d->wizStyle = AeroStyle;
3132 d->handleAeroStyleChange();
3134 else if (d->isVistaThemeEnabled()) {
3135 if (event->type() == QEvent::Resize
3136 || event->type() == QEvent::LayoutDirectionChange) {
3137 const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3138 ? width() - d->vistaHelper->backButton()->sizeHint().width()
3141 d->vistaHelper->backButton()->move(buttonLeft,
3142 d->vistaHelper->backButton()->y());
3145 d->vistaHelper->mouseEvent(event);
3148 return QDialog::event(event);
3152
3153
3154void QWizard::resizeEvent(QResizeEvent *event)
3157 int heightOffset = 0;
3158#if QT_CONFIG(style_windowsvista)
3159 if (d->isVistaThemeEnabled()) {
3160 heightOffset = d->vistaHelper->topOffset(
this);
3161 heightOffset += d->vistaHelper->titleBarSize();
3164 d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3165#if QT_CONFIG(style_windowsvista)
3166 if (d->isVistaThemeEnabled())
3167 d->vistaHelper->resizeEvent(event);
3169 QDialog::resizeEvent(event);
3173
3174
3175void QWizard::paintEvent(QPaintEvent * event)
3178 if (d->wizStyle == MacStyle && currentPage()) {
3179 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3180 if (backgroundPixmap.isNull())
3183 QStylePainter painter(
this);
3184 painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3186#if QT_CONFIG(style_windowsvista)
3187 else if (d->isVistaThemeEnabled()) {
3188 d->vistaHelper->paintEvent(event);
3195#if defined(Q_OS_WIN) || defined(Q_QDOC)
3197
3198
3199bool QWizard::nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result)
3201#if QT_CONFIG(style_windowsvista)
3203 if (d->isVistaThemeEnabled() && eventType ==
"windows_generic_MSG") {
3204 MSG *windowsMessage =
static_cast<MSG *>(message);
3205 const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3206 if (d->vistaDirty) {
3209 if (windowsMessage->message == WM_GETICON) {
3210 d->vistaStateChanged =
true;
3211 d->vistaDirty =
false;
3212 setWizardStyle(AeroStyle);
3215 return winEventResult;
3217 return QDialog::nativeEvent(eventType, message, result);
3220 return QDialog::nativeEvent(eventType, message, result);
3226
3227
3228void QWizard::done(
int result)
3232 if (result == Rejected) {
3235 if (!validateCurrentPage())
3238 QDialog::done(result);
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259void QWizard::initializePage(
int theid)
3261 QWizardPage *page =
this->page(theid);
3263 page->initializePage();
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277void QWizard::cleanupPage(
int theid)
3279 QWizardPage *page =
this->page(theid);
3281 page->cleanupPage();
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300bool QWizard::validateCurrentPage()
3302 QWizardPage *page = currentPage();
3306 return page->validatePage();
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323int QWizard::nextId()
const
3325 const QWizardPage *page = currentPage();
3329 return page->nextId();
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
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
3400
3401
3402
3403
3404
3405
3406
3407
3408QWizardPage::QWizardPage(QWidget *parent)
3409 : QWidget(*
new QWizardPagePrivate, parent, { })
3411 connect(
this, SIGNAL(completeChanged()),
this, SLOT(_q_updateCachedCompleteState()));
3415
3416
3417QWizardPage::~QWizardPage()
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435void QWizardPage::setTitle(
const QString &title)
3439 if (d->wizard && d->wizard->currentPage() ==
this)
3440 d->wizard->d_func()->updateLayout();
3443QString QWizardPage::title()
const
3445 Q_D(
const QWizardPage);
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468void QWizardPage::setSubTitle(
const QString &subTitle)
3471 d->subTitle = subTitle;
3472 if (d->wizard && d->wizard->currentPage() ==
this)
3473 d->wizard->d_func()->updateLayout();
3476QString QWizardPage::subTitle()
const
3478 Q_D(
const QWizardPage);
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495void QWizardPage::setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap)
3498 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3499 d->pixmaps[which] = pixmap;
3500 if (d->wizard && d->wizard->currentPage() ==
this)
3501 d->wizard->d_func()->updatePixmap(which);
3505
3506
3507
3508
3509
3510
3511
3512
3513QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which)
const
3515 Q_D(
const QWizardPage);
3516 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3518 const QPixmap &pixmap = d->pixmaps[which];
3519 if (!pixmap.isNull())
3523 return wizard()->pixmap(which);
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545void QWizardPage::initializePage()
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560void QWizardPage::cleanupPage()
3564 const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3565 for (
const auto &field : fields) {
3566 if (field.page ==
this)
3567 field.object->setProperty(field.property, field.initialValue);
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586bool QWizardPage::validatePage()
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608bool QWizardPage::isComplete()
const
3610 Q_D(
const QWizardPage);
3615 const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3616 const auto end = wizardFields.crend();
3617 for (
auto it = wizardFields.crbegin(); it != end; ++it) {
3618 const QWizardField &field = *it;
3619 if (field.page ==
this && field.mandatory) {
3620 QVariant value = field.object->property(field.property);
3621 if (value == field.initialValue)
3624#if QT_CONFIG(lineedit)
3625 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3626 if (!lineEdit->hasAcceptableInput())
3630#if QT_CONFIG(spinbox)
3631 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3632 if (!spinBox->hasAcceptableInput())
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653void QWizardPage::setFinalPage(
bool finalPage)
3656 d->explicitlyFinal = finalPage;
3657 QWizard *wizard =
this->wizard();
3658 if (wizard && wizard->currentPage() ==
this)
3659 wizard->d_func()->updateCurrentPage();
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674bool QWizardPage::isFinalPage()
const
3676 Q_D(
const QWizardPage);
3677 if (d->explicitlyFinal)
3680 QWizard *wizard =
this->wizard();
3681 if (wizard && wizard->currentPage() ==
this) {
3683 return wizard->nextId() == -1;
3685 return nextId() == -1;
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703void QWizardPage::setCommitPage(
bool commitPage)
3706 d->commit = commitPage;
3707 QWizard *wizard =
this->wizard();
3708 if (wizard && wizard->currentPage() ==
this)
3709 wizard->d_func()->updateCurrentPage();
3713
3714
3715
3716
3717bool QWizardPage::isCommitPage()
const
3719 Q_D(
const QWizardPage);
3724
3725
3726
3727
3728
3729
3730
3731void QWizardPage::setButtonText(QWizard::WizardButton which,
const QString &text)
3734 d->buttonCustomTexts.insert(which, text);
3735 if (wizard() && wizard()->currentPage() ==
this && wizard()->d_func()->btns[which])
3736 wizard()->d_func()->btns[which]->setText(text);
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752QString QWizardPage::buttonText(QWizard::WizardButton which)
const
3754 Q_D(
const QWizardPage);
3756 if (d->buttonCustomTexts.contains(which))
3757 return d->buttonCustomTexts.value(which);
3760 return wizard()->buttonText(which);
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781int QWizardPage::nextId()
const
3783 Q_D(
const QWizardPage);
3788 bool foundCurrentPage =
false;
3790 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3791 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();
3792 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();
3794 for (; i != end; ++i) {
3795 if (i.value() ==
this) {
3796 foundCurrentPage =
true;
3797 }
else if (foundCurrentPage) {
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3819
3820
3821
3822
3823
3824
3825
3826
3827void QWizardPage::setField(
const QString &name,
const QVariant &value)
3832 d->wizard->setField(name, value);
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848QVariant QWizardPage::field(
const QString &name)
const
3850 Q_D(
const QWizardPage);
3853 return d->wizard->field(name);
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902void QWizardPage::registerField(
const QString &name, QWidget *widget,
const char *property,
3903 const char *changedSignal)
3906 QWizardField field(
this, name, widget, property, changedSignal);
3908 d->wizard->d_func()->addField(field);
3910 d->pendingFields += field;
3915
3916
3917
3918
3919
3920QWizard *QWizardPage::wizard()
const
3922 Q_D(
const QWizardPage);
3928#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)
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