5#include <QtWidgets/private/qtwidgetsglobal_p.h>
8#include "qabstractspinbox.h"
17#if QT_CONFIG(lineedit)
25#if QT_CONFIG(shortcut)
26# include "qshortcut.h"
31#if defined(Q_OS_MACOS)
32#include <AppKit/AppKit.h>
33#include <QtGui/private/qcoregraphics_p.h>
34#elif QT_CONFIG(style_windowsvista)
35#include "qwizard_win_p.h"
38#include "private/qdialog_p.h"
46using namespace Qt::StringLiterals;
60 QSpacerItem *spacer = layout->itemAt(index)->spacerItem();
63 spacer->changeSize(width, height);
68 const int MaxIterations = 100;
71 for (
int i = 0; i < MaxIterations; ++i) {
72 candidate = candidate->nextInFocusChain();
76 if (candidate->focusPolicy() & Qt::TabFocus) {
77 if (candidate != ancestor && ancestor->isAncestorOf(candidate))
85 const QByteArray &classY)
87 const QMetaObject *metaObject = object->metaObject();
89 if (metaObject->className() == classX)
91 if (metaObject->className() == classY)
93 metaObject = metaObject->superClass();
101} fallbackProperties[] = {
103 {
"QAbstractButton",
"checked" },
104 {
"QAbstractSlider",
"value" },
105 {
"QComboBox",
"currentIndex" },
106 {
"QDateTimeEdit",
"dateTime" },
107 {
"QLineEdit",
"text" },
108 {
"QListWidget",
"currentRow" },
109 {
"QSpinBox",
"value" },
121 case 0:
return SIGNAL(toggled(
bool));
122 case 1:
return SIGNAL(valueChanged(
int));
123 case 2:
return SIGNAL(currentIndexChanged(
int));
124 case 3:
return SIGNAL(dateTimeChanged(QDateTime));
125 case 4:
return SIGNAL(textChanged(QString));
126 case 5:
return SIGNAL(currentRowChanged(
int));
127 case 6:
return SIGNAL(valueChanged(
int));
129 static_assert(7 == NFallbackDefaultProperties);
130 Q_UNREACHABLE_RETURN(
nullptr);
142 const char *changedSignal)
151 QWizardField(QWizardPage *page,
const QString &spec, QObject *object,
const char *property,
152 const char *changedSignal);
154 void resolve(
const QList<QWizardDefaultProperty> &defaultPropertyTable);
168 const char *property,
const char *changedSignal)
172 if (name.endsWith(u'*')) {
180 if (property.isEmpty())
181 findProperty(defaultPropertyTable.constData()
, defaultPropertyTable.size()
);
182 initialValue = object->property(property);
187 QByteArray className;
189 for (
int i = 0; i < propertyCount; ++i) {
190 if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)) {
191 className = properties[i].className;
192 property = properties[i].property;
193 changedSignal = properties[i].changedSignal;
226 return topLevelMarginLeft == other.topLevelMarginLeft
227 && topLevelMarginRight == other.topLevelMarginRight
228 && topLevelMarginTop == other.topLevelMarginTop
229 && topLevelMarginBottom == other.topLevelMarginBottom
230 && childMarginLeft == other.childMarginLeft
231 && childMarginRight == other.childMarginRight
232 && childMarginTop == other.childMarginTop
233 && childMarginBottom == other.childMarginBottom
234 && hspacing == other.hspacing
235 && vspacing == other.vspacing
236 && buttonSpacing == other.buttonSpacing
237 && wizStyle == other.wizStyle
238 && header == other.header
239 && watermark == other.watermark
240 && title == other.title
241 && subTitle == other.subTitle
242 && extension == other.extension
243 && sideWidget == other.sideWidget;
256 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
257 Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat);
261#if QT_CONFIG(style_windowsvista)
267 QLabel *subTitleLabel;
270 QPixmap bannerPixmap;
276 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
277 setBackgroundRole(QPalette::Base);
279 titleLabel =
new QLabel(
this);
280 titleLabel->setBackgroundRole(QPalette::Base);
282 subTitleLabel =
new QLabel(
this);
283 subTitleLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
284 subTitleLabel->setWordWrap(
true);
286 logoLabel =
new QLabel(
this);
288 QFont font = titleLabel->font();
290 titleLabel->setFont(font);
292 layout =
new QGridLayout(
this);
293 layout->setContentsMargins(QMargins());
294 layout->setSpacing(0);
296 layout->setRowMinimumHeight(3, 1);
297 layout->setRowStretch(4, 1);
299 layout->setColumnStretch(2, 1);
300 layout->setColumnMinimumWidth(4, 2 * GapBetweenLogoAndRightEdge);
301 layout->setColumnMinimumWidth(6, GapBetweenLogoAndRightEdge);
303 layout->addWidget(titleLabel, 2, 1, 1, 2);
304 layout->addWidget(subTitleLabel, 4, 2);
305 layout->addWidget(logoLabel, 1, 5, 5, 1);
308#if QT_CONFIG(style_windowsvista)
309bool QWizardHeader::vistaDisabled()
const
311 bool styleDisabled =
false;
312 QWizard *wiz = parentWidget() ? qobject_cast <QWizard *>(parentWidget()->parentWidget()) : 0;
316 const QVariant v = wiz->property(
"_q_wizard_vista_off");
317 styleDisabled = v.isValid() && v.toBool();
319 return styleDisabled;
324 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
325 Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat)
327 bool modern = ((info.wizStyle == QWizard::ModernStyle)
328#if QT_CONFIG(style_windowsvista)
333 layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0);
334 layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0);
335 layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2);
340 layout->setColumnMinimumWidth(0, minColumnWidth0);
341 layout->setColumnMinimumWidth(1, minColumnWidth1);
343 titleLabel->setTextFormat(titleFormat);
344 titleLabel->setText(title);
345 logoLabel->setPixmap(logo);
347 subTitleLabel->setTextFormat(subTitleFormat);
348 subTitleLabel->setText(
"Pq\nPq"_L1);
349 int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
350 subTitleLabel->setText(subTitle);
353 bannerPixmap = banner;
355 bannerPixmap = QPixmap();
358 if (bannerPixmap.isNull()) {
360
361
362 int candidateSubTitleWidth = qMin(512, 2 * QGuiApplication::primaryScreen()->virtualGeometry().width() / 3);
363 int delta = candidateSubTitleWidth >> 1;
365 if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
366 <= desiredSubTitleHeight)
367 candidateSubTitleWidth -= delta;
371 subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight);
373 QSize size = layout->totalMinimumSize();
374 setMinimumSize(size);
375 setMaximumSize(QWIDGETSIZE_MAX, size.height());
377 subTitleLabel->setMinimumSize(0, 0);
378 setFixedSize(banner.size() + QSize(0, 2));
386 painter.drawPixmap(0, 0, bannerPixmap);
389 int y = height() - 2;
390 const QPalette &pal = palette();
391 painter.setPen(pal.mid().color());
392 painter.drawLine(0, y, x, y);
393 painter.setPen(pal.base().color());
394 painter.drawPoint(x + 1, y);
395 painter.drawLine(0, y + 1, x + 1, y + 1);
410 m_layout =
new QVBoxLayout(
this);
412 m_layout->addWidget(m_sideWidget);
416 if (!pixmap().isNull())
417 return pixmap().deviceIndependentSize().toSize();
418 return QFrame::minimumSizeHint();
422 if (m_sideWidget == widget)
425 m_layout->removeWidget(m_sideWidget);
426 m_sideWidget->hide();
428 m_sideWidget = widget;
430 m_layout->addWidget(m_sideWidget);
436 QVBoxLayout *m_layout;
442 Q_DECLARE_PUBLIC(QWizardPage)
465 Q_Q(
const QWizardPage);
466 if (completeState == Tri_Unknown)
467 completeState = q->isComplete() ? Tri_True : Tri_False;
468 return completeState == Tri_True;
474 TriState newState = q->isComplete() ? Tri_True : Tri_False;
475 if (newState != completeState)
476 emit q->completeChanged();
482 completeState = q->isComplete() ? Tri_True : Tri_False;
488#if QT_CONFIG(style_windowsvista)
504 Q_DECLARE_PUBLIC(QWizard)
533#if QT_CONFIG(style_windowsvista)
580 mutable QAbstractButton *
btns[QWizard::NButtons];
597#if QT_CONFIG(style_windowsvista)
599# if QT_CONFIG(shortcut)
615#if !QT_CONFIG(style_windowsvista)
616 Q_UNUSED(wizardPrivate);
618 const bool macStyle = (wstyle == QWizard::MacStyle);
620 case QWizard::BackButton:
621 return macStyle ? QWizard::tr(
"Go Back") : QWizard::tr(
"< &Back");
622 case QWizard::NextButton:
624 return QWizard::tr(
"Continue");
627 ? QWizard::tr(
"&Next") : QWizard::tr(
"&Next >");
628 case QWizard::CommitButton:
629 return QWizard::tr(
"Commit");
630 case QWizard::FinishButton:
631 return macStyle ? QWizard::tr(
"Done") : QWizard::tr(
"&Finish");
632 case QWizard::CancelButton:
633 return QWizard::tr(
"Cancel");
634 case QWizard::HelpButton:
635 return macStyle ? QWizard::tr(
"Help") : QWizard::tr(
"&Help");
645 std::fill(btns, btns + QWizard::NButtons,
nullptr);
647 antiFlickerWidget =
new QWizardAntiFlickerWidget(q,
this);
648 wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle,
nullptr, q));
649 if (wizStyle == QWizard::MacStyle) {
650 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
651 }
else if (wizStyle == QWizard::ModernStyle) {
652 opts = QWizard::HelpButtonOnRight;
655#if QT_CONFIG(style_windowsvista)
656 vistaHelper =
new QVistaHelper(q);
660 ensureButton(QWizard::BackButton);
661 ensureButton(QWizard::NextButton);
662 ensureButton(QWizard::CommitButton);
663 ensureButton(QWizard::FinishButton);
665 pageFrame =
new QFrame(antiFlickerWidget);
666 pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
668 pageVBoxLayout =
new QVBoxLayout(pageFrame);
669 pageVBoxLayout->setSpacing(0);
670 pageVBoxLayout->addSpacing(0);
671 QSpacerItem *spacerItem =
new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
672 pageVBoxLayout->addItem(spacerItem);
674 buttonLayout =
new QHBoxLayout;
675 mainLayout =
new QGridLayout(antiFlickerWidget);
676 mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
680 defaultPropertyTable.reserve(NFallbackDefaultProperties);
681 for (uint i = 0; i < NFallbackDefaultProperties; ++i)
682 defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
683 fallbackProperties[i].property,
691 q->currentPage()->hide();
693 const auto end = history.crend();
694 for (
auto it = history.crbegin(); it != end; ++it)
697 for (QWizardPage *page : std::as_const(pageMap))
698 page->d_func()->initialized =
false;
701 emit q->currentIdChanged(-1);
709 for (
auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
710 const auto idx = it.key();
711 const auto page = it.value()->d_func();
712 if (page->initialized && !history.contains(idx)) {
714 page->initialized =
false;
724 myField.resolve(defaultPropertyTable);
726 if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
727 qWarning(
"QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
731 fieldIndexMap.insert(myField.name, fields.size());
733 if (myField.mandatory && !myField.changedSignal.isEmpty())
734 QObject::connect(myField.object, myField.changedSignal,
735 myField.page, SLOT(_q_maybeEmitCompleteChanged()));
737 myField.object, SIGNAL(destroyed(QObject*)), q,
738 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
746 fieldIndexMap.remove(field.name);
747 if (field.mandatory && !field.changedSignal.isEmpty())
748 QObject::disconnect(field.object, field.changedSignal,
749 field.page, SLOT(_q_maybeEmitCompleteChanged()));
751 field.object, SIGNAL(destroyed(QObject*)), q,
752 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
753 fields.remove(index);
763 if (QWizardPage *oldPage = q->currentPage()) {
767 if (!(opts & QWizard::IndependentPages)) {
768 q->cleanupPage(oldId);
769 oldPage->d_func()->initialized =
false;
771 Q_ASSERT(history.constLast() == oldId);
772 history.removeLast();
773 Q_ASSERT(history.constLast() == newId);
779 QWizardPage *newPage = q->currentPage();
782 if (!newPage->d_func()->initialized) {
783 newPage->d_func()->initialized =
true;
784 q->initializePage(current);
786 history.append(current);
791 canContinue = (q->nextId() != -1);
792 canFinish = (newPage && newPage->isFinalPage());
797 const QWizard::WizardButton nextOrCommit =
798 newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
799 QAbstractButton *nextOrFinishButton =
800 btns[canContinue ? nextOrCommit : QWizard::FinishButton];
804
805
806
807
808
809
810
811
812 if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
813 candidate = nextOrFinishButton;
814 }
else if (newPage) {
815 candidate = iWantTheFocus(newPage);
818 candidate = nextOrFinishButton;
819 candidate->setFocus();
821 if (wizStyle == QWizard::MacStyle)
828 emit q->currentIdChanged(current);
835 case QWizard::BackButton:
837 case QWizard::NextButton:
838 case QWizard::CommitButton:
840 case QWizard::FinishButton:
841 return SLOT(accept());
842 case QWizard::CancelButton:
843 return SLOT(reject());
844 case QWizard::HelpButton:
845 return SIGNAL(helpRequested());
846 case QWizard::CustomButton1:
847 case QWizard::CustomButton2:
848 case QWizard::CustomButton3:
849 case QWizard::Stretch:
850 case QWizard::NoButton:
859 QStyle *style = q->style();
865 const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option, q);
866 info.topLevelMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, q);
867 info.topLevelMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, q);
868 info.topLevelMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, q);
869 info.topLevelMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, q);
870 info.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, titleLabel);
871 info.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, titleLabel);
872 info.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, titleLabel);
873 info.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, titleLabel);
874 info.hspacing = (layoutHorizontalSpacing == -1)
875 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
876 : layoutHorizontalSpacing;
877 info.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option, q);
878 info.buttonSpacing = (layoutHorizontalSpacing == -1)
879 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)
880 : layoutHorizontalSpacing;
882 if (wizStyle == QWizard::MacStyle)
885 info.wizStyle = wizStyle;
886 if (info.wizStyle == QWizard::AeroStyle
887#if QT_CONFIG(style_windowsvista)
891 info.wizStyle = QWizard::ModernStyle;
894 QString subTitleText;
895 QPixmap backgroundPixmap;
896 QPixmap watermarkPixmap;
898 if (QWizardPage *page = q->currentPage()) {
899 titleText = page->title();
900 subTitleText = page->subTitle();
901 backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
902 watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
905 info.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
906 && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
908 info.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
909 && !watermarkPixmap.isNull();
911 info.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
912 info.extension = (info.watermark || info.sideWidget) && (opts & QWizard::ExtendedWatermarkPixmap);
922
923
924 for (
int i = mainLayout->count() - 1; i >= 0; --i) {
925 QLayoutItem *item = mainLayout->takeAt(i);
926 if (item->layout()) {
927 item->layout()->setParent(
nullptr);
932 for (
int i = mainLayout->columnCount() - 1; i >= 0; --i)
933 mainLayout->setColumnMinimumWidth(i, 0);
934 for (
int i = mainLayout->rowCount() - 1; i >= 0; --i)
935 mainLayout->setRowMinimumHeight(i, 0);
938
939
941 bool mac = (info.wizStyle == QWizard::MacStyle);
942 bool classic = (info.wizStyle == QWizard::ClassicStyle);
943 bool modern = (info.wizStyle == QWizard::ModernStyle);
944 bool aero = (info.wizStyle == QWizard::AeroStyle);
960 int pageColumn = qMin(1, numColumns - 1);
963 mainLayout->setContentsMargins(QMargins());
964 mainLayout->setSpacing(0);
965 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);
966 pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
969 mainLayout->setContentsMargins(QMargins());
970 mainLayout->setSpacing(0);
971 pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
972 deltaMarginRight, deltaMarginBottom);
973 buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
974 info.topLevelMarginRight, info.topLevelMarginBottom);
976 mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
977 info.topLevelMarginRight, info.topLevelMarginBottom);
978 mainLayout->setHorizontalSpacing(info.hspacing);
979 mainLayout->setVerticalSpacing(info.vspacing);
980 pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
981 buttonLayout->setContentsMargins(0, 0, 0, 0);
984 buttonLayout->setSpacing(info.buttonSpacing);
988 headerWidget =
new QWizardHeader(antiFlickerWidget);
990 mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
995 int watermarkStartRow = row;
998 mainLayout->setRowMinimumHeight(row++, 10);
1002 titleLabel =
new QLabel(antiFlickerWidget);
1003 titleLabel->setBackgroundRole(QPalette::Base);
1004 titleLabel->setWordWrap(
true);
1007 QFont titleFont = q->font();
1008 titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4));
1009 titleFont.setBold(
true);
1010 titleLabel->setPalette(QPalette());
1014 titleFont = QFont(
"Segoe UI"_L1, 12);
1015 QPalette pal(titleLabel->palette());
1016 pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1017 titleLabel->setPalette(pal);
1020 titleLabel->setFont(titleFont);
1021 const int aeroTitleIndent = 25;
1023 titleLabel->setIndent(aeroTitleIndent);
1025 titleLabel->setIndent(2);
1027 titleLabel->setIndent(info.childMarginLeft);
1029 titleLabel->setIndent(info.topLevelMarginLeft);
1032 placeholderWidget1 =
new QWidget(antiFlickerWidget);
1033 placeholderWidget1->setBackgroundRole(QPalette::Base);
1036 mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1038 mainLayout->addWidget(titleLabel, row++, pageColumn);
1041 placeholderWidget2 =
new QWidget(antiFlickerWidget);
1042 placeholderWidget2->setBackgroundRole(QPalette::Base);
1045 mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1048 mainLayout->setRowMinimumHeight(row++, 7);
1056 if (!subTitleLabel) {
1057 subTitleLabel =
new QLabel(pageFrame);
1058 subTitleLabel->setWordWrap(
true);
1060 subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1061 info.childMarginRight , 0);
1063 pageVBoxLayout->insertWidget(1, subTitleLabel);
1068 changeSpacerSize(pageVBoxLayout, 0, 0, info.subTitle ? info.childMarginLeft : 0);
1070 int hMargin = mac ? 1 : 0;
1071 int vMargin = hMargin;
1073 pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame);
1074 pageFrame->setLineWidth(0);
1075 pageFrame->setMidLineWidth(hMargin);
1080 vMargin = deltaMarginBottom;
1081 }
else if (classic) {
1088 int leftMargin = 18;
1089 int topMargin = vMargin;
1090 int rightMargin = hMargin;
1091 int bottomMargin = vMargin;
1092 pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1094 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1098 watermarkLabel =
new QWatermarkLabel(antiFlickerWidget, sideWidget);
1099 watermarkLabel->setBackgroundRole(QPalette::Base);
1101 watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
1102 watermarkLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
1106 const bool wasSemiTransparent =
1107 pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
1108 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1110 pageFrame->setAutoFillBackground(
true);
1113 if (wasSemiTransparent)
1114 pageFrame->setPalette(QPalette());
1116 bool baseBackground = (modern && !info
.header);
1117 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);
1120 titleLabel->setAutoFillBackground(baseBackground);
1121 pageFrame->setAutoFillBackground(baseBackground);
1130 QPalette pal = pageFrame->palette();
1131 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1132 pageFrame->setPalette(pal);
1133 pageFrame->setAutoFillBackground(
true);
1135 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1141 mainLayout->addWidget(pageFrame, row++, pageColumn);
1143 int watermarkEndRow = row;
1145 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1148 buttonLayout->setContentsMargins(9, 9, 9, 9);
1149 mainLayout->setContentsMargins(0, 11, 0, 0);
1152 int buttonStartColumn = info
.extension ? 1 : 0;
1153 int buttonNumColumns = info
.extension ? 1 : numColumns;
1155 if (classic || modern) {
1157 bottomRuler =
new QWizardRuler(antiFlickerWidget);
1158 mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1162 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1164 mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1168 watermarkEndRow = row;
1169 mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1170 watermarkEndRow - watermarkStartRow, 1);
1173 mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1175 mainLayout->setColumnMinimumWidth(2, 21);
1180 titleLabel->setVisible(info.title);
1182 subTitleLabel->setVisible(info.subTitle);
1198 if (layoutInfo != info)
1200 QWizardPage *page = q->currentPage();
1208 bool expandPage = !page->layout();
1210 const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page));
1211 expandPage = pageItem->expandingDirections() & Qt::Vertical;
1213 QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1214 Q_ASSERT(bottomSpacer);
1215 bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding);
1216 pageVBoxLayout->invalidate();
1221 headerWidget->setup(info, page->title(), page->subTitle(),
1222 page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap),
1223 titleFmt, subTitleFmt);
1230 pix = page->pixmap(QWizard::WatermarkPixmap);
1232 pix = q->pixmap(QWizard::WatermarkPixmap);
1239 titleLabel->setTextFormat(titleFmt);
1240 titleLabel->setText(page->title());
1244 subTitleLabel->setTextFormat(subTitleFmt);
1245 subTitleLabel->setText(page->subTitle());
1253 if (wizStyle == QWizard::MacStyle) {
1262 QPalette newPalette = QApplication::palette(pageFrame);
1264 QColor windowColor = newPalette.brush(QPalette::Window).color();
1265 windowColor.setAlpha(153);
1266 newPalette.setBrush(QPalette::Window, windowColor);
1268 QColor baseColor = newPalette.brush(QPalette::Base).color();
1269 baseColor.setAlpha(153);
1270 newPalette.setBrush(QPalette::Base, baseColor);
1272 pageFrame->setPalette(newPalette);
1280 int extraHeight = 0;
1281#if QT_CONFIG(style_windowsvista)
1282 if (isVistaThemeEnabled())
1283 extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1285 QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1286 QSize maximumSize = mainLayout->totalMaximumSize();
1287 if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1292 minimumSize.setHeight(mainLayout->totalSizeHint().height());
1294 if (q->minimumWidth() == minimumWidth) {
1296 q->setMinimumWidth(minimumWidth);
1298 if (q->minimumHeight() == minimumHeight) {
1300 q->setMinimumHeight(minimumHeight);
1302 if (q->maximumWidth() == maximumWidth) {
1303 maximumWidth = maximumSize.width();
1304 q->setMaximumWidth(maximumWidth);
1306 if (q->maximumHeight() == maximumHeight) {
1307 maximumHeight = maximumSize.height();
1308 q->setMaximumHeight(maximumHeight);
1315 if (q->currentPage()) {
1316 canContinue = (q->nextId() != -1);
1317 canFinish = q->currentPage()->isFinalPage();
1329 case QWizard::CommitButton:
1330 return u"qt_wizard_commit"_s;
1331 case QWizard::FinishButton:
1332 return u"qt_wizard_finish"_s;
1333 case QWizard::CancelButton:
1334 return u"qt_wizard_cancel"_s;
1335 case QWizard::BackButton:
1336 case QWizard::NextButton:
1337 case QWizard::HelpButton:
1338 case QWizard::CustomButton1:
1339 case QWizard::CustomButton2:
1340 case QWizard::CustomButton3:
1342 return "__qt__passive_wizardbutton"_L1 + QString::number(which);
1343 case QWizard::Stretch:
1344 case QWizard::NoButton:
1349 Q_UNREACHABLE_RETURN(QString());
1355 if (uint(which) >= QWizard::NButtons)
1359 QPushButton *pushButton =
new QPushButton(antiFlickerWidget);
1360 QStyle *style = q->style();
1361 if (style != QApplication::style())
1362 pushButton->setStyle(style);
1363 pushButton->setObjectName(object_name_for_button(which));
1365 pushButton->setAutoDefault(
false);
1369 const_cast<QWizardPrivate *>(
this)->btns[which] = pushButton;
1371 btns[which] = pushButton;
1373 if (which < QWizard::NStandardButtons)
1374 pushButton->setText(buttonDefaultText(wizStyle, which,
this));
1376 connectButton(which);
1384 if (which < QWizard::NStandardButtons) {
1385 QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1387 QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1394 for (
int i = 0; i < QWizard::NButtons; ++i) {
1396 if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1397 btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1398 else if (buttonCustomTexts.contains(i))
1399 btns[i]->setText(buttonCustomTexts.value(i));
1400 else if (i < QWizard::NStandardButtons)
1401 btns[i]->setText(buttonDefaultText(wizStyle, i,
this));
1407#if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1408 if (btns[QWizard::NextButton] && isVistaThemeEnabled()) {
1409 if (vistaNextShortcut.isNull()) {
1411 new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right),
1412 btns[QWizard::NextButton], SLOT(animateClick()));
1415 delete vistaNextShortcut;
1423 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array{
1424 buttonsCustomLayout.cbegin(), buttonsCustomLayout.cend()};
1425 setButtonLayout(array.constData(),
int(array.size()));
1430 const int ArraySize = 12;
1431 QWizard::WizardButton array[ArraySize];
1432 memset(array, -1,
sizeof(array));
1433 Q_ASSERT(array[0] == QWizard::NoButton);
1435 if (opts & QWizard::HaveHelpButton) {
1436 int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1437 array[i] = QWizard::HelpButton;
1439 array[1] = QWizard::Stretch;
1440 if (opts & QWizard::HaveCustomButton1)
1441 array[2] = QWizard::CustomButton1;
1442 if (opts & QWizard::HaveCustomButton2)
1443 array[3] = QWizard::CustomButton2;
1444 if (opts & QWizard::HaveCustomButton3)
1445 array[4] = QWizard::CustomButton3;
1447 if (!(opts & QWizard::NoCancelButton)) {
1448 int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1449 array[i] = QWizard::CancelButton;
1451 array[6] = QWizard::BackButton;
1452 array[7] = QWizard::NextButton;
1453 array[8] = QWizard::CommitButton;
1454 array[9] = QWizard::FinishButton;
1456 setButtonLayout(array, ArraySize);
1464 for (
int i = buttonLayout->count() - 1; i >= 0; --i) {
1465 QLayoutItem *item = buttonLayout->takeAt(i);
1466 if (
QWidget *widget = item->widget())
1471 for (
int i = 0; i < size; ++i) {
1472 QWizard::WizardButton which = array[i];
1473 if (which == QWizard::Stretch) {
1474 buttonLayout->addStretch(1);
1475 }
else if (which != QWizard::NoButton) {
1476 ensureButton(which);
1477 buttonLayout->addWidget(btns[which]);
1480 if (which != QWizard::BackButton && which != QWizard::NextButton
1481 && which != QWizard::CommitButton && which != QWizard::FinishButton)
1482 btns[which]->show();
1485 QWidget::setTabOrder(prev, btns[which]);
1495 return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
1501 if (which == QWizard::BackgroundPixmap) {
1502 if (wizStyle == QWizard::MacStyle) {
1504 q->updateGeometry();
1511#if QT_CONFIG(style_windowsvista)
1512bool QWizardPrivate::vistaDisabled()
const
1515 const QVariant v = q->property(
"_q_wizard_vista_off");
1516 return v.isValid() && v.toBool();
1519bool QWizardPrivate::handleAeroStyleChange()
1523 if (inHandleAeroStyleChange)
1529 const bool isWindow = q->isWindow();
1530 if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1532 inHandleAeroStyleChange =
true;
1534 vistaHelper->disconnectBackButton();
1535 q->removeEventFilter(vistaHelper);
1537 bool vistaMargins =
false;
1539 if (isVistaThemeEnabled()) {
1540 const int topOffset = vistaHelper->topOffset(q);
1541 const int topPadding = vistaHelper->topPadding(q);
1543 vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1544 q->installEventFilter(vistaHelper);
1546 q->setMouseTracking(
true);
1547 antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1548 vistaHelper->backButton()->move(
1550 - qMin(topOffset, topPadding + 1));
1551 vistaMargins =
true;
1552 vistaHelper->backButton()->show();
1554 vistaHelper->setTitleBarIconAndCaptionVisible(
false);
1556 vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1557 vistaHelper->backButton()->show();
1559 q->setMouseTracking(
true);
1563 antiFlickerWidget->move(0, 0);
1564 vistaHelper->hideBackButton();
1566 vistaHelper->setTitleBarIconAndCaptionVisible(
true);
1569 _q_updateButtonStates();
1571 vistaHelper->updateCustomMargins(vistaMargins);
1573 inHandleAeroStyleChange =
false;
1580#if QT_CONFIG(style_windowsvista)
1581 return wizStyle == QWizard::AeroStyle && !vistaDisabled();
1591 q->setUpdatesEnabled(
false);
1601 q->setUpdatesEnabled(
true);
1608 QObject *button = q->sender();
1609 for (
int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1610 if (btns[i] == button) {
1611 emit q->customButtonClicked(QWizard::WizardButton(i));
1623 const QWizardPage *page = q->currentPage();
1624 bool complete = page && page->isComplete();
1626 btn.back->setEnabled(history.size() > 1
1627 && !q->page(history.at(history.size() - 2))->isCommitPage()
1628 && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage)));
1629 btn.next->setEnabled(canContinue && complete);
1630 btn.commit->setEnabled(canContinue && complete);
1631 btn.finish->setEnabled(canFinish && complete);
1633 const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1634 && (history.size() > 1 || !(opts & QWizard::NoBackButtonOnStartPage))
1635 && (canContinue || !(opts & QWizard::NoBackButtonOnLastPage));
1636 bool commitPage = page && page->isCommitPage();
1637 btn.back->setVisible(backButtonVisible);
1638 btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1639 && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage)));
1640 btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1642 btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1643 && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
1645 if (!(opts & QWizard::NoCancelButton))
1646 btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1647 && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
1649 bool useDefault = !(opts & QWizard::NoDefaultButton);
1650 if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1651 nextPush->setDefault(canContinue && useDefault && !commitPage);
1652 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1653 commitPush->setDefault(canContinue && useDefault && commitPage);
1654 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1655 finishPush->setDefault(!canContinue && useDefault);
1657#if QT_CONFIG(style_windowsvista)
1658 if (isVistaThemeEnabled()) {
1659 vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1660 vistaHelper->backButton()->setVisible(backButtonVisible);
1661 btn.back->setVisible(
false);
1670 int destroyed_index = -1;
1671 QList<QWizardField>::iterator it = fields.begin();
1672 while (it != fields.end()) {
1674 if (field.object == object) {
1675 destroyed_index = fieldIndexMap.value(field.name, -1);
1676 fieldIndexMap.remove(field.name);
1677 it = fields.erase(it);
1682 if (destroyed_index != -1) {
1683 QMap<QString,
int>::iterator it2 = fieldIndexMap.begin();
1684 while (it2 != fieldIndexMap.end()) {
1685 int index = it2.value();
1686 if (index > destroyed_index) {
1687 QString field_name = it2.key();
1688 fieldIndexMap.insert(field_name, index-1);
1697 for (
int i = 0; i < QWizard::NButtons; i++)
1699 btns[i]->setStyle(style);
1700 const PageMap::const_iterator pcend = pageMap.constEnd();
1701 for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1702 it.value()->setStyle(style);
1706QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1708 auto *keyboardAssistantURL = [NSWorkspace.sharedWorkspace
1709 URLForApplicationWithBundleIdentifier:@
"com.apple.KeyboardSetupAssistant"];
1710 auto *keyboardAssistantBundle = [NSBundle bundleWithURL:keyboardAssistantURL];
1711 auto *assistantBackground = [keyboardAssistantBundle imageForResource:@
"Background"];
1712 auto size = QSizeF::fromCGSize(assistantBackground.size);
1713 static const QSizeF expectedSize(242, 414);
1714 if (size == expectedSize)
1715 return qt_mac_toQPixmap(assistantBackground, size);
1721#if QT_CONFIG(style_windowsvista)
1722void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
1724 if (wizardPrivate->isVistaThemeEnabled()) {
1725 int leftMargin, topMargin, rightMargin, bottomMargin;
1726 wizardPrivate->buttonLayout->getContentsMargins(
1727 &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1728 const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1729 QPainter painter(
this);
1730 const QBrush brush(QColor(240, 240, 240));
1731 painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1732 painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0));
1733 painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2115
2116
2117
2118
2119QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
2120 : QDialog(*
new QWizardPrivate, parent, flags)
2127
2128
2132 delete d->buttonLayout;
2136
2137
2138
2139
2140
2141
2142
2143int QWizard::addPage(QWizardPage *page)
2147 if (!d->pageMap.isEmpty())
2148 theid = d->pageMap.lastKey() + 1;
2149 setPage(theid, page);
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163void QWizard::setPage(
int theid, QWizardPage *page)
2167 if (Q_UNLIKELY(!page)) {
2168 qWarning(
"QWizard::setPage: Cannot insert null page");
2172 if (Q_UNLIKELY(theid == -1)) {
2173 qWarning(
"QWizard::setPage: Cannot insert page with ID -1");
2177 if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2178 qWarning(
"QWizard::setPage: Page with duplicate ID %d ignored", theid);
2182 page->setParent(d->pageFrame);
2184 QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2185 for (
const auto &field : std::as_const(pendingFields))
2187 pendingFields.clear();
2189 connect(page, SIGNAL(completeChanged()),
this, SLOT(_q_updateButtonStates()));
2191 d->pageMap.insert(theid, page);
2192 page->d_func()->wizard =
this;
2194 int n = d->pageVBoxLayout->count();
2197 bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2198 d->pageVBoxLayout->setEnabled(
false);
2200 d->pageVBoxLayout->insertWidget(n - 1, page);
2204 d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2206 if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2208 emit pageAdded(theid);
2212
2213
2214
2215
2216
2217
2218void QWizard::removePage(
int id)
2222 QWizardPage *removedPage =
nullptr;
2225 if (d->pageMap.size() > 0) {
2226 if (d->start == id) {
2227 const int firstId = d->pageMap.constBegin().key();
2228 if (firstId == id) {
2229 if (d->pageMap.size() > 1)
2230 d->start = (++d->pageMap.constBegin()).key();
2236 d->startSetByUser =
false;
2240 if (d->pageMap.contains(id))
2241 emit pageRemoved(id);
2243 if (!d->history.contains(id)) {
2245 removedPage = d->pageMap.take(id);
2246 d->updateCurrentPage();
2247 }
else if (id != d->current) {
2249 removedPage = d->pageMap.take(id);
2250 d->history.removeOne(id);
2251 d->_q_updateButtonStates();
2252 }
else if (d->history.size() == 1) {
2255 removedPage = d->pageMap.take(id);
2256 if (d->pageMap.isEmpty())
2257 d->updateCurrentPage();
2263 removedPage = d->pageMap.take(id);
2264 d->updateCurrentPage();
2268 if (removedPage->d_func()->initialized) {
2270 removedPage->d_func()->initialized =
false;
2273 d->pageVBoxLayout->removeWidget(removedPage);
2275 for (
int i = d->fields.size() - 1; i >= 0; --i) {
2276 if (d->fields.at(i).page == removedPage) {
2277 removedPage->d_func()->pendingFields += d->fields.at(i);
2278 d->removeFieldAt(i);
2285
2286
2287
2288
2289
2290
2291
2292QWizardPage *QWizard::page(
int theid)
const
2295 return d->pageMap.value(theid);
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308bool QWizard::hasVisitedPage(
int theid)
const
2311 return d->history.contains(theid);
2315
2316
2317
2318
2319
2320
2321
2322QList<
int> QWizard::visitedIds()
const
2329
2330
2331QList<
int> QWizard::pageIds()
const
2334 return d->pageMap.keys();
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347void QWizard::setStartId(
int theid)
2350 int newStart = theid;
2352 newStart = d->pageMap.size() ? d->pageMap.constBegin().key() : -1;
2354 if (d->start == newStart) {
2355 d->startSetByUser = theid != -1;
2359 if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2360 qWarning(
"QWizard::setStartId: Invalid page ID %d", newStart);
2363 d->start = newStart;
2364 d->startSetByUser = theid != -1;
2367int QWizard::startId()
const
2374
2375
2376
2377
2378
2379
2380
2381QWizardPage *QWizard::currentPage()
const
2384 return page(d->current);
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399int QWizard::currentId()
const
2406
2407
2408
2409
2410
2411
2412void QWizard::setField(
const QString &name,
const QVariant &value)
2416 int index = d->fieldIndexMap.value(name, -1);
2417 if (Q_UNLIKELY(index == -1)) {
2418 qWarning(
"QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2422 const QWizardField &field = d->fields.at(index);
2423 if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2424 qWarning(
"QWizard::setField: Couldn't write to property '%s'",
2425 field.property.constData());
2429
2430
2431
2432
2433
2434
2435QVariant QWizard::field(
const QString &name)
const
2439 int index = d->fieldIndexMap.value(name, -1);
2440 if (Q_UNLIKELY(index == -1)) {
2441 qWarning(
"QWizard::field: No such field '%ls'", qUtf16Printable(name));
2445 const QWizardField &field = d->fields.at(index);
2446 return field.object->property(field.property);
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461void QWizard::setWizardStyle(WizardStyle style)
2465 const bool styleChange = style != d->wizStyle;
2467#if QT_CONFIG(style_windowsvista)
2468 const bool aeroStyleChange =
2469 d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2470 d->vistaStateChanged =
false;
2471 d->vistaInitPending =
false;
2475#if QT_CONFIG(style_windowsvista)
2479 d->disableUpdates();
2480 d->wizStyle = style;
2481 d->updateButtonTexts();
2482#if QT_CONFIG(style_windowsvista)
2483 if (aeroStyleChange) {
2486 QResizeEvent ev(geometry().size(), geometry().size());
2487 QCoreApplication::sendEvent(
this, &ev);
2493#if QT_CONFIG(style_windowsvista)
2495 if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2496 d->vistaInitPending =
true;
2501QWizard::WizardStyle QWizard::wizardStyle()
const
2508
2509
2510
2511
2512
2513void QWizard::setOption(WizardOption option,
bool on)
2516 if (!(d->opts & option) != !on)
2517 setOptions(d->opts ^ option);
2521
2522
2523
2524
2525
2526bool QWizard::testOption(WizardOption option)
const
2529 return (d->opts & option) != 0;
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546void QWizard::setOptions(WizardOptions options)
2550 WizardOptions changed = (options ^ d->opts);
2554 d->disableUpdates();
2557 if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2558 d->cleanupPagesNotInHistory();
2560 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
2561 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
2562 | HaveCustomButton3)) {
2563 d->updateButtonLayout();
2564 }
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2565 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
2566 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
2567 d->_q_updateButtonStates();
2574QWizard::WizardOptions QWizard::options()
const
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597void QWizard::setButtonText(WizardButton which,
const QString &text)
2601 if (!d->ensureButton(which))
2604 d->buttonCustomTexts.insert(which, text);
2606 if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2607 d->btns[which]->setText(text);
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622QString QWizard::buttonText(WizardButton which)
const
2626 if (!d->ensureButton(which))
2629 if (d->buttonCustomTexts.contains(which))
2630 return d->buttonCustomTexts.value(which);
2632 const QString defText = buttonDefaultText(d->wizStyle, which, d);
2633 if (!defText.isNull())
2636 return d->btns[which]->text();
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657void QWizard::setButtonLayout(
const QList<WizardButton> &layout)
2661 for (
int i = 0; i < layout.size(); ++i) {
2662 WizardButton button1 = layout.at(i);
2664 if (button1 == NoButton || button1 == Stretch)
2666 if (!d->ensureButton(button1))
2670 for (
int j = 0; j < i; ++j) {
2671 WizardButton button2 = layout.at(j);
2672 if (Q_UNLIKELY(button2 == button1)) {
2673 qWarning(
"QWizard::setButtonLayout: Duplicate button in layout");
2679 d->buttonsHaveCustomLayout =
true;
2680 d->buttonsCustomLayout = layout;
2681 d->updateButtonLayout();
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694void QWizard::setButton(WizardButton which, QAbstractButton *button)
2698 if (uint(which) >= NButtons || d->btns[which] == button)
2701 if (QAbstractButton *oldButton = d->btns[which]) {
2702 d->buttonLayout->removeWidget(oldButton);
2706 d->btns[which] = button;
2708 button->setParent(d->antiFlickerWidget);
2709 d->buttonCustomTexts.insert(which, button->text());
2710 d->connectButton(which);
2712 d->buttonCustomTexts.remove(which);
2713 d->ensureButton(which);
2716 d->updateButtonLayout();
2720
2721
2722
2723
2724QAbstractButton *QWizard::button(WizardButton which)
const
2727#if QT_CONFIG(style_windowsvista)
2728 if (d->wizStyle == AeroStyle && which == BackButton)
2729 return d->vistaHelper->backButton();
2731 if (!d->ensureButton(which))
2733 return d->btns[which];
2737
2738
2739
2740
2741
2742
2743
2744void QWizard::setTitleFormat(Qt::TextFormat format)
2747 d->titleFmt = format;
2751Qt::TextFormat QWizard::titleFormat()
const
2758
2759
2760
2761
2762
2763
2764
2765void QWizard::setSubTitleFormat(Qt::TextFormat format)
2768 d->subTitleFmt = format;
2772Qt::TextFormat QWizard::subTitleFormat()
const
2775 return d->subTitleFmt;
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790void QWizard::setPixmap(WizardPixmap which,
const QPixmap &pixmap)
2793 Q_ASSERT(uint(which) < NPixmaps);
2794 d->defaultPixmaps[which] = pixmap;
2795 d->updatePixmap(which);
2799
2800
2801
2802
2803
2804
2805
2806QPixmap QWizard::pixmap(WizardPixmap which)
const
2809 Q_ASSERT(uint(which) < NPixmaps);
2811 if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2812 d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2814 return d->defaultPixmaps[which];
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842void QWizard::setDefaultProperty(
const char *className,
const char *property,
2843 const char *changedSignal)
2846 for (
int i = d->defaultPropertyTable.size() - 1; i >= 0; --i) {
2847 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2848 d->defaultPropertyTable.remove(i);
2852 d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877void QWizard::setSideWidget(QWidget *widget)
2881 d->sideWidget = widget;
2882 if (d->watermarkLabel) {
2883 d->watermarkLabel->setSideWidget(widget);
2889
2890
2891
2892
2893QWidget *QWizard::sideWidget()
const
2897 return d->sideWidget;
2901
2902
2903void QWizard::setVisible(
bool visible)
2907 if (d->current == -1)
2910 QDialog::setVisible(visible);
2914
2915
2916QSize QWizard::sizeHint()
const
2919 QSize result = d->mainLayout->totalSizeHint();
2920 QSize extra(500, 360);
2921 if (d->wizStyle == MacStyle && d->current != -1) {
2922 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());
2923 extra.setWidth(616);
2924 if (!pixmap.isNull()) {
2925 extra.setHeight(pixmap.height());
2928
2929
2930
2931
2932
2933 if (pixmap.width() >= pixmap.height())
2934 extra.setWidth(pixmap.width());
2937 return result.expandedTo(extra);
2941
2942
2943
2944
2945
2946
2947
2950
2951
2952
2953
2954
2955
2956
2959
2960
2961
2962
2963
2964
2965
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3009
3010
3011
3012
3013
3014
3018 int n = d->history.size() - 2;
3021 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3025
3026
3027
3028
3029
3030
3035 if (d->current == -1)
3038 if (validateCurrentPage()) {
3039 int next = nextId();
3041 if (Q_UNLIKELY(d->history.contains(next))) {
3042 qWarning(
"QWizard::next: Page %d already met", next);
3045 if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3046 qWarning(
"QWizard::next: No such page %d", next);
3049 d->switchToPage(next, QWizardPrivate::Forward);
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3069void QWizard::setCurrentId(
int id)
3073 if (d->current == -1)
3076 if (currentId() == id)
3079 if (!validateCurrentPage())
3082 if (id < 0 || Q_UNLIKELY(!d->pageMap.contains(id))) {
3083 qWarning(
"QWizard::setCurrentId: No such page: %d", id);
3087 d->switchToPage(id, (id < currentId()) ? QWizardPrivate::Backward : QWizardPrivate::Forward);
3091
3092
3093
3094
3095
3096void QWizard::restart()
3099 d->disableUpdates();
3101 d->switchToPage(startId(), QWizardPrivate::Forward);
3106
3107
3108bool QWizard::event(QEvent *event)
3111 if (event->type() == QEvent::StyleChange) {
3112 d->setStyle(style());
3114 }
else if (event->type() == QEvent::PaletteChange) {
3117#if QT_CONFIG(style_windowsvista)
3118 else if (event->type() == QEvent::Show && d->vistaInitPending) {
3119 d->vistaInitPending =
false;
3120 d->wizStyle = AeroStyle;
3121 d->handleAeroStyleChange();
3123 else if (d->isVistaThemeEnabled()) {
3124 if (event->type() == QEvent::Resize
3125 || event->type() == QEvent::LayoutDirectionChange) {
3126 const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3127 ? width() - d->vistaHelper->backButton()->sizeHint().width()
3130 d->vistaHelper->backButton()->move(buttonLeft,
3131 d->vistaHelper->backButton()->y());
3134 d->vistaHelper->mouseEvent(event);
3137 return QDialog::event(event);
3141
3142
3143void QWizard::resizeEvent(QResizeEvent *event)
3146 int heightOffset = 0;
3147#if QT_CONFIG(style_windowsvista)
3148 if (d->isVistaThemeEnabled()) {
3149 heightOffset = d->vistaHelper->topOffset(
this);
3150 heightOffset += d->vistaHelper->titleBarSize();
3153 d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3154#if QT_CONFIG(style_windowsvista)
3155 if (d->isVistaThemeEnabled())
3156 d->vistaHelper->resizeEvent(event);
3158 QDialog::resizeEvent(event);
3162
3163
3164void QWizard::paintEvent(QPaintEvent * event)
3167 if (d->wizStyle == MacStyle && currentPage()) {
3168 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3169 if (backgroundPixmap.isNull())
3172 QStylePainter painter(
this);
3173 painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3175#if QT_CONFIG(style_windowsvista)
3176 else if (d->isVistaThemeEnabled()) {
3177 d->vistaHelper->paintEvent(event);
3184#if defined(Q_OS_WIN) || defined(Q_QDOC)
3186
3187
3188bool QWizard::nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result)
3190#if QT_CONFIG(style_windowsvista)
3192 if (d->isVistaThemeEnabled() && eventType ==
"windows_generic_MSG") {
3193 MSG *windowsMessage =
static_cast<MSG *>(message);
3194 const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3195 if (d->vistaDirty) {
3198 if (windowsMessage->message == WM_GETICON) {
3199 d->vistaStateChanged =
true;
3200 d->vistaDirty =
false;
3201 setWizardStyle(AeroStyle);
3204 return winEventResult;
3206 return QDialog::nativeEvent(eventType, message, result);
3209 return QDialog::nativeEvent(eventType, message, result);
3215
3216
3217void QWizard::done(
int result)
3221 if (result == Rejected) {
3224 if (!validateCurrentPage())
3227 QDialog::done(result);
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248void QWizard::initializePage(
int theid)
3250 QWizardPage *page =
this->page(theid);
3252 page->initializePage();
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266void QWizard::cleanupPage(
int theid)
3268 QWizardPage *page =
this->page(theid);
3270 page->cleanupPage();
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289bool QWizard::validateCurrentPage()
3291 QWizardPage *page = currentPage();
3295 return page->validatePage();
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312int QWizard::nextId()
const
3314 const QWizardPage *page = currentPage();
3318 return page->nextId();
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3389
3390
3391
3392
3393
3394
3395
3396
3397QWizardPage::QWizardPage(QWidget *parent)
3398 : QWidget(*
new QWizardPagePrivate, parent, { })
3400 connect(
this, SIGNAL(completeChanged()),
this, SLOT(_q_updateCachedCompleteState()));
3404
3405
3406QWizardPage::~QWizardPage()
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424void QWizardPage::setTitle(
const QString &title)
3428 if (d->wizard && d->wizard->currentPage() ==
this)
3429 d->wizard->d_func()->updateLayout();
3432QString QWizardPage::title()
const
3434 Q_D(
const QWizardPage);
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457void QWizardPage::setSubTitle(
const QString &subTitle)
3460 d->subTitle = subTitle;
3461 if (d->wizard && d->wizard->currentPage() ==
this)
3462 d->wizard->d_func()->updateLayout();
3465QString QWizardPage::subTitle()
const
3467 Q_D(
const QWizardPage);
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484void QWizardPage::setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap)
3487 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3488 d->pixmaps[which] = pixmap;
3489 if (d->wizard && d->wizard->currentPage() ==
this)
3490 d->wizard->d_func()->updatePixmap(which);
3494
3495
3496
3497
3498
3499
3500
3501
3502QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which)
const
3504 Q_D(
const QWizardPage);
3505 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3507 const QPixmap &pixmap = d->pixmaps[which];
3508 if (!pixmap.isNull())
3512 return wizard()->pixmap(which);
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534void QWizardPage::initializePage()
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549void QWizardPage::cleanupPage()
3553 const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3554 for (
const auto &field : fields) {
3555 if (field.page ==
this)
3556 field.object->setProperty(field.property, field.initialValue);
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575bool QWizardPage::validatePage()
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597bool QWizardPage::isComplete()
const
3599 Q_D(
const QWizardPage);
3604 const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3605 const auto end = wizardFields.crend();
3606 for (
auto it = wizardFields.crbegin(); it != end; ++it) {
3607 const QWizardField &field = *it;
3608 if (field.page ==
this && field.mandatory) {
3609 QVariant value = field.object->property(field.property);
3610 if (value == field.initialValue)
3613#if QT_CONFIG(lineedit)
3614 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3615 if (!lineEdit->hasAcceptableInput())
3619#if QT_CONFIG(spinbox)
3620 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3621 if (!spinBox->hasAcceptableInput())
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642void QWizardPage::setFinalPage(
bool finalPage)
3645 d->explicitlyFinal = finalPage;
3646 QWizard *wizard =
this->wizard();
3647 if (wizard && wizard->currentPage() ==
this)
3648 wizard->d_func()->updateCurrentPage();
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663bool QWizardPage::isFinalPage()
const
3665 Q_D(
const QWizardPage);
3666 if (d->explicitlyFinal)
3669 QWizard *wizard =
this->wizard();
3670 if (wizard && wizard->currentPage() ==
this) {
3672 return wizard->nextId() == -1;
3674 return nextId() == -1;
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692void QWizardPage::setCommitPage(
bool commitPage)
3695 d->commit = commitPage;
3696 QWizard *wizard =
this->wizard();
3697 if (wizard && wizard->currentPage() ==
this)
3698 wizard->d_func()->updateCurrentPage();
3702
3703
3704
3705
3706bool QWizardPage::isCommitPage()
const
3708 Q_D(
const QWizardPage);
3713
3714
3715
3716
3717
3718
3719
3720void QWizardPage::setButtonText(QWizard::WizardButton which,
const QString &text)
3723 d->buttonCustomTexts.insert(which, text);
3724 if (wizard() && wizard()->currentPage() ==
this && wizard()->d_func()->btns[which])
3725 wizard()->d_func()->btns[which]->setText(text);
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741QString QWizardPage::buttonText(QWizard::WizardButton which)
const
3743 Q_D(
const QWizardPage);
3745 if (d->buttonCustomTexts.contains(which))
3746 return d->buttonCustomTexts.value(which);
3749 return wizard()->buttonText(which);
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770int QWizardPage::nextId()
const
3772 Q_D(
const QWizardPage);
3777 bool foundCurrentPage =
false;
3779 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3780 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();
3781 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();
3783 for (; i != end; ++i) {
3784 if (i.value() ==
this) {
3785 foundCurrentPage =
true;
3786 }
else if (foundCurrentPage) {
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3808
3809
3810
3811
3812
3813
3814
3815
3816void QWizardPage::setField(
const QString &name,
const QVariant &value)
3821 d->wizard->setField(name, value);
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837QVariant QWizardPage::field(
const QString &name)
const
3839 Q_D(
const QWizardPage);
3842 return d->wizard->field(name);
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891void QWizardPage::registerField(
const QString &name, QWidget *widget,
const char *property,
3892 const char *changedSignal)
3895 QWizardField field(
this, name, widget, property, changedSignal);
3897 d->wizard->d_func()->addField(field);
3899 d->pendingFields += field;
3904
3905
3906
3907
3908
3909QWizard *QWizardPage::wizard()
const
3911 Q_D(
const QWizardPage);
3917#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
const char className[16]
[1]