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);
403 const qreal dpr = devicePixelRatio();
404 const int devHeight = qRound(height() * dpr);
405 const int devWidth = qRound(width() * dpr);
407 const qreal x = (devWidth - 2) / dpr;
408 const qreal y = (devHeight - 2) / dpr;
410 const qreal x1 = (devWidth - 1) / dpr;
411 const qreal y1 = (devHeight - 1) / dpr;
413 const QPalette &pal = palette();
414 painter.setPen(pal.mid().color());
415 painter.drawLine(QLineF(0, y, x, y));
416 painter.setPen(pal.base().color());
417 painter.drawPoint(QPointF(x1, y));
418 painter.drawLine(QLineF(0, y1, x1, y1));
433 m_layout =
new QVBoxLayout(
this);
435 m_layout->addWidget(m_sideWidget);
439 if (!pixmap().isNull())
440 return pixmap().deviceIndependentSize().toSize();
441 return QFrame::minimumSizeHint();
445 if (m_sideWidget == widget)
448 m_layout->removeWidget(m_sideWidget);
449 m_sideWidget->hide();
451 m_sideWidget = widget;
453 m_layout->addWidget(m_sideWidget);
459 QVBoxLayout *m_layout;
465 Q_DECLARE_PUBLIC(QWizardPage)
488 Q_Q(
const QWizardPage);
489 if (completeState == Tri_Unknown)
490 completeState = q->isComplete() ? Tri_True : Tri_False;
491 return completeState == Tri_True;
497 TriState newState = q->isComplete() ? Tri_True : Tri_False;
498 if (newState != completeState)
499 emit q->completeChanged();
505 completeState = q->isComplete() ? Tri_True : Tri_False;
511#if QT_CONFIG(style_windowsvista)
527 Q_DECLARE_PUBLIC(QWizard)
556#if QT_CONFIG(style_windowsvista)
603 mutable QAbstractButton *
btns[QWizard::NButtons];
620#if QT_CONFIG(style_windowsvista)
622# if QT_CONFIG(shortcut)
638#if !QT_CONFIG(style_windowsvista)
639 Q_UNUSED(wizardPrivate);
641 const bool macStyle = (wstyle == QWizard::MacStyle);
643 case QWizard::BackButton:
644 return macStyle ? QWizard::tr(
"Go Back") : QWizard::tr(
"< &Back");
645 case QWizard::NextButton:
647 return QWizard::tr(
"Continue");
650 ? QWizard::tr(
"&Next") : QWizard::tr(
"&Next >");
651 case QWizard::CommitButton:
652 return QWizard::tr(
"Commit");
653 case QWizard::FinishButton:
654 return macStyle ? QWizard::tr(
"Done") : QWizard::tr(
"&Finish");
655 case QWizard::CancelButton:
656 return QWizard::tr(
"Cancel");
657 case QWizard::HelpButton:
658 return macStyle ? QWizard::tr(
"Help") : QWizard::tr(
"&Help");
668 std::fill(btns, btns + QWizard::NButtons,
nullptr);
670 antiFlickerWidget =
new QWizardAntiFlickerWidget(q,
this);
671 wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle,
nullptr, q));
673 case QWizard::ModernStyle:
674 opts = QWizard::HelpButtonOnRight;
676 case QWizard::MacStyle:
677 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
679#if QT_CONFIG(style_windowsvista)
680 case QWizard::AeroStyle:
681 vistaInitPending =
true;
687#if QT_CONFIG(style_windowsvista)
688 vistaHelper =
new QVistaHelper(q);
692 ensureButton(QWizard::BackButton);
693 ensureButton(QWizard::NextButton);
694 ensureButton(QWizard::CommitButton);
695 ensureButton(QWizard::FinishButton);
697 pageFrame =
new QFrame(antiFlickerWidget);
698 pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
700 pageVBoxLayout =
new QVBoxLayout(pageFrame);
701 pageVBoxLayout->setSpacing(0);
702 pageVBoxLayout->addSpacing(0);
703 QSpacerItem *spacerItem =
new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
704 pageVBoxLayout->addItem(spacerItem);
706 buttonLayout =
new QHBoxLayout;
707 mainLayout =
new QGridLayout(antiFlickerWidget);
708 mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
712 defaultPropertyTable.reserve(NFallbackDefaultProperties);
713 for (uint i = 0; i < NFallbackDefaultProperties; ++i)
714 defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
715 fallbackProperties[i].property,
723 q->currentPage()->hide();
725 const auto end = history.crend();
726 for (
auto it = history.crbegin(); it != end; ++it)
729 for (QWizardPage *page : std::as_const(pageMap))
730 page->d_func()->initialized =
false;
733 emit q->currentIdChanged(-1);
741 for (
auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
742 const auto idx = it.key();
743 const auto page = it.value()->d_func();
744 if (page->initialized && !history.contains(idx)) {
746 page->initialized =
false;
756 myField.resolve(defaultPropertyTable);
758 if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
759 qWarning(
"QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
763 fieldIndexMap.insert(myField.name, fields.size());
765 if (myField.mandatory && !myField.changedSignal.isEmpty())
766 QObject::connect(myField.object, myField.changedSignal,
767 myField.page, SLOT(_q_maybeEmitCompleteChanged()));
769 myField.object, SIGNAL(destroyed(QObject*)), q,
770 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
778 fieldIndexMap.remove(field.name);
779 if (field.mandatory && !field.changedSignal.isEmpty())
780 QObject::disconnect(field.object, field.changedSignal,
781 field.page, SLOT(_q_maybeEmitCompleteChanged()));
783 field.object, SIGNAL(destroyed(QObject*)), q,
784 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
785 fields.remove(index);
795 if (QWizardPage *oldPage = q->currentPage()) {
799 if (!(opts & QWizard::IndependentPages)) {
800 q->cleanupPage(oldId);
801 oldPage->d_func()->initialized =
false;
803 Q_ASSERT(history.constLast() == oldId);
804 history.removeLast();
805 Q_ASSERT(history.constLast() == newId);
811 QWizardPage *newPage = q->currentPage();
814 if (!newPage->d_func()->initialized) {
815 newPage->d_func()->initialized =
true;
816 q->initializePage(current);
818 history.append(current);
823 canContinue = (q->nextId() != -1);
824 canFinish = (newPage && newPage->isFinalPage());
829 const QWizard::WizardButton nextOrCommit =
830 newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
831 QAbstractButton *nextOrFinishButton =
832 btns[canContinue ? nextOrCommit : QWizard::FinishButton];
836
837
838
839
840
841
842
843
844 if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
845 candidate = nextOrFinishButton;
846 }
else if (newPage) {
847 candidate = iWantTheFocus(newPage);
850 candidate = nextOrFinishButton;
851 candidate->setFocus();
853 if (wizStyle == QWizard::MacStyle)
860 emit q->currentIdChanged(current);
867 case QWizard::BackButton:
869 case QWizard::NextButton:
870 case QWizard::CommitButton:
872 case QWizard::FinishButton:
873 return SLOT(accept());
874 case QWizard::CancelButton:
875 return SLOT(reject());
876 case QWizard::HelpButton:
877 return SIGNAL(helpRequested());
878 case QWizard::CustomButton1:
879 case QWizard::CustomButton2:
880 case QWizard::CustomButton3:
881 case QWizard::Stretch:
882 case QWizard::NoButton:
891 QStyle *style = q->style();
897 const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option, q);
902 info
.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, titleLabel);
903 info
.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, titleLabel);
904 info
.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, titleLabel);
905 info
.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, titleLabel);
906 info
.hspacing = (layoutHorizontalSpacing == -1)
907 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
908 : layoutHorizontalSpacing;
909 info
.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option, q);
911 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)
912 : layoutHorizontalSpacing;
914 if (wizStyle == QWizard::MacStyle)
917 info.wizStyle = wizStyle;
918 if (info.wizStyle == QWizard::AeroStyle
919#if QT_CONFIG(style_windowsvista)
923 info.wizStyle = QWizard::ModernStyle;
926 QString subTitleText;
927 QPixmap backgroundPixmap;
928 QPixmap watermarkPixmap;
930 if (QWizardPage *page = q->currentPage()) {
931 titleText = page->title();
932 subTitleText = page->subTitle();
933 backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
934 watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
937 info.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
938 && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
940 info.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
941 && !watermarkPixmap.isNull();
943 info.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
944 info.extension = (info.watermark || info.sideWidget) && (opts & QWizard::ExtendedWatermarkPixmap);
954
955
956 for (
int i = mainLayout->count() - 1; i >= 0; --i) {
957 QLayoutItem *item = mainLayout->takeAt(i);
958 if (item->layout()) {
959 item->layout()->setParent(
nullptr);
964 for (
int i = mainLayout->columnCount() - 1; i >= 0; --i)
965 mainLayout->setColumnMinimumWidth(i, 0);
966 for (
int i = mainLayout->rowCount() - 1; i >= 0; --i)
967 mainLayout->setRowMinimumHeight(i, 0);
970
971
973 bool mac = (info.wizStyle == QWizard::MacStyle);
974 bool classic = (info.wizStyle == QWizard::ClassicStyle);
975 bool modern = (info.wizStyle == QWizard::ModernStyle);
976 bool aero = (info.wizStyle == QWizard::AeroStyle);
992 int pageColumn = qMin(1, numColumns - 1);
995 mainLayout->setContentsMargins(QMargins());
996 mainLayout->setSpacing(0);
997 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);
998 pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
1001 mainLayout->setContentsMargins(QMargins());
1002 mainLayout->setSpacing(0);
1003 pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
1004 deltaMarginRight, deltaMarginBottom);
1005 buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1006 info.topLevelMarginRight, info.topLevelMarginBottom);
1008 mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1009 info.topLevelMarginRight, info.topLevelMarginBottom);
1010 mainLayout->setHorizontalSpacing(info.hspacing);
1011 mainLayout->setVerticalSpacing(info.vspacing);
1012 pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
1013 buttonLayout->setContentsMargins(0, 0, 0, 0);
1016 buttonLayout->setSpacing(info.buttonSpacing);
1020 headerWidget =
new QWizardHeader(antiFlickerWidget);
1022 mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
1027 int watermarkStartRow = row;
1030 mainLayout->setRowMinimumHeight(row++, 10);
1034 titleLabel =
new QLabel(antiFlickerWidget);
1035 titleLabel->setBackgroundRole(QPalette::Base);
1036 titleLabel->setWordWrap(
true);
1039 QFont titleFont = q->font();
1040 titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4));
1041 titleFont.setBold(
true);
1042 titleLabel->setPalette(QPalette());
1046 titleFont = QFont(
"Segoe UI"_L1, 12);
1047 QPalette pal(titleLabel->palette());
1048 pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1049 titleLabel->setPalette(pal);
1052 titleLabel->setFont(titleFont);
1053 const int aeroTitleIndent = 25;
1055 titleLabel->setIndent(aeroTitleIndent);
1057 titleLabel->setIndent(2);
1059 titleLabel->setIndent(info.childMarginLeft);
1061 titleLabel->setIndent(info.topLevelMarginLeft);
1064 placeholderWidget1 =
new QWidget(antiFlickerWidget);
1068 mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1070 mainLayout->addWidget(titleLabel, row++, pageColumn);
1073 placeholderWidget2 =
new QWidget(antiFlickerWidget);
1077 mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1080 mainLayout->setRowMinimumHeight(row++, 7);
1088 if (!subTitleLabel) {
1089 subTitleLabel =
new QLabel(pageFrame);
1090 subTitleLabel->setWordWrap(
true);
1092 subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1093 info.childMarginRight , 0);
1095 pageVBoxLayout->insertWidget(1, subTitleLabel);
1102 int hMargin = mac ? 1 : 0;
1103 int vMargin = hMargin;
1105 pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame);
1106 pageFrame->setLineWidth(0);
1107 pageFrame->setMidLineWidth(hMargin);
1112 vMargin = deltaMarginBottom;
1113 }
else if (classic) {
1120 int leftMargin = 18;
1121 int topMargin = vMargin;
1122 int rightMargin = hMargin;
1123 int bottomMargin = vMargin;
1124 pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1126 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1130 watermarkLabel =
new QWatermarkLabel(antiFlickerWidget, sideWidget);
1133 watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
1138 const bool wasSemiTransparent =
1139 pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
1140 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1142 pageFrame->setAutoFillBackground(
true);
1145 if (wasSemiTransparent)
1146 pageFrame->setPalette(QPalette());
1148 bool baseBackground = (modern && !info
.header);
1149 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);
1152 titleLabel->setAutoFillBackground(baseBackground);
1153 pageFrame->setAutoFillBackground(baseBackground);
1162 QPalette pal = pageFrame->palette();
1163 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1164 pageFrame->setPalette(pal);
1165 pageFrame->setAutoFillBackground(
true);
1167 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1173 mainLayout->addWidget(pageFrame, row++, pageColumn);
1175 int watermarkEndRow = row;
1177 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1180 buttonLayout->setContentsMargins(9, 9, 9, 9);
1181 mainLayout->setContentsMargins(0, 11, 0, 0);
1184 int buttonStartColumn = info
.extension ? 1 : 0;
1185 int buttonNumColumns = info
.extension ? 1 : numColumns;
1187 if (classic || modern) {
1189 bottomRuler =
new QWizardRuler(antiFlickerWidget);
1190 mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1194 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1196 mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1200 watermarkEndRow = row;
1201 mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1202 watermarkEndRow - watermarkStartRow, 1);
1205 mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1207 mainLayout->setColumnMinimumWidth(2, 21);
1212 titleLabel->setVisible(info.title);
1214 subTitleLabel->setVisible(info.subTitle);
1230 if (layoutInfo != info)
1232 QWizardPage *page = q->currentPage();
1240 bool expandPage = !page->layout();
1242 const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page));
1243 expandPage = pageItem->expandingDirections() & Qt::Vertical;
1245 QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1246 Q_ASSERT(bottomSpacer);
1247 bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding);
1248 pageVBoxLayout->invalidate();
1253 headerWidget->setup(info, page->title(), page->subTitle(),
1254 page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap),
1255 titleFmt, subTitleFmt, opts);
1262 pix = page->pixmap(QWizard::WatermarkPixmap);
1264 pix = q->pixmap(QWizard::WatermarkPixmap);
1271 titleLabel->setTextFormat(titleFmt);
1272 titleLabel->setText(page->title());
1276 subTitleLabel->setTextFormat(subTitleFmt);
1277 subTitleLabel->setText(page->subTitle());
1285 if (wizStyle == QWizard::MacStyle) {
1294 QPalette newPalette = QApplication::palette(pageFrame);
1296 QColor windowColor = newPalette.brush(QPalette::Window).color();
1297 windowColor.setAlpha(153);
1298 newPalette.setBrush(QPalette::Window, windowColor);
1300 QColor baseColor = newPalette.brush(QPalette::Base).color();
1301 baseColor.setAlpha(153);
1302 newPalette.setBrush(QPalette::Base, baseColor);
1304 pageFrame->setPalette(newPalette);
1312 int extraHeight = 0;
1313#if QT_CONFIG(style_windowsvista)
1314 if (isVistaThemeEnabled())
1315 extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1317 QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1318 QSize maximumSize = mainLayout->totalMaximumSize();
1319 if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1324 minimumSize.setHeight(mainLayout->totalSizeHint().height());
1326 if (q->minimumWidth() == minimumWidth) {
1328 q->setMinimumWidth(minimumWidth);
1330 if (q->minimumHeight() == minimumHeight) {
1332 q->setMinimumHeight(minimumHeight);
1334 if (q->maximumWidth() == maximumWidth) {
1335 maximumWidth = maximumSize.width();
1336 q->setMaximumWidth(maximumWidth);
1338 if (q->maximumHeight() == maximumHeight) {
1339 maximumHeight = maximumSize.height();
1340 q->setMaximumHeight(maximumHeight);
1347 if (q->currentPage()) {
1348 canContinue = (q->nextId() != -1);
1349 canFinish = q->currentPage()->isFinalPage();
1361 case QWizard::CommitButton:
1362 return u"qt_wizard_commit"_s;
1363 case QWizard::FinishButton:
1364 return u"qt_wizard_finish"_s;
1365 case QWizard::CancelButton:
1366 return u"qt_wizard_cancel"_s;
1367 case QWizard::BackButton:
1368 case QWizard::NextButton:
1369 case QWizard::HelpButton:
1370 case QWizard::CustomButton1:
1371 case QWizard::CustomButton2:
1372 case QWizard::CustomButton3:
1374 return "__qt__passive_wizardbutton"_L1 + QString::number(which);
1375 case QWizard::Stretch:
1376 case QWizard::NoButton:
1381 Q_UNREACHABLE_RETURN(QString());
1387 if (uint(which) >= QWizard::NButtons)
1391 QPushButton *pushButton =
new QPushButton(antiFlickerWidget);
1392 QStyle *style = q->style();
1393 if (style != QApplication::style())
1394 pushButton->setStyle(style);
1395 pushButton->setObjectName(object_name_for_button(which));
1397 pushButton->setAutoDefault(
false);
1401 const_cast<QWizardPrivate *>(
this)->btns[which] = pushButton;
1403 btns[which] = pushButton;
1405 if (which < QWizard::NStandardButtons)
1406 pushButton->setText(buttonDefaultText(wizStyle, which,
this));
1408 connectButton(which);
1416 if (which < QWizard::NStandardButtons) {
1417 QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1419 QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1426 for (
int i = 0; i < QWizard::NButtons; ++i) {
1428 if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1429 btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1430 else if (buttonCustomTexts.contains(i))
1431 btns[i]->setText(buttonCustomTexts.value(i));
1432 else if (i < QWizard::NStandardButtons)
1433 btns[i]->setText(buttonDefaultText(wizStyle, i,
this));
1439#if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1440 if (btns[QWizard::NextButton] && isVistaThemeEnabled()) {
1441 if (vistaNextShortcut.isNull()) {
1443 new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right),
1444 btns[QWizard::NextButton], SLOT(animateClick()));
1447 delete vistaNextShortcut;
1455 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array{
1456 buttonsCustomLayout.cbegin(), buttonsCustomLayout.cend()};
1457 setButtonLayout(array.constData(),
int(array.size()));
1462 const int ArraySize = 12;
1463 QWizard::WizardButton array[ArraySize];
1464 memset(array, -1,
sizeof(array));
1465 Q_ASSERT(array[0] == QWizard::NoButton);
1467 if (opts & QWizard::HaveHelpButton) {
1468 int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1469 array[i] = QWizard::HelpButton;
1471 array[1] = QWizard::Stretch;
1472 if (opts & QWizard::HaveCustomButton1)
1473 array[2] = QWizard::CustomButton1;
1474 if (opts & QWizard::HaveCustomButton2)
1475 array[3] = QWizard::CustomButton2;
1476 if (opts & QWizard::HaveCustomButton3)
1477 array[4] = QWizard::CustomButton3;
1479 if (!(opts & QWizard::NoCancelButton)) {
1480 int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1481 array[i] = QWizard::CancelButton;
1483 array[6] = QWizard::BackButton;
1484 array[7] = QWizard::NextButton;
1485 array[8] = QWizard::CommitButton;
1486 array[9] = QWizard::FinishButton;
1488 setButtonLayout(array, ArraySize);
1496 for (
int i = buttonLayout->count() - 1; i >= 0; --i) {
1497 QLayoutItem *item = buttonLayout->takeAt(i);
1498 if (
QWidget *widget = item->widget())
1503 for (
int i = 0; i < size; ++i) {
1504 QWizard::WizardButton which = array[i];
1505 if (which == QWizard::Stretch) {
1506 buttonLayout->addStretch(1);
1507 }
else if (which != QWizard::NoButton) {
1508 ensureButton(which);
1509 buttonLayout->addWidget(btns[which]);
1512 if (which != QWizard::BackButton && which != QWizard::NextButton
1513 && which != QWizard::CommitButton && which != QWizard::FinishButton)
1514 btns[which]->show();
1517 QWidget::setTabOrder(prev, btns[which]);
1527 return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
1533 if (which == QWizard::BackgroundPixmap) {
1534 if (wizStyle == QWizard::MacStyle) {
1536 q->updateGeometry();
1543#if QT_CONFIG(style_windowsvista)
1544bool QWizardPrivate::vistaDisabled()
const
1547 const QVariant v = q->property(
"_q_wizard_vista_off");
1548 return v.isValid() && v.toBool();
1551bool QWizardPrivate::handleAeroStyleChange()
1555 if (inHandleAeroStyleChange)
1561 const bool isWindow = q->isWindow();
1562 if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1564 inHandleAeroStyleChange =
true;
1566 vistaHelper->disconnectBackButton();
1567 q->removeEventFilter(vistaHelper);
1569 bool vistaMargins =
false;
1571 if (isVistaThemeEnabled()) {
1572 const int topOffset = vistaHelper->topOffset(q);
1573 const int topPadding = vistaHelper->topPadding(q);
1575 vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1576 q->installEventFilter(vistaHelper);
1578 q->setMouseTracking(
true);
1579 antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1580 vistaHelper->backButton()->move(
1582 - qMin(topOffset, topPadding + 1));
1583 vistaMargins =
true;
1584 vistaHelper->backButton()->show();
1586 vistaHelper->setTitleBarIconAndCaptionVisible(
false);
1588 vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1589 vistaHelper->backButton()->show();
1591 q->setMouseTracking(
true);
1595 antiFlickerWidget->move(0, 0);
1596 vistaHelper->hideBackButton();
1598 vistaHelper->setTitleBarIconAndCaptionVisible(
true);
1601 _q_updateButtonStates();
1603 vistaHelper->updateCustomMargins(vistaMargins);
1605 inHandleAeroStyleChange =
false;
1612#if QT_CONFIG(style_windowsvista)
1613 return wizStyle == QWizard::AeroStyle && !vistaDisabled();
1623 q->setUpdatesEnabled(
false);
1633 q->setUpdatesEnabled(
true);
1640 QObject *button = q->sender();
1641 for (
int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1642 if (btns[i] == button) {
1643 emit q->customButtonClicked(QWizard::WizardButton(i));
1655 const QWizardPage *page = q->currentPage();
1656 bool complete = page && page->isComplete();
1658 btn.back->setEnabled(history.size() > 1
1659 && !q->page(history.at(history.size() - 2))->isCommitPage()
1660 && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage)));
1661 btn.next->setEnabled(canContinue && complete);
1662 btn.commit->setEnabled(canContinue && complete);
1663 btn.finish->setEnabled(canFinish && complete);
1665 const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1666 && (history.size() > 1 || !(opts & QWizard::NoBackButtonOnStartPage))
1667 && (canContinue || !(opts & QWizard::NoBackButtonOnLastPage));
1668 bool commitPage = page && page->isCommitPage();
1669 btn.back->setVisible(backButtonVisible);
1670 btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1671 && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage)));
1672 btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1674 btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1675 && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
1677 if (!(opts & QWizard::NoCancelButton))
1678 btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1679 && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
1681 bool useDefault = !(opts & QWizard::NoDefaultButton);
1682 if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1683 nextPush->setDefault(canContinue && useDefault && !commitPage);
1684 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1685 commitPush->setDefault(canContinue && useDefault && commitPage);
1686 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1687 finishPush->setDefault(!canContinue && useDefault);
1689#if QT_CONFIG(style_windowsvista)
1690 if (isVistaThemeEnabled()) {
1691 vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1692 vistaHelper->backButton()->setVisible(backButtonVisible);
1693 btn.back->setVisible(
false);
1702 int destroyed_index = -1;
1703 QList<QWizardField>::iterator it = fields.begin();
1704 while (it != fields.end()) {
1706 if (field.object == object) {
1707 destroyed_index = fieldIndexMap.value(field.name, -1);
1708 fieldIndexMap.remove(field.name);
1709 it = fields.erase(it);
1714 if (destroyed_index != -1) {
1715 QMap<QString,
int>::iterator it2 = fieldIndexMap.begin();
1716 while (it2 != fieldIndexMap.end()) {
1717 int index = it2.value();
1718 if (index > destroyed_index) {
1719 QString field_name = it2.key();
1720 fieldIndexMap.insert(field_name, index-1);
1729 for (
int i = 0; i < QWizard::NButtons; i++)
1731 btns[i]->setStyle(style);
1732 const PageMap::const_iterator pcend = pageMap.constEnd();
1733 for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1734 it.value()->setStyle(style);
1738QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1740 auto *keyboardAssistantURL = [NSWorkspace.sharedWorkspace
1741 URLForApplicationWithBundleIdentifier:@
"com.apple.KeyboardSetupAssistant"];
1742 auto *keyboardAssistantBundle = [NSBundle bundleWithURL:keyboardAssistantURL];
1743 auto *assistantBackground = [keyboardAssistantBundle imageForResource:@
"Background"];
1744 auto size = QSizeF::fromCGSize(assistantBackground.size);
1745 static const QSizeF expectedSize(242, 414);
1746 if (size == expectedSize)
1747 return qt_mac_toQPixmap(assistantBackground, size);
1753#if QT_CONFIG(style_windowsvista)
1754void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
1756 if (wizardPrivate->isVistaThemeEnabled()) {
1757 int leftMargin, topMargin, rightMargin, bottomMargin;
1758 wizardPrivate->buttonLayout->getContentsMargins(
1759 &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1760 const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1761 QPainter painter(
this);
1762 const QBrush brush(QColor(240, 240, 240));
1763 painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1764 painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0));
1765 painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
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
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
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
2140
2141
2142
2143
2144
2145
2146
2149
2150
2151
2152
2153QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
2154 : QDialog(*
new QWizardPrivate, parent, flags)
2161
2162
2166 delete d->buttonLayout;
2170
2171
2172
2173
2174
2175
2176
2177int QWizard::addPage(QWizardPage *page)
2181 if (!d->pageMap.isEmpty())
2182 theid = d->pageMap.lastKey() + 1;
2183 setPage(theid, page);
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197void QWizard::setPage(
int theid, QWizardPage *page)
2201 if (Q_UNLIKELY(!page)) {
2202 qWarning(
"QWizard::setPage: Cannot insert null page");
2206 if (Q_UNLIKELY(theid == -1)) {
2207 qWarning(
"QWizard::setPage: Cannot insert page with ID -1");
2211 if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2212 qWarning(
"QWizard::setPage: Page with duplicate ID %d ignored", theid);
2216 page->setParent(d->pageFrame);
2218 QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2219 for (
const auto &field : std::as_const(pendingFields))
2221 pendingFields.clear();
2223 connect(page, SIGNAL(completeChanged()),
this, SLOT(_q_updateButtonStates()));
2225 d->pageMap.insert(theid, page);
2226 page->d_func()->wizard =
this;
2228 int n = d->pageVBoxLayout->count();
2231 bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2232 d->pageVBoxLayout->setEnabled(
false);
2234 d->pageVBoxLayout->insertWidget(n - 1, page);
2238 d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2240 if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2242 emit pageAdded(theid);
2246
2247
2248
2249
2250
2251
2252void QWizard::removePage(
int id)
2256 QWizardPage *removedPage =
nullptr;
2259 if (d->pageMap.size() > 0) {
2260 if (d->start == id) {
2261 const int firstId = d->pageMap.constBegin().key();
2262 if (firstId == id) {
2263 if (d->pageMap.size() > 1)
2264 d->start = (++d->pageMap.constBegin()).key();
2270 d->startSetByUser =
false;
2274 if (d->pageMap.contains(id))
2275 emit pageRemoved(id);
2277 if (!d->history.contains(id)) {
2279 removedPage = d->pageMap.take(id);
2280 d->updateCurrentPage();
2281 }
else if (id != d->current) {
2283 removedPage = d->pageMap.take(id);
2284 d->history.removeOne(id);
2285 d->_q_updateButtonStates();
2286 }
else if (d->history.size() == 1) {
2289 removedPage = d->pageMap.take(id);
2290 if (d->pageMap.isEmpty())
2291 d->updateCurrentPage();
2297 removedPage = d->pageMap.take(id);
2298 d->updateCurrentPage();
2302 if (removedPage->d_func()->initialized) {
2304 removedPage->d_func()->initialized =
false;
2307 d->pageVBoxLayout->removeWidget(removedPage);
2309 for (
int i = d->fields.size() - 1; i >= 0; --i) {
2310 if (d->fields.at(i).page == removedPage) {
2311 removedPage->d_func()->pendingFields += d->fields.at(i);
2312 d->removeFieldAt(i);
2319
2320
2321
2322
2323
2324
2325
2326QWizardPage *QWizard::page(
int theid)
const
2329 return d->pageMap.value(theid);
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342bool QWizard::hasVisitedPage(
int theid)
const
2345 return d->history.contains(theid);
2349
2350
2351
2352
2353
2354
2355
2356QList<
int> QWizard::visitedIds()
const
2363
2364
2365QList<
int> QWizard::pageIds()
const
2368 return d->pageMap.keys();
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381void QWizard::setStartId(
int theid)
2384 int newStart = theid;
2386 newStart = d->pageMap.size() ? d->pageMap.constBegin().key() : -1;
2388 if (d->start == newStart) {
2389 d->startSetByUser = theid != -1;
2393 if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2394 qWarning(
"QWizard::setStartId: Invalid page ID %d", newStart);
2397 d->start = newStart;
2398 d->startSetByUser = theid != -1;
2401int QWizard::startId()
const
2408
2409
2410
2411
2412
2413
2414
2415QWizardPage *QWizard::currentPage()
const
2418 return page(d->current);
2422
2423
2424
2425
2426
2427
2428
2429
2430int QWizard::currentId()
const
2437
2438
2439
2440
2441
2442
2443void QWizard::setField(
const QString &name,
const QVariant &value)
2447 int index = d->fieldIndexMap.value(name, -1);
2448 if (Q_UNLIKELY(index == -1)) {
2449 qWarning(
"QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2453 const QWizardField &field = d->fields.at(index);
2454 if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2455 qWarning(
"QWizard::setField: Couldn't write to property '%s'",
2456 field.property.constData());
2460
2461
2462
2463
2464
2465
2466QVariant QWizard::field(
const QString &name)
const
2470 int index = d->fieldIndexMap.value(name, -1);
2471 if (Q_UNLIKELY(index == -1)) {
2472 qWarning(
"QWizard::field: No such field '%ls'", qUtf16Printable(name));
2476 const QWizardField &field = d->fields.at(index);
2477 return field.object->property(field.property);
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492void QWizard::setWizardStyle(WizardStyle style)
2496 const bool styleChange = style != d->wizStyle;
2498#if QT_CONFIG(style_windowsvista)
2499 const bool aeroStyleChange =
2500 d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2501 d->vistaStateChanged =
false;
2502 d->vistaInitPending =
false;
2506#if QT_CONFIG(style_windowsvista)
2510 d->disableUpdates();
2511 d->wizStyle = style;
2512 d->updateButtonTexts();
2513#if QT_CONFIG(style_windowsvista)
2514 if (aeroStyleChange) {
2517 QResizeEvent ev(geometry().size(), geometry().size());
2518 QCoreApplication::sendEvent(
this, &ev);
2524#if QT_CONFIG(style_windowsvista)
2526 if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2527 d->vistaInitPending =
true;
2532QWizard::WizardStyle QWizard::wizardStyle()
const
2539
2540
2541
2542
2543
2544void QWizard::setOption(WizardOption option,
bool on)
2547 if (!(d->opts & option) != !on)
2548 setOptions(d->opts ^ option);
2552
2553
2554
2555
2556
2557bool QWizard::testOption(WizardOption option)
const
2560 return (d->opts & option) != 0;
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577void QWizard::setOptions(WizardOptions options)
2581 WizardOptions changed = (options ^ d->opts);
2585 d->disableUpdates();
2588 if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2589 d->cleanupPagesNotInHistory();
2591 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
2592 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
2593 | HaveCustomButton3)) {
2594 d->updateButtonLayout();
2595 }
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2596 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
2597 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
2598 d->_q_updateButtonStates();
2605QWizard::WizardOptions QWizard::options()
const
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628void QWizard::setButtonText(WizardButton which,
const QString &text)
2632 if (!d->ensureButton(which))
2635 d->buttonCustomTexts.insert(which, text);
2637 if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2638 d->btns[which]->setText(text);
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653QString QWizard::buttonText(WizardButton which)
const
2657 if (!d->ensureButton(which))
2660 if (d->buttonCustomTexts.contains(which))
2661 return d->buttonCustomTexts.value(which);
2663 const QString defText = buttonDefaultText(d->wizStyle, which, d);
2664 if (!defText.isNull())
2667 return d->btns[which]->text();
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688void QWizard::setButtonLayout(
const QList<WizardButton> &layout)
2692 for (
int i = 0; i < layout.size(); ++i) {
2693 WizardButton button1 = layout.at(i);
2695 if (button1 == NoButton || button1 == Stretch)
2697 if (!d->ensureButton(button1))
2701 for (
int j = 0; j < i; ++j) {
2702 WizardButton button2 = layout.at(j);
2703 if (Q_UNLIKELY(button2 == button1)) {
2704 qWarning(
"QWizard::setButtonLayout: Duplicate button in layout");
2710 d->buttonsHaveCustomLayout =
true;
2711 d->buttonsCustomLayout = layout;
2712 d->updateButtonLayout();
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725void QWizard::setButton(WizardButton which, QAbstractButton *button)
2729 if (uint(which) >= NButtons || d->btns[which] == button)
2732 if (QAbstractButton *oldButton = d->btns[which]) {
2733 d->buttonLayout->removeWidget(oldButton);
2737 d->btns[which] = button;
2739 button->setParent(d->antiFlickerWidget);
2740 d->buttonCustomTexts.insert(which, button->text());
2741 d->connectButton(which);
2743 d->buttonCustomTexts.remove(which);
2744 d->ensureButton(which);
2747 d->updateButtonLayout();
2751
2752
2753
2754
2755QAbstractButton *QWizard::button(WizardButton which)
const
2758#if QT_CONFIG(style_windowsvista)
2759 if (d->wizStyle == AeroStyle && which == BackButton)
2760 return d->vistaHelper->backButton();
2762 if (!d->ensureButton(which))
2764 return d->btns[which];
2768
2769
2770
2771
2772
2773
2774
2775void QWizard::setTitleFormat(Qt::TextFormat format)
2778 d->titleFmt = format;
2782Qt::TextFormat QWizard::titleFormat()
const
2789
2790
2791
2792
2793
2794
2795
2796void QWizard::setSubTitleFormat(Qt::TextFormat format)
2799 d->subTitleFmt = format;
2803Qt::TextFormat QWizard::subTitleFormat()
const
2806 return d->subTitleFmt;
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821void QWizard::setPixmap(WizardPixmap which,
const QPixmap &pixmap)
2824 Q_ASSERT(uint(which) < NPixmaps);
2825 d->defaultPixmaps[which] = pixmap;
2826 d->updatePixmap(which);
2830
2831
2832
2833
2834
2835
2836
2837QPixmap QWizard::pixmap(WizardPixmap which)
const
2840 Q_ASSERT(uint(which) < NPixmaps);
2842 if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2843 d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2845 return d->defaultPixmaps[which];
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873void QWizard::setDefaultProperty(
const char *className,
const char *property,
2874 const char *changedSignal)
2877 for (
int i = d->defaultPropertyTable.size() - 1; i >= 0; --i) {
2878 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2879 d->defaultPropertyTable.remove(i);
2883 d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908void QWizard::setSideWidget(QWidget *widget)
2912 d->sideWidget = widget;
2913 if (d->watermarkLabel) {
2914 d->watermarkLabel->setSideWidget(widget);
2920
2921
2922
2923
2924QWidget *QWizard::sideWidget()
const
2928 return d->sideWidget;
2932
2933
2934void QWizard::setVisible(
bool visible)
2938 if (d->current == -1)
2941 QDialog::setVisible(visible);
2945
2946
2947QSize QWizard::sizeHint()
const
2950 QSize result = d->mainLayout->totalSizeHint();
2951 QSize extra(500, 360);
2952 if (d->wizStyle == MacStyle && d->current != -1) {
2953 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());
2954 extra.setWidth(616);
2955 if (!pixmap.isNull()) {
2956 extra.setHeight(pixmap.height());
2959
2960
2961
2962
2963
2964 if (pixmap.width() >= pixmap.height())
2965 extra.setWidth(pixmap.width());
2968 return result.expandedTo(extra);
2972
2973
2974
2975
2976
2977
2978
2981
2982
2983
2984
2985
2986
2987
2990
2991
2992
2993
2994
2995
2996
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3040
3041
3042
3043
3044
3045
3049 int n = d->history.size() - 2;
3052 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3056
3057
3058
3059
3060
3061
3066 if (d->current == -1)
3069 if (validateCurrentPage()) {
3070 int next = nextId();
3072 if (Q_UNLIKELY(d->history.contains(next))) {
3073 qWarning(
"QWizard::next: Page %d already met", next);
3076 if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3077 qWarning(
"QWizard::next: No such page %d", next);
3080 d->switchToPage(next, QWizardPrivate::Forward);
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3100void QWizard::setCurrentId(
int id)
3104 if (d->current == -1)
3107 if (currentId() == id)
3110 if (!validateCurrentPage())
3113 if (id < 0 || Q_UNLIKELY(!d->pageMap.contains(id))) {
3114 qWarning(
"QWizard::setCurrentId: No such page: %d", id);
3118 d->switchToPage(id, (id < currentId()) ? QWizardPrivate::Backward : QWizardPrivate::Forward);
3122
3123
3124
3125
3126
3127void QWizard::restart()
3130 d->disableUpdates();
3132 d->switchToPage(startId(), QWizardPrivate::Forward);
3137
3138
3139bool QWizard::event(QEvent *event)
3142 if (event->type() == QEvent::StyleChange) {
3143 d->setStyle(style());
3145 }
else if (event->type() == QEvent::PaletteChange) {
3148#if QT_CONFIG(style_windowsvista)
3149 else if (event->type() == QEvent::Show && d->vistaInitPending) {
3150 d->vistaInitPending =
false;
3151 d->wizStyle = AeroStyle;
3152 d->handleAeroStyleChange();
3154 else if (d->isVistaThemeEnabled()) {
3155 if (event->type() == QEvent::Resize
3156 || event->type() == QEvent::LayoutDirectionChange) {
3157 const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3158 ? width() - d->vistaHelper->backButton()->sizeHint().width()
3161 d->vistaHelper->backButton()->move(buttonLeft,
3162 d->vistaHelper->backButton()->y());
3165 d->vistaHelper->mouseEvent(event);
3168 return QDialog::event(event);
3172
3173
3174void QWizard::resizeEvent(QResizeEvent *event)
3177 int heightOffset = 0;
3178#if QT_CONFIG(style_windowsvista)
3179 if (d->isVistaThemeEnabled()) {
3180 heightOffset = d->vistaHelper->topOffset(
this);
3181 heightOffset += d->vistaHelper->titleBarSize();
3184 d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3185#if QT_CONFIG(style_windowsvista)
3186 if (d->isVistaThemeEnabled())
3187 d->vistaHelper->resizeEvent(event);
3189 QDialog::resizeEvent(event);
3193
3194
3195void QWizard::paintEvent(QPaintEvent * event)
3198 if (d->wizStyle == MacStyle && currentPage()) {
3199 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3200 if (backgroundPixmap.isNull())
3203 QStylePainter painter(
this);
3204 painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3206#if QT_CONFIG(style_windowsvista)
3207 else if (d->isVistaThemeEnabled()) {
3208 d->vistaHelper->paintEvent(event);
3215#if defined(Q_OS_WIN) || defined(Q_QDOC)
3217
3218
3219bool QWizard::nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result)
3221#if QT_CONFIG(style_windowsvista)
3223 if (d->isVistaThemeEnabled() && eventType ==
"windows_generic_MSG") {
3224 MSG *windowsMessage =
static_cast<MSG *>(message);
3225 const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3226 if (d->vistaDirty) {
3229 if (windowsMessage->message == WM_GETICON) {
3230 d->vistaStateChanged =
true;
3231 d->vistaDirty =
false;
3232 setWizardStyle(AeroStyle);
3235 return winEventResult;
3237 return QDialog::nativeEvent(eventType, message, result);
3240 return QDialog::nativeEvent(eventType, message, result);
3246
3247
3248void QWizard::done(
int result)
3252 if (result == Rejected) {
3255 if (!validateCurrentPage())
3258 QDialog::done(result);
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279void QWizard::initializePage(
int theid)
3281 QWizardPage *page =
this->page(theid);
3283 page->initializePage();
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297void QWizard::cleanupPage(
int theid)
3299 QWizardPage *page =
this->page(theid);
3301 page->cleanupPage();
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320bool QWizard::validateCurrentPage()
3322 QWizardPage *page = currentPage();
3326 return page->validatePage();
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343int QWizard::nextId()
const
3345 const QWizardPage *page = currentPage();
3349 return page->nextId();
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
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3420
3421
3422
3423
3424
3425
3426
3427
3428QWizardPage::QWizardPage(QWidget *parent)
3429 : QWidget(*
new QWizardPagePrivate, parent, { })
3431 connect(
this, SIGNAL(completeChanged()),
this, SLOT(_q_updateCachedCompleteState()));
3435
3436
3437QWizardPage::~QWizardPage()
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455void QWizardPage::setTitle(
const QString &title)
3459 if (d->wizard && d->wizard->currentPage() ==
this)
3460 d->wizard->d_func()->updateLayout();
3463QString QWizardPage::title()
const
3465 Q_D(
const QWizardPage);
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488void QWizardPage::setSubTitle(
const QString &subTitle)
3491 d->subTitle = subTitle;
3492 if (d->wizard && d->wizard->currentPage() ==
this)
3493 d->wizard->d_func()->updateLayout();
3496QString QWizardPage::subTitle()
const
3498 Q_D(
const QWizardPage);
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515void QWizardPage::setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap)
3518 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3519 d->pixmaps[which] = pixmap;
3520 if (d->wizard && d->wizard->currentPage() ==
this)
3521 d->wizard->d_func()->updatePixmap(which);
3525
3526
3527
3528
3529
3530
3531
3532
3533QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which)
const
3535 Q_D(
const QWizardPage);
3536 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3538 const QPixmap &pixmap = d->pixmaps[which];
3539 if (!pixmap.isNull())
3543 return wizard()->pixmap(which);
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565void QWizardPage::initializePage()
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580void QWizardPage::cleanupPage()
3584 const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3585 for (
const auto &field : fields) {
3586 if (field.page ==
this)
3587 field.object->setProperty(field.property, field.initialValue);
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606bool QWizardPage::validatePage()
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628bool QWizardPage::isComplete()
const
3630 Q_D(
const QWizardPage);
3635 const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3636 const auto end = wizardFields.crend();
3637 for (
auto it = wizardFields.crbegin(); it != end; ++it) {
3638 const QWizardField &field = *it;
3639 if (field.page ==
this && field.mandatory) {
3640 QVariant value = field.object->property(field.property);
3641 if (value == field.initialValue)
3644#if QT_CONFIG(lineedit)
3645 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3646 if (!lineEdit->hasAcceptableInput())
3650#if QT_CONFIG(spinbox)
3651 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3652 if (!spinBox->hasAcceptableInput())
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673void QWizardPage::setFinalPage(
bool finalPage)
3676 d->explicitlyFinal = finalPage;
3677 QWizard *wizard =
this->wizard();
3678 if (wizard && wizard->currentPage() ==
this)
3679 wizard->d_func()->updateCurrentPage();
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694bool QWizardPage::isFinalPage()
const
3696 Q_D(
const QWizardPage);
3697 if (d->explicitlyFinal)
3700 QWizard *wizard =
this->wizard();
3701 if (wizard && wizard->currentPage() ==
this) {
3703 return wizard->nextId() == -1;
3705 return nextId() == -1;
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723void QWizardPage::setCommitPage(
bool commitPage)
3726 d->commit = commitPage;
3727 QWizard *wizard =
this->wizard();
3728 if (wizard && wizard->currentPage() ==
this)
3729 wizard->d_func()->updateCurrentPage();
3733
3734
3735
3736
3737bool QWizardPage::isCommitPage()
const
3739 Q_D(
const QWizardPage);
3744
3745
3746
3747
3748
3749
3750
3751void QWizardPage::setButtonText(QWizard::WizardButton which,
const QString &text)
3754 d->buttonCustomTexts.insert(which, text);
3755 if (wizard() && wizard()->currentPage() ==
this && wizard()->d_func()->btns[which])
3756 wizard()->d_func()->btns[which]->setText(text);
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772QString QWizardPage::buttonText(QWizard::WizardButton which)
const
3774 Q_D(
const QWizardPage);
3776 if (d->buttonCustomTexts.contains(which))
3777 return d->buttonCustomTexts.value(which);
3780 return wizard()->buttonText(which);
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801int QWizardPage::nextId()
const
3803 Q_D(
const QWizardPage);
3808 bool foundCurrentPage =
false;
3810 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3811 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();
3812 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();
3814 for (; i != end; ++i) {
3815 if (i.value() ==
this) {
3816 foundCurrentPage =
true;
3817 }
else if (foundCurrentPage) {
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3839
3840
3841
3842
3843
3844
3845
3846
3847void QWizardPage::setField(
const QString &name,
const QVariant &value)
3852 d->wizard->setField(name, value);
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868QVariant QWizardPage::field(
const QString &name)
const
3870 Q_D(
const QWizardPage);
3873 return d->wizard->field(name);
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
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922void QWizardPage::registerField(
const QString &name, QWidget *widget,
const char *property,
3923 const char *changedSignal)
3926 QWizardField field(
this, name, widget, property, changedSignal);
3928 d->wizard->d_func()->addField(field);
3930 d->pendingFields += field;
3935
3936
3937
3938
3939
3940QWizard *QWizardPage::wizard()
const
3942 Q_D(
const QWizardPage);
3948#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