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"
42#include <QtCore/private/qenumindexedarray_p.h>
49using namespace Qt::StringLiterals;
63 QSpacerItem *spacer = layout->itemAt(index)->spacerItem();
66 spacer->changeSize(width, height);
71 const int MaxIterations = 100;
74 for (
int i = 0; i < MaxIterations; ++i) {
75 candidate = candidate->nextInFocusChain();
79 if (candidate->focusPolicy() & Qt::TabFocus) {
80 if (candidate != ancestor && ancestor->isAncestorOf(candidate))
88 const QByteArray &classY)
90 const QMetaObject *metaObject = object->metaObject();
92 if (metaObject->className() == classX)
94 if (metaObject->className() == classY)
96 metaObject = metaObject->superClass();
102 const char className[16];
103 const char property[13];
104} fallbackProperties[] = {
106 {
"QAbstractButton",
"checked" },
107 {
"QAbstractSlider",
"value" },
108 {
"QComboBox",
"currentIndex" },
109 {
"QDateTimeEdit",
"dateTime" },
110 {
"QLineEdit",
"text" },
111 {
"QListWidget",
"currentRow" },
112 {
"QSpinBox",
"value" },
124 case 0:
return SIGNAL(toggled(
bool));
125 case 1:
return SIGNAL(valueChanged(
int));
126 case 2:
return SIGNAL(currentIndexChanged(
int));
127 case 3:
return SIGNAL(dateTimeChanged(QDateTime));
128 case 4:
return SIGNAL(textChanged(QString));
129 case 5:
return SIGNAL(currentRowChanged(
int));
130 case 6:
return SIGNAL(valueChanged(
int));
132 static_assert(7 == NFallbackDefaultProperties);
133 Q_UNREACHABLE_RETURN(
nullptr);
145 const char *changedSignal)
154 QWizardField(QWizardPage *page,
const QString &spec, QObject *object,
const char *property,
155 const char *changedSignal);
157 void resolve(
const QList<QWizardDefaultProperty> &defaultPropertyTable);
171 const char *property,
const char *changedSignal)
175 if (name.endsWith(u'*')) {
183 if (property.isEmpty())
184 findProperty(defaultPropertyTable.constData()
, defaultPropertyTable.size()
);
185 initialValue = object->property(property);
190 QByteArray className;
192 for (
int i = 0; i < propertyCount; ++i) {
193 if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)) {
194 className = properties[i].className;
195 property = properties[i].property;
196 changedSignal = properties[i].changedSignal;
229 return topLevelMarginLeft == other.topLevelMarginLeft
230 && topLevelMarginRight == other.topLevelMarginRight
231 && topLevelMarginTop == other.topLevelMarginTop
232 && topLevelMarginBottom == other.topLevelMarginBottom
233 && childMarginLeft == other.childMarginLeft
234 && childMarginRight == other.childMarginRight
235 && childMarginTop == other.childMarginTop
236 && childMarginBottom == other.childMarginBottom
237 && hspacing == other.hspacing
238 && vspacing == other.vspacing
239 && buttonSpacing == other.buttonSpacing
240 && wizStyle == other.wizStyle
241 && header == other.header
242 && watermark == other.watermark
243 && title == other.title
244 && subTitle == other.subTitle
245 && extension == other.extension
246 && sideWidget == other.sideWidget;
262 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
263 std::optional<Qt::TextFormat> titleFormat,
264 std::optional<Qt::TextFormat> subTitleFormat,
265 QWizard::WizardOptions wizardOptions);
269#if QT_CONFIG(style_windowsvista)
275 QLabel *subTitleLabel;
278 QPixmap bannerPixmap;
285 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
286 setBackgroundRole(QPalette::Base);
288 titleLabel =
new QLabel(
this);
289 titleLabel->setBackgroundRole(QPalette::Base);
291 subTitleLabel =
new QLabel(
this);
292 subTitleLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
293 subTitleLabel->setWordWrap(
true);
295 logoLabel =
new QLabel(
this);
297 QFont font = titleLabel->font();
299 titleLabel->setFont(font);
301 layout =
new QGridLayout(
this);
302 layout->setContentsMargins(QMargins());
303 layout->setSpacing(0);
305 layout->setRowMinimumHeight(3, 1);
306 layout->setRowStretch(4, 1);
308 layout->setColumnStretch(2, 1);
309 layout->setColumnMinimumWidth(4, 2 * GapBetweenLogoAndRightEdge);
310 layout->setColumnMinimumWidth(6, GapBetweenLogoAndRightEdge);
312 layout->addWidget(titleLabel, 2, 1, 1, 2);
313 layout->addWidget(subTitleLabel, 4, 2);
314 layout->addWidget(logoLabel, 1, 5, 5, 1);
317#if QT_CONFIG(style_windowsvista)
318bool QWizardHeader::vistaDisabled()
const
320 bool styleDisabled =
false;
321 QWizard *wiz = parentWidget() ? qobject_cast <QWizard *>(parentWidget()->parentWidget()) : 0;
325 const QVariant v = wiz->property(
"_q_wizard_vista_off");
326 styleDisabled = v.isValid() && v.toBool();
328 return styleDisabled;
333 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
334 std::optional<Qt::TextFormat> titleFormat,
335 std::optional<Qt::TextFormat> subTitleFormat,
336 QWizard::WizardOptions options)
338 bool modern = ((info.wizStyle == QWizard::ModernStyle)
339#if QT_CONFIG(style_windowsvista)
343 wizardOptions = options;
344 layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0);
345 layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0);
346 layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2);
351 layout->setColumnMinimumWidth(0, minColumnWidth0);
352 layout->setColumnMinimumWidth(1, minColumnWidth1);
355 titleLabel->setTextFormat(titleFormat.value());
356 titleLabel->setText(title);
357 logoLabel->setPixmap(logo);
360 subTitleLabel->setTextFormat(subTitleFormat.value());
361 subTitleLabel->setText(
"Pq\nPq"_L1);
362 int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
363 subTitleLabel->setText(subTitle);
366 bannerPixmap = banner;
368 bannerPixmap = QPixmap();
371 if (bannerPixmap.isNull() || wizardOptions.testFlag(QWizard::StretchBanner)) {
373
374
375 int candidateSubTitleWidth = qMin(512, 2 * QGuiApplication::primaryScreen()->virtualGeometry().width() / 3);
376 int delta = candidateSubTitleWidth >> 1;
378 if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
379 <= desiredSubTitleHeight)
380 candidateSubTitleWidth -= delta;
384 subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight);
386 QSize size = layout->totalMinimumSize();
387 setMinimumSize(size);
388 setMaximumSize(QWIDGETSIZE_MAX, size.height());
390 subTitleLabel->setMinimumSize(0, 0);
391 setFixedSize(banner.size() + QSize(0, 2));
399 if (wizardOptions.testFlag(QWizard::StretchBanner)) {
400 painter.setRenderHint(QPainter::SmoothPixmapTransform);
401 painter.drawPixmap(0, 0, width(), height(), bannerPixmap);
403 painter.drawPixmap(0, 0, bannerPixmap);
409 const qreal dpr = devicePixelRatio();
410 const int devHeight = qRound(height() * dpr);
411 const int devWidth = qRound(width() * dpr);
413 const qreal x = (devWidth - 2) / dpr;
414 const qreal y = (devHeight - 2) / dpr;
416 const qreal x1 = (devWidth - 1) / dpr;
417 const qreal y1 = (devHeight - 1) / dpr;
419 const QPalette &pal = palette();
420 painter.setPen(pal.mid().color());
421 painter.drawLine(QLineF(0, y, x, y));
422 painter.setPen(pal.base().color());
423 painter.drawPoint(QPointF(x1, y));
424 painter.drawLine(QLineF(0, y1, x1, y1));
439 m_layout =
new QVBoxLayout(
this);
441 m_layout->addWidget(m_sideWidget);
445 if (!pixmap().isNull())
446 return pixmap().deviceIndependentSize().toSize();
447 return QLabel::minimumSizeHint();
451 if (m_sideWidget == widget)
454 m_layout->removeWidget(m_sideWidget);
455 m_sideWidget->hide();
457 m_sideWidget = widget;
459 m_layout->addWidget(m_sideWidget);
465 QVBoxLayout *m_layout;
471 Q_DECLARE_PUBLIC(QWizardPage)
494 Q_Q(
const QWizardPage);
495 if (completeState == Tri_Unknown)
496 completeState = q->isComplete() ? Tri_True : Tri_False;
497 return completeState == Tri_True;
503 TriState newState = q->isComplete() ? Tri_True : Tri_False;
504 if (newState != completeState)
505 emit q->completeChanged();
511 completeState = q->isComplete() ? Tri_True : Tri_False;
517#if QT_CONFIG(style_windowsvista)
533 Q_DECLARE_PUBLIC(QWizard)
562#if QT_CONFIG(style_windowsvista)
602 QAbstractButton *back;
603 QAbstractButton *next;
604 QAbstractButton *commit;
605 QAbstractButton *finish;
606 QAbstractButton *cancel;
607 QAbstractButton *help;
609 mutable QAbstractButton *btns[QWizard::NButtons];
626#if QT_CONFIG(style_windowsvista)
628# if QT_CONFIG(shortcut)
644#if !QT_CONFIG(style_windowsvista)
645 Q_UNUSED(wizardPrivate);
647 const bool macStyle = (wstyle == QWizard::MacStyle);
649 case QWizard::BackButton:
650 return macStyle ? QWizard::tr(
"Go Back") : QWizard::tr(
"< &Back");
651 case QWizard::NextButton:
653 return QWizard::tr(
"Continue");
656 ? QWizard::tr(
"&Next") : QWizard::tr(
"&Next >");
657 case QWizard::CommitButton:
658 return QWizard::tr(
"Commit");
659 case QWizard::FinishButton:
660 return macStyle ? QWizard::tr(
"Done") : QWizard::tr(
"&Finish");
661 case QWizard::CancelButton:
662 return QWizard::tr(
"Cancel");
663 case QWizard::HelpButton:
664 return macStyle ? QWizard::tr(
"Help") : QWizard::tr(
"&Help");
674 std::fill(btns, btns + QWizard::NButtons,
nullptr);
677 wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle,
nullptr, q));
679 case QWizard::ModernStyle:
680 opts = QWizard::HelpButtonOnRight;
682 case QWizard::MacStyle:
683 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
685#if QT_CONFIG(style_windowsvista)
686 case QWizard::AeroStyle:
687 vistaInitPending =
true;
693#if QT_CONFIG(style_windowsvista)
694 vistaHelper =
new QVistaHelper(q);
698 ensureButton(QWizard::BackButton);
699 ensureButton(QWizard::NextButton);
700 ensureButton(QWizard::CommitButton);
701 ensureButton(QWizard::FinishButton);
703 pageFrame =
new QFrame(antiFlickerWidget);
704 pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
706 pageVBoxLayout =
new QVBoxLayout(pageFrame);
707 pageVBoxLayout->setSpacing(0);
708 pageVBoxLayout->addSpacing(0);
709 QSpacerItem *spacerItem =
new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
710 pageVBoxLayout->addItem(spacerItem);
712 buttonLayout =
new QHBoxLayout;
713 mainLayout =
new QGridLayout(antiFlickerWidget);
714 mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
718 defaultPropertyTable.reserve(NFallbackDefaultProperties);
719 for (uint i = 0; i < NFallbackDefaultProperties; ++i)
720 defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
721 fallbackProperties[i].property,
729 q->currentPage()->hide();
731 const auto end = history.crend();
732 for (
auto it = history.crbegin(); it != end; ++it)
735 for (QWizardPage *page : std::as_const(pageMap))
736 page->d_func()->initialized =
false;
739 emit q->currentIdChanged(-1);
747 for (
auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
748 const auto idx = it.key();
749 const auto page = it.value()->d_func();
750 if (page->initialized && !history.contains(idx)) {
752 page->initialized =
false;
762 myField.resolve(defaultPropertyTable);
764 if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
765 qWarning(
"QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
769 fieldIndexMap.insert(myField.name, fields.size());
771 if (myField.mandatory && !myField.changedSignal.isEmpty())
772 QObject::connect(myField.object, myField.changedSignal,
773 myField.page, SLOT(_q_maybeEmitCompleteChanged()));
775 myField.object, SIGNAL(destroyed(QObject*)), q,
776 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
784 fieldIndexMap.remove(field.name);
785 if (field.mandatory && !field.changedSignal.isEmpty())
786 QObject::disconnect(field.object, field.changedSignal,
787 field.page, SLOT(_q_maybeEmitCompleteChanged()));
789 field.object, SIGNAL(destroyed(QObject*)), q,
790 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
791 fields.remove(index);
801 if (QWizardPage *oldPage = q->currentPage()) {
805 if (!(opts & QWizard::IndependentPages)) {
806 q->cleanupPage(oldId);
807 oldPage->d_func()->initialized =
false;
809 Q_ASSERT(history.constLast() == oldId);
810 history.removeLast();
811 Q_ASSERT(history.constLast() == newId);
817 QWizardPage *newPage = q->currentPage();
820 if (!newPage->d_func()->initialized) {
821 newPage->d_func()->initialized =
true;
822 q->initializePage(current);
824 history.append(current);
830 canFinish = (newPage && newPage->isFinalPage());
835 const QWizard::WizardButton nextOrCommit =
836 newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
837 QAbstractButton *nextOrFinishButton =
838 btns[canContinue ? nextOrCommit : QWizard::FinishButton];
842
843
844
845
846
847
848
849
850 if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
851 candidate = nextOrFinishButton;
852 }
else if (newPage) {
853 candidate = iWantTheFocus(newPage);
856 candidate = nextOrFinishButton;
857 candidate->setFocus();
859 if (wizStyle == QWizard::MacStyle)
866 emit q->currentIdChanged(current);
873 case QWizard::BackButton:
875 case QWizard::NextButton:
876 case QWizard::CommitButton:
878 case QWizard::FinishButton:
879 return SLOT(accept());
880 case QWizard::CancelButton:
881 return SLOT(reject());
882 case QWizard::HelpButton:
883 return SIGNAL(helpRequested());
884 case QWizard::CustomButton1:
885 case QWizard::CustomButton2:
886 case QWizard::CustomButton3:
887 case QWizard::Stretch:
888 case QWizard::NoButton:
897 QStyle *style = q->style();
903 const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option, q);
908 info
.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, titleLabel);
909 info
.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, titleLabel);
910 info
.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, titleLabel);
911 info
.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, titleLabel);
912 info
.hspacing = (layoutHorizontalSpacing == -1)
913 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
914 : layoutHorizontalSpacing;
915 info
.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option, q);
917 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)
918 : layoutHorizontalSpacing;
920 if (wizStyle == QWizard::MacStyle)
923 info.wizStyle = wizStyle;
924 if (info.wizStyle == QWizard::AeroStyle
925#if QT_CONFIG(style_windowsvista)
929 info.wizStyle = QWizard::ModernStyle;
932 QString subTitleText;
933 QPixmap backgroundPixmap;
934 QPixmap watermarkPixmap;
936 if (QWizardPage *page = q->currentPage()) {
937 titleText = page->title();
938 subTitleText = page->subTitle();
939 backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
940 watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
943 info
.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
944 && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
946 info
.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
947 && !watermarkPixmap.isNull();
949 info
.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
960
961
962 for (
int i = mainLayout->count() - 1; i >= 0; --i) {
963 QLayoutItem *item = mainLayout->takeAt(i);
964 if (item->layout()) {
965 item->layout()->setParent(
nullptr);
970 for (
int i = mainLayout->columnCount() - 1; i >= 0; --i)
971 mainLayout->setColumnMinimumWidth(i, 0);
972 for (
int i = mainLayout->rowCount() - 1; i >= 0; --i)
973 mainLayout->setRowMinimumHeight(i, 0);
976
977
979 bool mac = (info.wizStyle == QWizard::MacStyle);
980 bool classic = (info.wizStyle == QWizard::ClassicStyle);
981 bool modern = (info.wizStyle == QWizard::ModernStyle);
982 bool aero = (info.wizStyle == QWizard::AeroStyle);
998 int pageColumn = qMin(1, numColumns - 1);
1001 mainLayout->setContentsMargins(QMargins());
1002 mainLayout->setSpacing(0);
1003 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);
1004 pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
1007 mainLayout->setContentsMargins(QMargins());
1008 mainLayout->setSpacing(0);
1009 pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
1010 deltaMarginRight, deltaMarginBottom);
1011 buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1012 info.topLevelMarginRight, info.topLevelMarginBottom);
1014 mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1015 info.topLevelMarginRight, info.topLevelMarginBottom);
1016 mainLayout->setHorizontalSpacing(info.hspacing);
1017 mainLayout->setVerticalSpacing(info.vspacing);
1018 pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
1019 buttonLayout->setContentsMargins(0, 0, 0, 0);
1022 buttonLayout->setSpacing(info.buttonSpacing);
1028 mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
1033 int watermarkStartRow = row;
1036 mainLayout->setRowMinimumHeight(row++, 10);
1040 titleLabel =
new QLabel(antiFlickerWidget);
1041 titleLabel->setBackgroundRole(QPalette::Base);
1042 titleLabel->setWordWrap(
true);
1045 QFont titleFont = q->font();
1046 titleFont.setPointSizeF(QFontInfo(titleFont).pointSizeF() + (mac ? 3 : 4));
1047 titleFont.setBold(
true);
1048 titleLabel->setPalette(QPalette());
1052 titleFont = QFont(
"Segoe UI"_L1, 12);
1053 QPalette pal(titleLabel->palette());
1054 pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1055 titleLabel->setPalette(pal);
1058 titleLabel->setFont(titleFont);
1059 const int aeroTitleIndent = 25;
1061 titleLabel->setIndent(aeroTitleIndent);
1063 titleLabel->setIndent(2);
1065 titleLabel->setIndent(info.childMarginLeft);
1067 titleLabel->setIndent(info.topLevelMarginLeft);
1074 mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1076 mainLayout->addWidget(titleLabel, row++, pageColumn);
1083 mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1086 mainLayout->setRowMinimumHeight(row++, 7);
1094 if (!subTitleLabel) {
1095 subTitleLabel =
new QLabel(pageFrame);
1096 subTitleLabel->setWordWrap(
true);
1098 subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1099 info.childMarginRight , 0);
1101 pageVBoxLayout->insertWidget(1, subTitleLabel);
1108 int hMargin = mac ? 1 : 0;
1109 int vMargin = hMargin;
1111 pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame);
1112 pageFrame->setLineWidth(0);
1113 pageFrame->setMidLineWidth(hMargin);
1118 vMargin = deltaMarginBottom;
1119 }
else if (classic) {
1126 int leftMargin = 18;
1127 int topMargin = vMargin;
1128 int rightMargin = hMargin;
1129 int bottomMargin = vMargin;
1130 pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1132 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1136 watermarkLabel =
new QWatermarkLabel(antiFlickerWidget, sideWidget);
1139 watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
1144 const bool wasSemiTransparent =
1145 pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
1146 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1148 pageFrame->setAutoFillBackground(
true);
1151 if (wasSemiTransparent)
1152 pageFrame->setPalette(QPalette());
1154 bool baseBackground = (modern && !info
.header);
1155 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);
1158 titleLabel->setAutoFillBackground(baseBackground);
1159 pageFrame->setAutoFillBackground(baseBackground);
1168 QPalette pal = pageFrame->palette();
1169 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1170 pageFrame->setPalette(pal);
1171 pageFrame->setAutoFillBackground(
true);
1173 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1179 mainLayout->addWidget(pageFrame, row++, pageColumn);
1181 int watermarkEndRow = row;
1183 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1186 buttonLayout->setContentsMargins(9, 9, 9, 9);
1187 mainLayout->setContentsMargins(0, 11, 0, 0);
1190 int buttonStartColumn = info
.extension ? 1 : 0;
1191 int buttonNumColumns = info
.extension ? 1 : numColumns;
1193 if (classic || modern) {
1195 bottomRuler =
new QWizardRuler(antiFlickerWidget);
1196 mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1200 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1202 mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1206 watermarkEndRow = row;
1207 mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1208 watermarkEndRow - watermarkStartRow, 1);
1211 mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1213 mainLayout->setColumnMinimumWidth(2, 21);
1218 titleLabel->setVisible(info.title);
1220 subTitleLabel->setVisible(info.subTitle);
1236 if (layoutInfo != info)
1238 QWizardPage *page = q->currentPage();
1246 bool expandPage = !page->layout();
1248 const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page));
1249 expandPage = pageItem->expandingDirections() & Qt::Vertical;
1251 QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1252 Q_ASSERT(bottomSpacer);
1253 bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding);
1254 pageVBoxLayout->invalidate();
1259 headerWidget->setup(info, page->title(), page->subTitle(),
1260 page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap),
1261 titleFmt, subTitleFmt, opts);
1268 pix = page->pixmap(QWizard::WatermarkPixmap);
1270 pix = q->pixmap(QWizard::WatermarkPixmap);
1278 titleLabel->setTextFormat(titleFmt.value());
1279 titleLabel->setText(page->title());
1284 subTitleLabel->setTextFormat(subTitleFmt.value());
1285 subTitleLabel->setText(page->subTitle());
1293 if (wizStyle == QWizard::MacStyle) {
1302 QPalette newPalette = QApplication::palette(pageFrame);
1304 QColor windowColor = newPalette.brush(QPalette::Window).color();
1305 windowColor.setAlpha(153);
1306 newPalette.setBrush(QPalette::Window, windowColor);
1308 QColor baseColor = newPalette.brush(QPalette::Base).color();
1309 baseColor.setAlpha(153);
1310 newPalette.setBrush(QPalette::Base, baseColor);
1312 pageFrame->setPalette(newPalette);
1320 int extraHeight = 0;
1321#if QT_CONFIG(style_windowsvista)
1322 if (isVistaThemeEnabled())
1323 extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1325 QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1326 QSize maximumSize = mainLayout->totalMaximumSize();
1327 if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1332 minimumSize.setHeight(mainLayout->totalSizeHint().height());
1334 if (q->minimumWidth() == minimumWidth) {
1336 q->setMinimumWidth(minimumWidth);
1338 if (q->minimumHeight() == minimumHeight) {
1340 q->setMinimumHeight(minimumHeight);
1342 if (q->maximumWidth() == maximumWidth) {
1343 maximumWidth = maximumSize.width();
1344 q->setMaximumWidth(maximumWidth);
1346 if (q->maximumHeight() == maximumHeight) {
1347 maximumHeight = maximumSize.height();
1348 q->setMaximumHeight(maximumHeight);
1355 if (q->currentPage()) {
1357 canFinish = q->currentPage()->isFinalPage();
1369 case QWizard::CommitButton:
1370 return u"qt_wizard_commit"_s;
1371 case QWizard::FinishButton:
1372 return u"qt_wizard_finish"_s;
1373 case QWizard::CancelButton:
1374 return u"qt_wizard_cancel"_s;
1375 case QWizard::BackButton:
1376 case QWizard::NextButton:
1377 case QWizard::HelpButton:
1378 case QWizard::CustomButton1:
1379 case QWizard::CustomButton2:
1380 case QWizard::CustomButton3:
1382 return "__qt__passive_wizardbutton"_L1 + QString::number(which);
1383 case QWizard::Stretch:
1384 case QWizard::NoButton:
1389 Q_UNREACHABLE_RETURN(QString());
1395 if (uint(which) >= QWizard::NButtons)
1399 QPushButton *pushButton =
new QPushButton(antiFlickerWidget);
1400 QStyle *style = q->style();
1401 if (style != QApplication::style())
1402 pushButton->setStyle(style);
1403 pushButton->setObjectName(object_name_for_button(which));
1405 pushButton->setAutoDefault(
false);
1409 const_cast<QWizardPrivate *>(
this)->btns[which] = pushButton;
1411 btns[which] = pushButton;
1413 if (which < QWizard::NStandardButtons)
1414 pushButton->setText(buttonDefaultText(wizStyle, which,
this));
1416 connectButton(which);
1424 if (which < QWizard::NStandardButtons) {
1425 QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1427 QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1434 for (
int i = 0; i < QWizard::NButtons; ++i) {
1436 if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1437 btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1438 else if (buttonCustomTexts.contains(i))
1439 btns[i]->setText(buttonCustomTexts.value(i));
1440 else if (i < QWizard::NStandardButtons)
1441 btns[i]->setText(buttonDefaultText(wizStyle, i,
this));
1447#if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1448 if (btns[QWizard::NextButton] && isVistaThemeEnabled()) {
1449 if (vistaNextShortcut.isNull()) {
1451 new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right),
1452 btns[QWizard::NextButton], SLOT(animateClick()));
1455 delete vistaNextShortcut;
1463 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array{
1464 buttonsCustomLayout.cbegin(), buttonsCustomLayout.cend()};
1465 setButtonLayout(array.constData(),
int(array.size()));
1470 const int ArraySize = 12;
1471 QWizard::WizardButton array[ArraySize];
1472 memset(array, -1,
sizeof(array));
1473 Q_ASSERT(array[0] == QWizard::NoButton);
1475 if (opts & QWizard::HaveHelpButton) {
1476 int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1477 array[i] = QWizard::HelpButton;
1479 array[1] = QWizard::Stretch;
1480 if (opts & QWizard::HaveCustomButton1)
1481 array[2] = QWizard::CustomButton1;
1482 if (opts & QWizard::HaveCustomButton2)
1483 array[3] = QWizard::CustomButton2;
1484 if (opts & QWizard::HaveCustomButton3)
1485 array[4] = QWizard::CustomButton3;
1487 if (!(opts & QWizard::NoCancelButton)) {
1488 int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1489 array[i] = QWizard::CancelButton;
1491 array[6] = QWizard::BackButton;
1492 array[7] = QWizard::NextButton;
1493 array[8] = QWizard::CommitButton;
1494 array[9] = QWizard::FinishButton;
1496 setButtonLayout(array, ArraySize);
1504 for (
int i = buttonLayout->count() - 1; i >= 0; --i) {
1505 QLayoutItem *item = buttonLayout->takeAt(i);
1506 if (
QWidget *widget = item->widget())
1511 for (
int i = 0; i < size; ++i) {
1512 QWizard::WizardButton which = array[i];
1513 if (which == QWizard::Stretch) {
1514 buttonLayout->addStretch(1);
1515 }
else if (which != QWizard::NoButton) {
1516 ensureButton(which);
1517 buttonLayout->addWidget(btns[which]);
1520 if (which != QWizard::BackButton && which != QWizard::NextButton
1521 && which != QWizard::CommitButton && which != QWizard::FinishButton)
1522 btns[which]->show();
1525 QWidget::setTabOrder(prev, btns[which]);
1541 if (which == QWizard::BackgroundPixmap) {
1542 if (wizStyle == QWizard::MacStyle) {
1544 q->updateGeometry();
1551#if QT_CONFIG(style_windowsvista)
1552bool QWizardPrivate::vistaDisabled()
const
1555 const QVariant v = q->property(
"_q_wizard_vista_off");
1556 return v.isValid() && v.toBool();
1559bool QWizardPrivate::handleAeroStyleChange()
1563 if (inHandleAeroStyleChange)
1569 const bool isWindow = q->isWindow();
1570 if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1572 inHandleAeroStyleChange =
true;
1574 vistaHelper->disconnectBackButton();
1575 q->removeEventFilter(vistaHelper);
1577 bool vistaMargins =
false;
1579 if (isVistaThemeEnabled()) {
1580 const int topOffset = vistaHelper->topOffset(q);
1581 const int topPadding = vistaHelper->topPadding(q);
1583 vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1584 q->installEventFilter(vistaHelper);
1586 q->setMouseTracking(
true);
1587 antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1588 vistaHelper->backButton()->move(
1590 - qMin(topOffset, topPadding + 1));
1591 vistaMargins =
true;
1592 vistaHelper->backButton()->show();
1594 vistaHelper->setTitleBarIconAndCaptionVisible(
false);
1596 vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1597 vistaHelper->backButton()->show();
1599 q->setMouseTracking(
true);
1603 antiFlickerWidget->move(0, 0);
1604 vistaHelper->hideBackButton();
1606 vistaHelper->setTitleBarIconAndCaptionVisible(
true);
1609 _q_updateButtonStates();
1611 vistaHelper->updateCustomMargins(vistaMargins);
1613 inHandleAeroStyleChange =
false;
1620#if QT_CONFIG(style_windowsvista)
1621 return wizStyle == QWizard::AeroStyle && !vistaDisabled();
1631 q->setUpdatesEnabled(
false);
1641 q->setUpdatesEnabled(
true);
1648 QObject *button = q->sender();
1649 for (
int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1650 if (btns[i] == button) {
1651 emit q->customButtonClicked(QWizard::WizardButton(i));
1663 const QWizardPage *page = q->currentPage();
1664 bool complete = page && page->isComplete();
1666 btn.back->setEnabled(history.size() > 1
1667 && !q->page(history.at(history.size() - 2))->isCommitPage()
1668 && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage)));
1669 btn.next->setEnabled(canContinue && complete);
1670 btn.commit->setEnabled(canContinue && complete);
1671 btn.finish->setEnabled(canFinish && complete);
1673 const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1674 && (history.size() > 1 || !(opts & QWizard::NoBackButtonOnStartPage))
1675 && (canContinue || !(opts & QWizard::NoBackButtonOnLastPage));
1676 bool commitPage = page && page->isCommitPage();
1677 btn.back->setVisible(backButtonVisible);
1678 btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1679 && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage)));
1680 btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1682 btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1683 && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
1685 if (!(opts & QWizard::NoCancelButton))
1686 btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1687 && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
1689 bool useDefault = !(opts & QWizard::NoDefaultButton);
1690 if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1691 nextPush->setDefault(canContinue && useDefault && !commitPage);
1692 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1693 commitPush->setDefault(canContinue && useDefault && commitPage);
1694 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1695 finishPush->setDefault(!canContinue && useDefault);
1697#if QT_CONFIG(style_windowsvista)
1698 if (isVistaThemeEnabled()) {
1699 vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1700 vistaHelper->backButton()->setVisible(backButtonVisible);
1701 btn.back->setVisible(
false);
1710 int destroyed_index = -1;
1711 QList<QWizardField>::iterator it = fields.begin();
1712 while (it != fields.end()) {
1714 if (field.object == object) {
1715 destroyed_index = fieldIndexMap.value(field.name, -1);
1716 fieldIndexMap.remove(field.name);
1717 it = fields.erase(it);
1722 if (destroyed_index != -1) {
1723 QMap<QString,
int>::iterator it2 = fieldIndexMap.begin();
1724 while (it2 != fieldIndexMap.end()) {
1725 int index = it2.value();
1726 if (index > destroyed_index) {
1727 QString field_name = it2.key();
1728 fieldIndexMap.insert(field_name, index-1);
1737 for (
int i = 0; i < QWizard::NButtons; i++)
1739 btns[i]->setStyle(style);
1740 const PageMap::const_iterator pcend = pageMap.constEnd();
1741 for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1742 it.value()->setStyle(style);
1746QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1748 auto *keyboardAssistantURL = [NSWorkspace.sharedWorkspace
1749 URLForApplicationWithBundleIdentifier:@
"com.apple.KeyboardSetupAssistant"];
1750 auto *keyboardAssistantBundle = [NSBundle bundleWithURL:keyboardAssistantURL];
1751 auto *assistantBackground = [keyboardAssistantBundle imageForResource:@
"Background"];
1752 auto size = QSizeF::fromCGSize(assistantBackground.size);
1753 static const QSizeF expectedSize(242, 414);
1754 if (size == expectedSize)
1755 return qt_mac_toQPixmap(assistantBackground, size);
1761#if QT_CONFIG(style_windowsvista)
1762void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
1764 if (wizardPrivate->isVistaThemeEnabled()) {
1765 int leftMargin, topMargin, rightMargin, bottomMargin;
1766 wizardPrivate->buttonLayout->getContentsMargins(
1767 &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1768 const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1769 QPainter painter(
this);
1770 const QBrush brush(QColor(240, 240, 240));
1771 painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1772 painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0));
1773 painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
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
2056
2057
2058
2059
2060
2061
2062
2063
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
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
2147
2148
2149
2150
2151
2152
2153
2154
2157
2158
2159
2160
2161QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
2162 : QDialog(*
new QWizardPrivate, parent, flags)
2169
2170
2174 delete d->buttonLayout;
2178
2179
2180
2181
2182
2183
2184
2185int QWizard::addPage(QWizardPage *page)
2189 if (!d->pageMap.isEmpty())
2190 theid = d->pageMap.lastKey() + 1;
2191 setPage(theid, page);
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205void QWizard::setPage(
int theid, QWizardPage *page)
2209 if (Q_UNLIKELY(!page)) {
2210 qWarning(
"QWizard::setPage: Cannot insert null page");
2214 if (Q_UNLIKELY(theid == -1)) {
2215 qWarning(
"QWizard::setPage: Cannot insert page with ID -1");
2219 if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2220 qWarning(
"QWizard::setPage: Page with duplicate ID %d ignored", theid);
2224 page->setParent(d->pageFrame);
2226 QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2227 for (
const auto &field : std::as_const(pendingFields))
2229 pendingFields.clear();
2231 connect(page, SIGNAL(completeChanged()),
this, SLOT(_q_updateButtonStates()));
2233 d->pageMap.insert(theid, page);
2234 page->d_func()->wizard =
this;
2236 int n = d->pageVBoxLayout->count();
2239 bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2240 d->pageVBoxLayout->setEnabled(
false);
2242 d->pageVBoxLayout->insertWidget(n - 1, page);
2246 d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2248 if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2250 emit pageAdded(theid);
2254
2255
2256
2257
2258
2259
2260void QWizard::removePage(
int id)
2264 QWizardPage *removedPage =
nullptr;
2267 if (d->pageMap.size() > 0) {
2268 if (d->start == id) {
2269 const int firstId = d->pageMap.constBegin().key();
2270 if (firstId == id) {
2271 if (d->pageMap.size() > 1)
2272 d->start = (++d->pageMap.constBegin()).key();
2278 d->startSetByUser =
false;
2282 if (d->pageMap.contains(id))
2283 emit pageRemoved(id);
2285 if (!d->history.contains(id)) {
2287 removedPage = d->pageMap.take(id);
2288 d->updateCurrentPage();
2289 }
else if (id != d->current) {
2291 removedPage = d->pageMap.take(id);
2292 d->history.removeOne(id);
2293 d->_q_updateButtonStates();
2294 }
else if (d->history.size() == 1) {
2297 removedPage = d->pageMap.take(id);
2298 if (d->pageMap.isEmpty())
2299 d->updateCurrentPage();
2305 removedPage = d->pageMap.take(id);
2306 d->updateCurrentPage();
2310 if (removedPage->d_func()->initialized) {
2312 removedPage->d_func()->initialized =
false;
2315 d->pageVBoxLayout->removeWidget(removedPage);
2317 for (
int i = d->fields.size() - 1; i >= 0; --i) {
2318 if (d->fields.at(i).page == removedPage) {
2319 removedPage->d_func()->pendingFields += d->fields.at(i);
2320 d->removeFieldAt(i);
2327
2328
2329
2330
2331
2332
2333
2334QWizardPage *QWizard::page(
int theid)
const
2337 return d->pageMap.value(theid);
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350bool QWizard::hasVisitedPage(
int theid)
const
2353 return d->history.contains(theid);
2357
2358
2359
2360
2361
2362
2363
2364QList<
int> QWizard::visitedIds()
const
2371
2372
2373QList<
int> QWizard::pageIds()
const
2376 return d->pageMap.keys();
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389void QWizard::setStartId(
int theid)
2392 int newStart = theid;
2394 newStart = d->pageMap.size() ? d->pageMap.constBegin().key() : -1;
2396 if (d->start == newStart) {
2397 d->startSetByUser = theid != -1;
2401 if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2402 qWarning(
"QWizard::setStartId: Invalid page ID %d", newStart);
2405 d->start = newStart;
2406 d->startSetByUser = theid != -1;
2409int QWizard::startId()
const
2416
2417
2418
2419
2420
2421
2422
2423QWizardPage *QWizard::currentPage()
const
2426 return page(d->current);
2430
2431
2432
2433
2434
2435
2436
2437
2438int QWizard::currentId()
const
2445
2446
2447
2448
2449
2450
2451void QWizard::setField(
const QString &name,
const QVariant &value)
2455 int index = d->fieldIndexMap.value(name, -1);
2456 if (Q_UNLIKELY(index == -1)) {
2457 qWarning(
"QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2461 const QWizardField &field = d->fields.at(index);
2462 if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2463 qWarning(
"QWizard::setField: Couldn't write to property '%s'",
2464 field.property.constData());
2468
2469
2470
2471
2472
2473
2474QVariant QWizard::field(
const QString &name)
const
2478 int index = d->fieldIndexMap.value(name, -1);
2479 if (Q_UNLIKELY(index == -1)) {
2480 qWarning(
"QWizard::field: No such field '%ls'", qUtf16Printable(name));
2484 const QWizardField &field = d->fields.at(index);
2485 return field.object->property(field.property);
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500void QWizard::setWizardStyle(WizardStyle style)
2504 const bool styleChange = style != d->wizStyle;
2506#if QT_CONFIG(style_windowsvista)
2507 const bool aeroStyleChange =
2508 d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2509 d->vistaStateChanged =
false;
2510 d->vistaInitPending =
false;
2514#if QT_CONFIG(style_windowsvista)
2518 d->disableUpdates();
2519 d->wizStyle = style;
2520 d->updateButtonTexts();
2521#if QT_CONFIG(style_windowsvista)
2522 if (aeroStyleChange) {
2525 QResizeEvent ev(geometry().size(), geometry().size());
2526 QCoreApplication::sendEvent(
this, &ev);
2532#if QT_CONFIG(style_windowsvista)
2534 if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2535 d->vistaInitPending =
true;
2540QWizard::WizardStyle QWizard::wizardStyle()
const
2547
2548
2549
2550
2551
2552void QWizard::setOption(WizardOption option,
bool on)
2555 if (!(d->opts & option) != !on)
2556 setOptions(d->opts ^ option);
2560
2561
2562
2563
2564
2565bool QWizard::testOption(WizardOption option)
const
2568 return (d->opts & option) != 0;
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585void QWizard::setOptions(WizardOptions options)
2589 WizardOptions changed = (options ^ d->opts);
2593 d->disableUpdates();
2596 if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2597 d->cleanupPagesNotInHistory();
2599 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
2600 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
2601 | HaveCustomButton3)) {
2602 d->updateButtonLayout();
2603 }
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2604 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
2605 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
2606 d->_q_updateButtonStates();
2613QWizard::WizardOptions QWizard::options()
const
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636void QWizard::setButtonText(WizardButton which,
const QString &text)
2640 if (!d->ensureButton(which))
2643 d->buttonCustomTexts.insert(which, text);
2645 if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2646 d->btns[which]->setText(text);
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661QString QWizard::buttonText(WizardButton which)
const
2665 if (!d->ensureButton(which))
2668 if (d->buttonCustomTexts.contains(which))
2669 return d->buttonCustomTexts.value(which);
2671 const QString defText = buttonDefaultText(d->wizStyle, which, d);
2672 if (!defText.isNull())
2675 return d->btns[which]->text();
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696void QWizard::setButtonLayout(
const QList<WizardButton> &layout)
2700 for (
int i = 0; i < layout.size(); ++i) {
2701 WizardButton button1 = layout.at(i);
2703 if (button1 == NoButton || button1 == Stretch)
2705 if (!d->ensureButton(button1))
2709 for (
int j = 0; j < i; ++j) {
2710 WizardButton button2 = layout.at(j);
2711 if (Q_UNLIKELY(button2 == button1)) {
2712 qWarning(
"QWizard::setButtonLayout: Duplicate button in layout");
2718 d->buttonsHaveCustomLayout =
true;
2719 d->buttonsCustomLayout = layout;
2720 d->updateButtonLayout();
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733void QWizard::setButton(WizardButton which, QAbstractButton *button)
2737 if (uint(which) >= NButtons || d->btns[which] == button)
2740 if (QAbstractButton *oldButton = d->btns[which]) {
2741 d->buttonLayout->removeWidget(oldButton);
2745 d->btns[which] = button;
2747 button->setParent(d->antiFlickerWidget);
2748 d->buttonCustomTexts.insert(which, button->text());
2749 d->connectButton(which);
2751 d->buttonCustomTexts.remove(which);
2752 d->ensureButton(which);
2755 d->updateButtonLayout();
2759
2760
2761
2762
2763QAbstractButton *QWizard::button(WizardButton which)
const
2766#if QT_CONFIG(style_windowsvista)
2767 if (d->wizStyle == AeroStyle && which == BackButton)
2768 return d->vistaHelper->backButton();
2770 if (!d->ensureButton(which))
2772 return d->btns[which];
2776
2777
2778
2779
2780
2781
2782
2783void QWizard::setTitleFormat(Qt::TextFormat format)
2786 d->titleFmt = format;
2790Qt::TextFormat QWizard::titleFormat()
const
2793 return d->titleFmt.value_or(Qt::AutoText);
2797
2798
2799
2800
2801
2802
2803
2804void QWizard::setSubTitleFormat(Qt::TextFormat format)
2807 d->subTitleFmt = format;
2811Qt::TextFormat QWizard::subTitleFormat()
const
2814 return d->subTitleFmt.value_or(Qt::AutoText);
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829void QWizard::setPixmap(WizardPixmap which,
const QPixmap &pixmap)
2832 Q_ASSERT(uint(which) < NPixmaps);
2833 d->defaultPixmaps[which] = pixmap;
2834 d->updatePixmap(which);
2838
2839
2840
2841
2842
2843
2844
2845QPixmap QWizard::pixmap(WizardPixmap which)
const
2848 Q_ASSERT(uint(which) < NPixmaps);
2850 if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2851 d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2853 return d->defaultPixmaps[which];
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881void QWizard::setDefaultProperty(
const char *className,
const char *property,
2882 const char *changedSignal)
2885 for (
int i = d->defaultPropertyTable.size() - 1; i >= 0; --i) {
2886 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2887 d->defaultPropertyTable.remove(i);
2891 d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916void QWizard::setSideWidget(QWidget *widget)
2920 d->sideWidget = widget;
2921 if (d->watermarkLabel) {
2922 d->watermarkLabel->setSideWidget(widget);
2928
2929
2930
2931
2932QWidget *QWizard::sideWidget()
const
2936 return d->sideWidget;
2940
2941
2942void QWizard::setVisible(
bool visible)
2946 if (d->current == -1)
2949 QDialog::setVisible(visible);
2953
2954
2955QSize QWizard::sizeHint()
const
2958 QSize result = d->mainLayout->totalSizeHint();
2959 QSize extra(500, 360);
2960 if (d->wizStyle == MacStyle && d->current != -1) {
2961 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());
2962 extra.setWidth(616);
2963 if (!pixmap.isNull()) {
2964 extra.setHeight(pixmap.height());
2967
2968
2969
2970
2971
2972 if (pixmap.width() >= pixmap.height())
2973 extra.setWidth(pixmap.width());
2976 return result.expandedTo(extra);
2980
2981
2982
2983
2984
2985
2986
2989
2990
2991
2992
2993
2994
2995
2998
2999
3000
3001
3002
3003
3004
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3048
3049
3050
3051
3052
3053
3057 int n = d->history.size() - 2;
3060 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3064
3065
3066
3067
3068
3069
3074 if (d->current == -1)
3077 if (validateCurrentPage()) {
3078 int next = nextId();
3080 if (Q_UNLIKELY(d->history.contains(next))) {
3081 qWarning(
"QWizard::next: Page %d already met", next);
3084 if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3085 qWarning(
"QWizard::next: No such page %d", next);
3088 d->switchToPage(next, QWizardPrivate::Forward);
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3108void QWizard::setCurrentId(
int id)
3112 if (d->current == -1)
3115 if (currentId() == id)
3118 if (!validateCurrentPage())
3121 if (id < 0 || Q_UNLIKELY(!d->pageMap.contains(id))) {
3122 qWarning(
"QWizard::setCurrentId: No such page: %d", id);
3126 d->switchToPage(id, (id < currentId()) ? QWizardPrivate::Backward : QWizardPrivate::Forward);
3130
3131
3132
3133
3134
3135void QWizard::restart()
3138 d->disableUpdates();
3140 d->switchToPage(startId(), QWizardPrivate::Forward);
3145
3146
3147bool QWizard::event(QEvent *event)
3150 if (event->type() == QEvent::StyleChange) {
3151 d->setStyle(style());
3153 }
else if (event->type() == QEvent::PaletteChange) {
3156#if QT_CONFIG(style_windowsvista)
3157 else if (event->type() == QEvent::Show && d->vistaInitPending) {
3158 d->vistaInitPending =
false;
3159 d->wizStyle = AeroStyle;
3160 d->handleAeroStyleChange();
3162 else if (d->isVistaThemeEnabled()) {
3163 if (event->type() == QEvent::Resize
3164 || event->type() == QEvent::LayoutDirectionChange) {
3165 const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3166 ? width() - d->vistaHelper->backButton()->sizeHint().width()
3169 d->vistaHelper->backButton()->move(buttonLeft,
3170 d->vistaHelper->backButton()->y());
3173 d->vistaHelper->mouseEvent(event);
3176 return QDialog::event(event);
3180
3181
3182void QWizard::resizeEvent(QResizeEvent *event)
3185 int heightOffset = 0;
3186#if QT_CONFIG(style_windowsvista)
3187 if (d->isVistaThemeEnabled()) {
3188 heightOffset = d->vistaHelper->topOffset(
this);
3189 heightOffset += d->vistaHelper->titleBarSize();
3192 d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3193#if QT_CONFIG(style_windowsvista)
3194 if (d->isVistaThemeEnabled())
3195 d->vistaHelper->resizeEvent(event);
3197 QDialog::resizeEvent(event);
3201
3202
3203void QWizard::paintEvent(QPaintEvent * event)
3206 if (d->wizStyle == MacStyle && currentPage()) {
3207 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3208 if (backgroundPixmap.isNull())
3211 QStylePainter painter(
this);
3212 painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3214#if QT_CONFIG(style_windowsvista)
3215 else if (d->isVistaThemeEnabled()) {
3216 d->vistaHelper->paintEvent(event);
3223#if defined(Q_OS_WIN) || defined(Q_QDOC)
3225
3226
3227bool QWizard::nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result)
3229#if QT_CONFIG(style_windowsvista)
3231 if (d->isVistaThemeEnabled() && eventType ==
"windows_generic_MSG") {
3232 MSG *windowsMessage =
static_cast<MSG *>(message);
3233 const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3234 if (d->vistaDirty) {
3237 if (windowsMessage->message == WM_GETICON) {
3238 d->vistaStateChanged =
true;
3239 d->vistaDirty =
false;
3240 setWizardStyle(AeroStyle);
3243 return winEventResult;
3245 return QDialog::nativeEvent(eventType, message, result);
3248 return QDialog::nativeEvent(eventType, message, result);
3254
3255
3256void QWizard::done(
int result)
3260 if (result == Rejected) {
3263 if (!validateCurrentPage())
3266 QDialog::done(result);
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287void QWizard::initializePage(
int theid)
3289 QWizardPage *page =
this->page(theid);
3291 page->initializePage();
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305void QWizard::cleanupPage(
int theid)
3307 QWizardPage *page =
this->page(theid);
3309 page->cleanupPage();
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328bool QWizard::validateCurrentPage()
3330 QWizardPage *page = currentPage();
3334 return page->validatePage();
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351int QWizard::nextId()
const
3353 const QWizardPage *page = currentPage();
3357 return page->nextId();
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
3418
3419
3420
3421
3422
3423
3424
3425
3428
3429
3430
3431
3432
3433
3434
3435
3436QWizardPage::QWizardPage(QWidget *parent)
3437 : QWidget(*
new QWizardPagePrivate, parent, { })
3439 connect(
this, SIGNAL(completeChanged()),
this, SLOT(_q_updateCachedCompleteState()));
3443
3444
3445QWizardPage::~QWizardPage()
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463void QWizardPage::setTitle(
const QString &title)
3467 if (d->wizard && d->wizard->currentPage() ==
this)
3468 d->wizard->d_func()->updateLayout();
3471QString QWizardPage::title()
const
3473 Q_D(
const QWizardPage);
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496void QWizardPage::setSubTitle(
const QString &subTitle)
3499 d->subTitle = subTitle;
3500 if (d->wizard && d->wizard->currentPage() ==
this)
3501 d->wizard->d_func()->updateLayout();
3504QString QWizardPage::subTitle()
const
3506 Q_D(
const QWizardPage);
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523void QWizardPage::setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap)
3526 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3527 d->pixmaps[which] = pixmap;
3528 if (d->wizard && d->wizard->currentPage() ==
this)
3529 d->wizard->d_func()->updatePixmap(which);
3533
3534
3535
3536
3537
3538
3539
3540
3541QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which)
const
3543 Q_D(
const QWizardPage);
3544 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3546 const QPixmap &pixmap = d->pixmaps[which];
3547 if (!pixmap.isNull())
3551 return wizard()->pixmap(which);
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573void QWizardPage::initializePage()
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588void QWizardPage::cleanupPage()
3592 const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3593 for (
const auto &field : fields) {
3594 if (field.page ==
this)
3595 field.object->setProperty(field.property, field.initialValue);
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614bool QWizardPage::validatePage()
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636bool QWizardPage::isComplete()
const
3638 Q_D(
const QWizardPage);
3643 const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3644 const auto end = wizardFields.crend();
3645 for (
auto it = wizardFields.crbegin(); it != end; ++it) {
3646 const QWizardField &field = *it;
3647 if (field.page ==
this && field.mandatory) {
3648 QVariant value = field.object->property(field.property);
3649 if (value == field.initialValue)
3652#if QT_CONFIG(lineedit)
3653 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3654 if (!lineEdit->hasAcceptableInput())
3658#if QT_CONFIG(spinbox)
3659 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3660 if (!spinBox->hasAcceptableInput())
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681void QWizardPage::setFinalPage(
bool finalPage)
3684 d->explicitlyFinal = finalPage;
3685 QWizard *wizard =
this->wizard();
3686 if (wizard && wizard->currentPage() ==
this)
3687 wizard->d_func()->updateCurrentPage();
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702bool QWizardPage::isFinalPage()
const
3704 Q_D(
const QWizardPage);
3705 if (d->explicitlyFinal)
3708 QWizard *wizard =
this->wizard();
3709 if (wizard && wizard->currentPage() ==
this) {
3711 return wizard->nextId() == -1;
3713 return nextId() == -1;
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731void QWizardPage::setCommitPage(
bool commitPage)
3734 d->commit = commitPage;
3735 QWizard *wizard =
this->wizard();
3736 if (wizard && wizard->currentPage() ==
this)
3737 wizard->d_func()->updateCurrentPage();
3741
3742
3743
3744
3745bool QWizardPage::isCommitPage()
const
3747 Q_D(
const QWizardPage);
3752
3753
3754
3755
3756
3757
3758
3759void QWizardPage::setButtonText(QWizard::WizardButton which,
const QString &text)
3762 d->buttonCustomTexts.insert(which, text);
3763 if (wizard() && wizard()->currentPage() ==
this && wizard()->d_func()->btns[which])
3764 wizard()->d_func()->btns[which]->setText(text);
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780QString QWizardPage::buttonText(QWizard::WizardButton which)
const
3782 Q_D(
const QWizardPage);
3784 if (d->buttonCustomTexts.contains(which))
3785 return d->buttonCustomTexts.value(which);
3788 return wizard()->buttonText(which);
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809int QWizardPage::nextId()
const
3811 Q_D(
const QWizardPage);
3816 bool foundCurrentPage =
false;
3818 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3819 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();
3820 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();
3822 for (; i != end; ++i) {
3823 if (i.value() ==
this) {
3824 foundCurrentPage =
true;
3825 }
else if (foundCurrentPage) {
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3847
3848
3849
3850
3851
3852
3853
3854
3855void QWizardPage::setField(
const QString &name,
const QVariant &value)
3860 d->wizard->setField(name, value);
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876QVariant QWizardPage::field(
const QString &name)
const
3878 Q_D(
const QWizardPage);
3881 return d->wizard->field(name);
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
3922
3923
3924
3925
3926
3927
3928
3929
3930void QWizardPage::registerField(
const QString &name, QWidget *widget,
const char *property,
3931 const char *changedSignal)
3934 QWizardField field(
this, name, widget, property, changedSignal);
3936 d->wizard->d_func()->addField(field);
3938 d->pendingFields += field;
3943
3944
3945
3946
3947
3948QWizard *QWizardPage::wizard()
const
3950 Q_D(
const QWizardPage);
3956#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
QEnumIndexedArrayFor< QPixmap, QWizard::NPixmaps > pixmaps
void _q_updateCachedCompleteState()
bool cachedIsComplete() const
QList< QWizardField > pendingFields
QMap< int, QString > buttonCustomTexts
QMap< QString, int > fieldIndexMap
void setStyle(QStyle *style)
QList< QWizardDefaultProperty > defaultPropertyTable
bool buttonLayoutContains(QWizard::WizardButton which)
std::optional< Qt::TextFormat > subTitleFmt
void _q_updateButtonStates()
QVBoxLayout * pageVBoxLayout
QWatermarkLabel * watermarkLabel
QWizardLayoutInfo layoutInfoForCurrentPage()
void connectButton(QWizard::WizardButton which) const
void removeFieldAt(int index)
std::optional< Qt::TextFormat > titleFmt
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
void updateButtonLayout()
QList< QWizardField > fields
bool ensureButton(QWizard::WizardButton which) const
bool buttonsHaveCustomLayout
void cleanupPagesNotInHistory()
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