6#include <QtWidgets/private/qtwidgetsglobal_p.h>
9#include "qabstractspinbox.h"
18#if QT_CONFIG(lineedit)
26#if QT_CONFIG(shortcut)
27# include "qshortcut.h"
32#if defined(Q_OS_MACOS)
33#include <AppKit/AppKit.h>
34#include <QtGui/private/qcoregraphics_p.h>
35#elif QT_CONFIG(style_windowsvista)
36#include "qwizard_win_p.h"
39#include "private/qdialog_p.h"
47using namespace Qt::StringLiterals;
61 QSpacerItem *spacer = layout->itemAt(index)->spacerItem();
64 spacer->changeSize(width, height);
69 const int MaxIterations = 100;
72 for (
int i = 0; i < MaxIterations; ++i) {
73 candidate = candidate->nextInFocusChain();
77 if (candidate->focusPolicy() & Qt::TabFocus) {
78 if (candidate != ancestor && ancestor->isAncestorOf(candidate))
86 const QByteArray &classY)
88 const QMetaObject *metaObject = object->metaObject();
90 if (metaObject->className() == classX)
92 if (metaObject->className() == classY)
94 metaObject = metaObject->superClass();
102} fallbackProperties[] = {
104 {
"QAbstractButton",
"checked" },
105 {
"QAbstractSlider",
"value" },
106 {
"QComboBox",
"currentIndex" },
107 {
"QDateTimeEdit",
"dateTime" },
108 {
"QLineEdit",
"text" },
109 {
"QListWidget",
"currentRow" },
110 {
"QSpinBox",
"value" },
122 case 0:
return SIGNAL(toggled(
bool));
123 case 1:
return SIGNAL(valueChanged(
int));
124 case 2:
return SIGNAL(currentIndexChanged(
int));
125 case 3:
return SIGNAL(dateTimeChanged(QDateTime));
126 case 4:
return SIGNAL(textChanged(QString));
127 case 5:
return SIGNAL(currentRowChanged(
int));
128 case 6:
return SIGNAL(valueChanged(
int));
130 static_assert(7 == NFallbackDefaultProperties);
131 Q_UNREACHABLE_RETURN(
nullptr);
143 const char *changedSignal)
152 QWizardField(QWizardPage *page,
const QString &spec, QObject *object,
const char *property,
153 const char *changedSignal);
155 void resolve(
const QList<QWizardDefaultProperty> &defaultPropertyTable);
169 const char *property,
const char *changedSignal)
173 if (name.endsWith(u'*')) {
181 if (property.isEmpty())
182 findProperty(defaultPropertyTable.constData()
, defaultPropertyTable.size()
);
183 initialValue = object->property(property);
188 QByteArray className;
190 for (
int i = 0; i < propertyCount; ++i) {
191 if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)) {
192 className = properties[i].className;
193 property = properties[i].property;
194 changedSignal = properties[i].changedSignal;
227 return topLevelMarginLeft == other.topLevelMarginLeft
228 && topLevelMarginRight == other.topLevelMarginRight
229 && topLevelMarginTop == other.topLevelMarginTop
230 && topLevelMarginBottom == other.topLevelMarginBottom
231 && childMarginLeft == other.childMarginLeft
232 && childMarginRight == other.childMarginRight
233 && childMarginTop == other.childMarginTop
234 && childMarginBottom == other.childMarginBottom
235 && hspacing == other.hspacing
236 && vspacing == other.vspacing
237 && buttonSpacing == other.buttonSpacing
238 && wizStyle == other.wizStyle
239 && header == other.header
240 && watermark == other.watermark
241 && title == other.title
242 && subTitle == other.subTitle
243 && extension == other.extension
244 && sideWidget == other.sideWidget;
260 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
261 Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat,
262 QWizard::WizardOptions wizardOptions);
266#if QT_CONFIG(style_windowsvista)
272 QLabel *subTitleLabel;
275 QPixmap bannerPixmap;
282 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
283 setBackgroundRole(QPalette::Base);
285 titleLabel =
new QLabel(
this);
286 titleLabel->setBackgroundRole(QPalette::Base);
288 subTitleLabel =
new QLabel(
this);
289 subTitleLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
290 subTitleLabel->setWordWrap(
true);
292 logoLabel =
new QLabel(
this);
294 QFont font = titleLabel->font();
296 titleLabel->setFont(font);
298 layout =
new QGridLayout(
this);
299 layout->setContentsMargins(QMargins());
300 layout->setSpacing(0);
302 layout->setRowMinimumHeight(3, 1);
303 layout->setRowStretch(4, 1);
305 layout->setColumnStretch(2, 1);
306 layout->setColumnMinimumWidth(4, 2 * GapBetweenLogoAndRightEdge);
307 layout->setColumnMinimumWidth(6, GapBetweenLogoAndRightEdge);
309 layout->addWidget(titleLabel, 2, 1, 1, 2);
310 layout->addWidget(subTitleLabel, 4, 2);
311 layout->addWidget(logoLabel, 1, 5, 5, 1);
314#if QT_CONFIG(style_windowsvista)
315bool QWizardHeader::vistaDisabled()
const
317 bool styleDisabled =
false;
318 QWizard *wiz = parentWidget() ? qobject_cast <QWizard *>(parentWidget()->parentWidget()) : 0;
322 const QVariant v = wiz->property(
"_q_wizard_vista_off");
323 styleDisabled = v.isValid() && v.toBool();
325 return styleDisabled;
330 const QString &subTitle,
const QPixmap &logo,
const QPixmap &banner,
331 Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat,
332 QWizard::WizardOptions options)
334 bool modern = ((info.wizStyle == QWizard::ModernStyle)
335#if QT_CONFIG(style_windowsvista)
339 wizardOptions = options;
340 layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0);
341 layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0);
342 layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2);
347 layout->setColumnMinimumWidth(0, minColumnWidth0);
348 layout->setColumnMinimumWidth(1, minColumnWidth1);
350 titleLabel->setTextFormat(titleFormat);
351 titleLabel->setText(title);
352 logoLabel->setPixmap(logo);
354 subTitleLabel->setTextFormat(subTitleFormat);
355 subTitleLabel->setText(
"Pq\nPq"_L1);
356 int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
357 subTitleLabel->setText(subTitle);
360 bannerPixmap = banner;
362 bannerPixmap = QPixmap();
365 if (bannerPixmap.isNull() || wizardOptions.testFlag(QWizard::StretchBanner)) {
367
368
369 int candidateSubTitleWidth = qMin(512, 2 * QGuiApplication::primaryScreen()->virtualGeometry().width() / 3);
370 int delta = candidateSubTitleWidth >> 1;
372 if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
373 <= desiredSubTitleHeight)
374 candidateSubTitleWidth -= delta;
378 subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight);
380 QSize size = layout->totalMinimumSize();
381 setMinimumSize(size);
382 setMaximumSize(QWIDGETSIZE_MAX, size.height());
384 subTitleLabel->setMinimumSize(0, 0);
385 setFixedSize(banner.size() + QSize(0, 2));
393 if (wizardOptions.testFlag(QWizard::StretchBanner)) {
394 painter.setRenderHint(QPainter::SmoothPixmapTransform);
395 painter.drawPixmap(0, 0, width(), height(), bannerPixmap);
397 painter.drawPixmap(0, 0, bannerPixmap);
403 const qreal dpr = devicePixelRatio();
404 const int devHeight = qRound(height() * dpr);
405 const int devWidth = qRound(width() * dpr);
407 const qreal x = (devWidth - 2) / dpr;
408 const qreal y = (devHeight - 2) / dpr;
410 const qreal x1 = (devWidth - 1) / dpr;
411 const qreal y1 = (devHeight - 1) / dpr;
413 const QPalette &pal = palette();
414 painter.setPen(pal.mid().color());
415 painter.drawLine(QLineF(0, y, x, y));
416 painter.setPen(pal.base().color());
417 painter.drawPoint(QPointF(x1, y));
418 painter.drawLine(QLineF(0, y1, x1, y1));
433 m_layout =
new QVBoxLayout(
this);
435 m_layout->addWidget(m_sideWidget);
439 if (!pixmap().isNull())
440 return pixmap().deviceIndependentSize().toSize();
441 return QFrame::minimumSizeHint();
445 if (m_sideWidget == widget)
448 m_layout->removeWidget(m_sideWidget);
449 m_sideWidget->hide();
451 m_sideWidget = widget;
453 m_layout->addWidget(m_sideWidget);
459 QVBoxLayout *m_layout;
465 Q_DECLARE_PUBLIC(QWizardPage)
488 Q_Q(
const QWizardPage);
489 if (completeState == Tri_Unknown)
490 completeState = q->isComplete() ? Tri_True : Tri_False;
491 return completeState == Tri_True;
497 TriState newState = q->isComplete() ? Tri_True : Tri_False;
498 if (newState != completeState)
499 emit q->completeChanged();
505 completeState = q->isComplete() ? Tri_True : Tri_False;
511#if QT_CONFIG(style_windowsvista)
527 Q_DECLARE_PUBLIC(QWizard)
556#if QT_CONFIG(style_windowsvista)
603 mutable QAbstractButton *
btns[QWizard::NButtons];
620#if QT_CONFIG(style_windowsvista)
622# if QT_CONFIG(shortcut)
638#if !QT_CONFIG(style_windowsvista)
639 Q_UNUSED(wizardPrivate);
641 const bool macStyle = (wstyle == QWizard::MacStyle);
643 case QWizard::BackButton:
644 return macStyle ? QWizard::tr(
"Go Back") : QWizard::tr(
"< &Back");
645 case QWizard::NextButton:
647 return QWizard::tr(
"Continue");
650 ? QWizard::tr(
"&Next") : QWizard::tr(
"&Next >");
651 case QWizard::CommitButton:
652 return QWizard::tr(
"Commit");
653 case QWizard::FinishButton:
654 return macStyle ? QWizard::tr(
"Done") : QWizard::tr(
"&Finish");
655 case QWizard::CancelButton:
656 return QWizard::tr(
"Cancel");
657 case QWizard::HelpButton:
658 return macStyle ? QWizard::tr(
"Help") : QWizard::tr(
"&Help");
668 std::fill(btns, btns + QWizard::NButtons,
nullptr);
670 antiFlickerWidget =
new QWizardAntiFlickerWidget(q,
this);
671 wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle,
nullptr, q));
672 if (wizStyle == QWizard::MacStyle) {
673 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);
674 }
else if (wizStyle == QWizard::ModernStyle) {
675 opts = QWizard::HelpButtonOnRight;
678#if QT_CONFIG(style_windowsvista)
679 vistaHelper =
new QVistaHelper(q);
683 ensureButton(QWizard::BackButton);
684 ensureButton(QWizard::NextButton);
685 ensureButton(QWizard::CommitButton);
686 ensureButton(QWizard::FinishButton);
688 pageFrame =
new QFrame(antiFlickerWidget);
689 pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
691 pageVBoxLayout =
new QVBoxLayout(pageFrame);
692 pageVBoxLayout->setSpacing(0);
693 pageVBoxLayout->addSpacing(0);
694 QSpacerItem *spacerItem =
new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);
695 pageVBoxLayout->addItem(spacerItem);
697 buttonLayout =
new QHBoxLayout;
698 mainLayout =
new QGridLayout(antiFlickerWidget);
699 mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
703 defaultPropertyTable.reserve(NFallbackDefaultProperties);
704 for (uint i = 0; i < NFallbackDefaultProperties; ++i)
705 defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className,
706 fallbackProperties[i].property,
714 q->currentPage()->hide();
716 const auto end = history.crend();
717 for (
auto it = history.crbegin(); it != end; ++it)
720 for (QWizardPage *page : std::as_const(pageMap))
721 page->d_func()->initialized =
false;
724 emit q->currentIdChanged(-1);
732 for (
auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
733 const auto idx = it.key();
734 const auto page = it.value()->d_func();
735 if (page->initialized && !history.contains(idx)) {
737 page->initialized =
false;
747 myField.resolve(defaultPropertyTable);
749 if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
750 qWarning(
"QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
754 fieldIndexMap.insert(myField.name, fields.size());
756 if (myField.mandatory && !myField.changedSignal.isEmpty())
757 QObject::connect(myField.object, myField.changedSignal,
758 myField.page, SLOT(_q_maybeEmitCompleteChanged()));
760 myField.object, SIGNAL(destroyed(QObject*)), q,
761 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
769 fieldIndexMap.remove(field.name);
770 if (field.mandatory && !field.changedSignal.isEmpty())
771 QObject::disconnect(field.object, field.changedSignal,
772 field.page, SLOT(_q_maybeEmitCompleteChanged()));
774 field.object, SIGNAL(destroyed(QObject*)), q,
775 SLOT(_q_handleFieldObjectDestroyed(QObject*)));
776 fields.remove(index);
786 if (QWizardPage *oldPage = q->currentPage()) {
790 if (!(opts & QWizard::IndependentPages)) {
791 q->cleanupPage(oldId);
792 oldPage->d_func()->initialized =
false;
794 Q_ASSERT(history.constLast() == oldId);
795 history.removeLast();
796 Q_ASSERT(history.constLast() == newId);
802 QWizardPage *newPage = q->currentPage();
805 if (!newPage->d_func()->initialized) {
806 newPage->d_func()->initialized =
true;
807 q->initializePage(current);
809 history.append(current);
814 canContinue = (q->nextId() != -1);
815 canFinish = (newPage && newPage->isFinalPage());
820 const QWizard::WizardButton nextOrCommit =
821 newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
822 QAbstractButton *nextOrFinishButton =
823 btns[canContinue ? nextOrCommit : QWizard::FinishButton];
827
828
829
830
831
832
833
834
835 if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
836 candidate = nextOrFinishButton;
837 }
else if (newPage) {
838 candidate = iWantTheFocus(newPage);
841 candidate = nextOrFinishButton;
842 candidate->setFocus();
844 if (wizStyle == QWizard::MacStyle)
851 emit q->currentIdChanged(current);
858 case QWizard::BackButton:
860 case QWizard::NextButton:
861 case QWizard::CommitButton:
863 case QWizard::FinishButton:
864 return SLOT(accept());
865 case QWizard::CancelButton:
866 return SLOT(reject());
867 case QWizard::HelpButton:
868 return SIGNAL(helpRequested());
869 case QWizard::CustomButton1:
870 case QWizard::CustomButton2:
871 case QWizard::CustomButton3:
872 case QWizard::Stretch:
873 case QWizard::NoButton:
882 QStyle *style = q->style();
888 const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option, q);
893 info
.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin,
nullptr, titleLabel);
894 info
.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin,
nullptr, titleLabel);
895 info
.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin,
nullptr, titleLabel);
896 info
.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin,
nullptr, titleLabel);
897 info
.hspacing = (layoutHorizontalSpacing == -1)
898 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)
899 : layoutHorizontalSpacing;
900 info
.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option, q);
902 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)
903 : layoutHorizontalSpacing;
905 if (wizStyle == QWizard::MacStyle)
908 info.wizStyle = wizStyle;
909 if (info.wizStyle == QWizard::AeroStyle
910#if QT_CONFIG(style_windowsvista)
914 info.wizStyle = QWizard::ModernStyle;
917 QString subTitleText;
918 QPixmap backgroundPixmap;
919 QPixmap watermarkPixmap;
921 if (QWizardPage *page = q->currentPage()) {
922 titleText = page->title();
923 subTitleText = page->subTitle();
924 backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
925 watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
928 info.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
929 && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
931 info.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
932 && !watermarkPixmap.isNull();
934 info.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
935 info.extension = (info.watermark || info.sideWidget) && (opts & QWizard::ExtendedWatermarkPixmap);
945
946
947 for (
int i = mainLayout->count() - 1; i >= 0; --i) {
948 QLayoutItem *item = mainLayout->takeAt(i);
949 if (item->layout()) {
950 item->layout()->setParent(
nullptr);
955 for (
int i = mainLayout->columnCount() - 1; i >= 0; --i)
956 mainLayout->setColumnMinimumWidth(i, 0);
957 for (
int i = mainLayout->rowCount() - 1; i >= 0; --i)
958 mainLayout->setRowMinimumHeight(i, 0);
961
962
964 bool mac = (info.wizStyle == QWizard::MacStyle);
965 bool classic = (info.wizStyle == QWizard::ClassicStyle);
966 bool modern = (info.wizStyle == QWizard::ModernStyle);
967 bool aero = (info.wizStyle == QWizard::AeroStyle);
983 int pageColumn = qMin(1, numColumns - 1);
986 mainLayout->setContentsMargins(QMargins());
987 mainLayout->setSpacing(0);
988 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);
989 pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
992 mainLayout->setContentsMargins(QMargins());
993 mainLayout->setSpacing(0);
994 pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
995 deltaMarginRight, deltaMarginBottom);
996 buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
997 info.topLevelMarginRight, info.topLevelMarginBottom);
999 mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1000 info.topLevelMarginRight, info.topLevelMarginBottom);
1001 mainLayout->setHorizontalSpacing(info.hspacing);
1002 mainLayout->setVerticalSpacing(info.vspacing);
1003 pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
1004 buttonLayout->setContentsMargins(0, 0, 0, 0);
1007 buttonLayout->setSpacing(info.buttonSpacing);
1011 headerWidget =
new QWizardHeader(antiFlickerWidget);
1013 mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
1018 int watermarkStartRow = row;
1021 mainLayout->setRowMinimumHeight(row++, 10);
1025 titleLabel =
new QLabel(antiFlickerWidget);
1026 titleLabel->setBackgroundRole(QPalette::Base);
1027 titleLabel->setWordWrap(
true);
1030 QFont titleFont = q->font();
1031 titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4));
1032 titleFont.setBold(
true);
1033 titleLabel->setPalette(QPalette());
1037 titleFont = QFont(
"Segoe UI"_L1, 12);
1038 QPalette pal(titleLabel->palette());
1039 pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1040 titleLabel->setPalette(pal);
1043 titleLabel->setFont(titleFont);
1044 const int aeroTitleIndent = 25;
1046 titleLabel->setIndent(aeroTitleIndent);
1048 titleLabel->setIndent(2);
1050 titleLabel->setIndent(info.childMarginLeft);
1052 titleLabel->setIndent(info.topLevelMarginLeft);
1055 placeholderWidget1 =
new QWidget(antiFlickerWidget);
1059 mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1061 mainLayout->addWidget(titleLabel, row++, pageColumn);
1064 placeholderWidget2 =
new QWidget(antiFlickerWidget);
1068 mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1071 mainLayout->setRowMinimumHeight(row++, 7);
1079 if (!subTitleLabel) {
1080 subTitleLabel =
new QLabel(pageFrame);
1081 subTitleLabel->setWordWrap(
true);
1083 subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1084 info.childMarginRight , 0);
1086 pageVBoxLayout->insertWidget(1, subTitleLabel);
1093 int hMargin = mac ? 1 : 0;
1094 int vMargin = hMargin;
1096 pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame);
1097 pageFrame->setLineWidth(0);
1098 pageFrame->setMidLineWidth(hMargin);
1103 vMargin = deltaMarginBottom;
1104 }
else if (classic) {
1111 int leftMargin = 18;
1112 int topMargin = vMargin;
1113 int rightMargin = hMargin;
1114 int bottomMargin = vMargin;
1115 pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1117 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1121 watermarkLabel =
new QWatermarkLabel(antiFlickerWidget, sideWidget);
1124 watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
1129 const bool wasSemiTransparent =
1130 pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
1131 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1133 pageFrame->setAutoFillBackground(
true);
1136 if (wasSemiTransparent)
1137 pageFrame->setPalette(QPalette());
1139 bool baseBackground = (modern && !info
.header);
1140 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);
1143 titleLabel->setAutoFillBackground(baseBackground);
1144 pageFrame->setAutoFillBackground(baseBackground);
1153 QPalette pal = pageFrame->palette();
1154 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1155 pageFrame->setPalette(pal);
1156 pageFrame->setAutoFillBackground(
true);
1158 pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1164 mainLayout->addWidget(pageFrame, row++, pageColumn);
1166 int watermarkEndRow = row;
1168 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1171 buttonLayout->setContentsMargins(9, 9, 9, 9);
1172 mainLayout->setContentsMargins(0, 11, 0, 0);
1175 int buttonStartColumn = info
.extension ? 1 : 0;
1176 int buttonNumColumns = info
.extension ? 1 : numColumns;
1178 if (classic || modern) {
1180 bottomRuler =
new QWizardRuler(antiFlickerWidget);
1181 mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1185 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1187 mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1191 watermarkEndRow = row;
1192 mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1193 watermarkEndRow - watermarkStartRow, 1);
1196 mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1198 mainLayout->setColumnMinimumWidth(2, 21);
1203 titleLabel->setVisible(info.title);
1205 subTitleLabel->setVisible(info.subTitle);
1221 if (layoutInfo != info)
1223 QWizardPage *page = q->currentPage();
1231 bool expandPage = !page->layout();
1233 const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page));
1234 expandPage = pageItem->expandingDirections() & Qt::Vertical;
1236 QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1237 Q_ASSERT(bottomSpacer);
1238 bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding);
1239 pageVBoxLayout->invalidate();
1244 headerWidget->setup(info, page->title(), page->subTitle(),
1245 page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap),
1246 titleFmt, subTitleFmt, opts);
1253 pix = page->pixmap(QWizard::WatermarkPixmap);
1255 pix = q->pixmap(QWizard::WatermarkPixmap);
1262 titleLabel->setTextFormat(titleFmt);
1263 titleLabel->setText(page->title());
1267 subTitleLabel->setTextFormat(subTitleFmt);
1268 subTitleLabel->setText(page->subTitle());
1276 if (wizStyle == QWizard::MacStyle) {
1285 QPalette newPalette = QApplication::palette(pageFrame);
1287 QColor windowColor = newPalette.brush(QPalette::Window).color();
1288 windowColor.setAlpha(153);
1289 newPalette.setBrush(QPalette::Window, windowColor);
1291 QColor baseColor = newPalette.brush(QPalette::Base).color();
1292 baseColor.setAlpha(153);
1293 newPalette.setBrush(QPalette::Base, baseColor);
1295 pageFrame->setPalette(newPalette);
1303 int extraHeight = 0;
1304#if QT_CONFIG(style_windowsvista)
1305 if (isVistaThemeEnabled())
1306 extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1308 QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1309 QSize maximumSize = mainLayout->totalMaximumSize();
1310 if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1315 minimumSize.setHeight(mainLayout->totalSizeHint().height());
1317 if (q->minimumWidth() == minimumWidth) {
1319 q->setMinimumWidth(minimumWidth);
1321 if (q->minimumHeight() == minimumHeight) {
1323 q->setMinimumHeight(minimumHeight);
1325 if (q->maximumWidth() == maximumWidth) {
1326 maximumWidth = maximumSize.width();
1327 q->setMaximumWidth(maximumWidth);
1329 if (q->maximumHeight() == maximumHeight) {
1330 maximumHeight = maximumSize.height();
1331 q->setMaximumHeight(maximumHeight);
1338 if (q->currentPage()) {
1339 canContinue = (q->nextId() != -1);
1340 canFinish = q->currentPage()->isFinalPage();
1352 case QWizard::CommitButton:
1353 return u"qt_wizard_commit"_s;
1354 case QWizard::FinishButton:
1355 return u"qt_wizard_finish"_s;
1356 case QWizard::CancelButton:
1357 return u"qt_wizard_cancel"_s;
1358 case QWizard::BackButton:
1359 case QWizard::NextButton:
1360 case QWizard::HelpButton:
1361 case QWizard::CustomButton1:
1362 case QWizard::CustomButton2:
1363 case QWizard::CustomButton3:
1365 return "__qt__passive_wizardbutton"_L1 + QString::number(which);
1366 case QWizard::Stretch:
1367 case QWizard::NoButton:
1372 Q_UNREACHABLE_RETURN(QString());
1378 if (uint(which) >= QWizard::NButtons)
1382 QPushButton *pushButton =
new QPushButton(antiFlickerWidget);
1383 QStyle *style = q->style();
1384 if (style != QApplication::style())
1385 pushButton->setStyle(style);
1386 pushButton->setObjectName(object_name_for_button(which));
1388 pushButton->setAutoDefault(
false);
1392 const_cast<QWizardPrivate *>(
this)->btns[which] = pushButton;
1394 btns[which] = pushButton;
1396 if (which < QWizard::NStandardButtons)
1397 pushButton->setText(buttonDefaultText(wizStyle, which,
this));
1399 connectButton(which);
1407 if (which < QWizard::NStandardButtons) {
1408 QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1410 QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1417 for (
int i = 0; i < QWizard::NButtons; ++i) {
1419 if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1420 btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1421 else if (buttonCustomTexts.contains(i))
1422 btns[i]->setText(buttonCustomTexts.value(i));
1423 else if (i < QWizard::NStandardButtons)
1424 btns[i]->setText(buttonDefaultText(wizStyle, i,
this));
1430#if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1431 if (btns[QWizard::NextButton] && isVistaThemeEnabled()) {
1432 if (vistaNextShortcut.isNull()) {
1434 new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right),
1435 btns[QWizard::NextButton], SLOT(animateClick()));
1438 delete vistaNextShortcut;
1446 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array{
1447 buttonsCustomLayout.cbegin(), buttonsCustomLayout.cend()};
1448 setButtonLayout(array.constData(),
int(array.size()));
1453 const int ArraySize = 12;
1454 QWizard::WizardButton array[ArraySize];
1455 memset(array, -1,
sizeof(array));
1456 Q_ASSERT(array[0] == QWizard::NoButton);
1458 if (opts & QWizard::HaveHelpButton) {
1459 int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1460 array[i] = QWizard::HelpButton;
1462 array[1] = QWizard::Stretch;
1463 if (opts & QWizard::HaveCustomButton1)
1464 array[2] = QWizard::CustomButton1;
1465 if (opts & QWizard::HaveCustomButton2)
1466 array[3] = QWizard::CustomButton2;
1467 if (opts & QWizard::HaveCustomButton3)
1468 array[4] = QWizard::CustomButton3;
1470 if (!(opts & QWizard::NoCancelButton)) {
1471 int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1472 array[i] = QWizard::CancelButton;
1474 array[6] = QWizard::BackButton;
1475 array[7] = QWizard::NextButton;
1476 array[8] = QWizard::CommitButton;
1477 array[9] = QWizard::FinishButton;
1479 setButtonLayout(array, ArraySize);
1487 for (
int i = buttonLayout->count() - 1; i >= 0; --i) {
1488 QLayoutItem *item = buttonLayout->takeAt(i);
1489 if (
QWidget *widget = item->widget())
1494 for (
int i = 0; i < size; ++i) {
1495 QWizard::WizardButton which = array[i];
1496 if (which == QWizard::Stretch) {
1497 buttonLayout->addStretch(1);
1498 }
else if (which != QWizard::NoButton) {
1499 ensureButton(which);
1500 buttonLayout->addWidget(btns[which]);
1503 if (which != QWizard::BackButton && which != QWizard::NextButton
1504 && which != QWizard::CommitButton && which != QWizard::FinishButton)
1505 btns[which]->show();
1508 QWidget::setTabOrder(prev, btns[which]);
1518 return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
1524 if (which == QWizard::BackgroundPixmap) {
1525 if (wizStyle == QWizard::MacStyle) {
1527 q->updateGeometry();
1534#if QT_CONFIG(style_windowsvista)
1535bool QWizardPrivate::vistaDisabled()
const
1538 const QVariant v = q->property(
"_q_wizard_vista_off");
1539 return v.isValid() && v.toBool();
1542bool QWizardPrivate::handleAeroStyleChange()
1546 if (inHandleAeroStyleChange)
1552 const bool isWindow = q->isWindow();
1553 if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1555 inHandleAeroStyleChange =
true;
1557 vistaHelper->disconnectBackButton();
1558 q->removeEventFilter(vistaHelper);
1560 bool vistaMargins =
false;
1562 if (isVistaThemeEnabled()) {
1563 const int topOffset = vistaHelper->topOffset(q);
1564 const int topPadding = vistaHelper->topPadding(q);
1566 vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1567 q->installEventFilter(vistaHelper);
1569 q->setMouseTracking(
true);
1570 antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1571 vistaHelper->backButton()->move(
1573 - qMin(topOffset, topPadding + 1));
1574 vistaMargins =
true;
1575 vistaHelper->backButton()->show();
1577 vistaHelper->setTitleBarIconAndCaptionVisible(
false);
1579 vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1580 vistaHelper->backButton()->show();
1582 q->setMouseTracking(
true);
1586 antiFlickerWidget->move(0, 0);
1587 vistaHelper->hideBackButton();
1589 vistaHelper->setTitleBarIconAndCaptionVisible(
true);
1592 _q_updateButtonStates();
1594 vistaHelper->updateCustomMargins(vistaMargins);
1596 inHandleAeroStyleChange =
false;
1603#if QT_CONFIG(style_windowsvista)
1604 return wizStyle == QWizard::AeroStyle && !vistaDisabled();
1614 q->setUpdatesEnabled(
false);
1624 q->setUpdatesEnabled(
true);
1631 QObject *button = q->sender();
1632 for (
int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1633 if (btns[i] == button) {
1634 emit q->customButtonClicked(QWizard::WizardButton(i));
1646 const QWizardPage *page = q->currentPage();
1647 bool complete = page && page->isComplete();
1649 btn.back->setEnabled(history.size() > 1
1650 && !q->page(history.at(history.size() - 2))->isCommitPage()
1651 && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage)));
1652 btn.next->setEnabled(canContinue && complete);
1653 btn.commit->setEnabled(canContinue && complete);
1654 btn.finish->setEnabled(canFinish && complete);
1656 const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1657 && (history.size() > 1 || !(opts & QWizard::NoBackButtonOnStartPage))
1658 && (canContinue || !(opts & QWizard::NoBackButtonOnLastPage));
1659 bool commitPage = page && page->isCommitPage();
1660 btn.back->setVisible(backButtonVisible);
1661 btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1662 && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage)));
1663 btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1665 btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1666 && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages)));
1668 if (!(opts & QWizard::NoCancelButton))
1669 btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1670 && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage)));
1672 bool useDefault = !(opts & QWizard::NoDefaultButton);
1673 if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1674 nextPush->setDefault(canContinue && useDefault && !commitPage);
1675 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1676 commitPush->setDefault(canContinue && useDefault && commitPage);
1677 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1678 finishPush->setDefault(!canContinue && useDefault);
1680#if QT_CONFIG(style_windowsvista)
1681 if (isVistaThemeEnabled()) {
1682 vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1683 vistaHelper->backButton()->setVisible(backButtonVisible);
1684 btn.back->setVisible(
false);
1693 int destroyed_index = -1;
1694 QList<QWizardField>::iterator it = fields.begin();
1695 while (it != fields.end()) {
1697 if (field.object == object) {
1698 destroyed_index = fieldIndexMap.value(field.name, -1);
1699 fieldIndexMap.remove(field.name);
1700 it = fields.erase(it);
1705 if (destroyed_index != -1) {
1706 QMap<QString,
int>::iterator it2 = fieldIndexMap.begin();
1707 while (it2 != fieldIndexMap.end()) {
1708 int index = it2.value();
1709 if (index > destroyed_index) {
1710 QString field_name = it2.key();
1711 fieldIndexMap.insert(field_name, index-1);
1720 for (
int i = 0; i < QWizard::NButtons; i++)
1722 btns[i]->setStyle(style);
1723 const PageMap::const_iterator pcend = pageMap.constEnd();
1724 for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1725 it.value()->setStyle(style);
1729QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1731 auto *keyboardAssistantURL = [NSWorkspace.sharedWorkspace
1732 URLForApplicationWithBundleIdentifier:@
"com.apple.KeyboardSetupAssistant"];
1733 auto *keyboardAssistantBundle = [NSBundle bundleWithURL:keyboardAssistantURL];
1734 auto *assistantBackground = [keyboardAssistantBundle imageForResource:@
"Background"];
1735 auto size = QSizeF::fromCGSize(assistantBackground.size);
1736 static const QSizeF expectedSize(242, 414);
1737 if (size == expectedSize)
1738 return qt_mac_toQPixmap(assistantBackground, size);
1744#if QT_CONFIG(style_windowsvista)
1745void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
1747 if (wizardPrivate->isVistaThemeEnabled()) {
1748 int leftMargin, topMargin, rightMargin, bottomMargin;
1749 wizardPrivate->buttonLayout->getContentsMargins(
1750 &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1751 const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1752 QPainter painter(
this);
1753 const QBrush brush(QColor(240, 240, 240));
1754 painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1755 painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0));
1756 painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2140
2141
2142
2143
2144QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags)
2145 : QDialog(*
new QWizardPrivate, parent, flags)
2152
2153
2157 delete d->buttonLayout;
2161
2162
2163
2164
2165
2166
2167
2168int QWizard::addPage(QWizardPage *page)
2172 if (!d->pageMap.isEmpty())
2173 theid = d->pageMap.lastKey() + 1;
2174 setPage(theid, page);
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188void QWizard::setPage(
int theid, QWizardPage *page)
2192 if (Q_UNLIKELY(!page)) {
2193 qWarning(
"QWizard::setPage: Cannot insert null page");
2197 if (Q_UNLIKELY(theid == -1)) {
2198 qWarning(
"QWizard::setPage: Cannot insert page with ID -1");
2202 if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2203 qWarning(
"QWizard::setPage: Page with duplicate ID %d ignored", theid);
2207 page->setParent(d->pageFrame);
2209 QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2210 for (
const auto &field : std::as_const(pendingFields))
2212 pendingFields.clear();
2214 connect(page, SIGNAL(completeChanged()),
this, SLOT(_q_updateButtonStates()));
2216 d->pageMap.insert(theid, page);
2217 page->d_func()->wizard =
this;
2219 int n = d->pageVBoxLayout->count();
2222 bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2223 d->pageVBoxLayout->setEnabled(
false);
2225 d->pageVBoxLayout->insertWidget(n - 1, page);
2229 d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2231 if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2233 emit pageAdded(theid);
2237
2238
2239
2240
2241
2242
2243void QWizard::removePage(
int id)
2247 QWizardPage *removedPage =
nullptr;
2250 if (d->pageMap.size() > 0) {
2251 if (d->start == id) {
2252 const int firstId = d->pageMap.constBegin().key();
2253 if (firstId == id) {
2254 if (d->pageMap.size() > 1)
2255 d->start = (++d->pageMap.constBegin()).key();
2261 d->startSetByUser =
false;
2265 if (d->pageMap.contains(id))
2266 emit pageRemoved(id);
2268 if (!d->history.contains(id)) {
2270 removedPage = d->pageMap.take(id);
2271 d->updateCurrentPage();
2272 }
else if (id != d->current) {
2274 removedPage = d->pageMap.take(id);
2275 d->history.removeOne(id);
2276 d->_q_updateButtonStates();
2277 }
else if (d->history.size() == 1) {
2280 removedPage = d->pageMap.take(id);
2281 if (d->pageMap.isEmpty())
2282 d->updateCurrentPage();
2288 removedPage = d->pageMap.take(id);
2289 d->updateCurrentPage();
2293 if (removedPage->d_func()->initialized) {
2295 removedPage->d_func()->initialized =
false;
2298 d->pageVBoxLayout->removeWidget(removedPage);
2300 for (
int i = d->fields.size() - 1; i >= 0; --i) {
2301 if (d->fields.at(i).page == removedPage) {
2302 removedPage->d_func()->pendingFields += d->fields.at(i);
2303 d->removeFieldAt(i);
2310
2311
2312
2313
2314
2315
2316
2317QWizardPage *QWizard::page(
int theid)
const
2320 return d->pageMap.value(theid);
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333bool QWizard::hasVisitedPage(
int theid)
const
2336 return d->history.contains(theid);
2340
2341
2342
2343
2344
2345
2346
2347QList<
int> QWizard::visitedIds()
const
2354
2355
2356QList<
int> QWizard::pageIds()
const
2359 return d->pageMap.keys();
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372void QWizard::setStartId(
int theid)
2375 int newStart = theid;
2377 newStart = d->pageMap.size() ? d->pageMap.constBegin().key() : -1;
2379 if (d->start == newStart) {
2380 d->startSetByUser = theid != -1;
2384 if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2385 qWarning(
"QWizard::setStartId: Invalid page ID %d", newStart);
2388 d->start = newStart;
2389 d->startSetByUser = theid != -1;
2392int QWizard::startId()
const
2399
2400
2401
2402
2403
2404
2405
2406QWizardPage *QWizard::currentPage()
const
2409 return page(d->current);
2413
2414
2415
2416
2417
2418
2419
2420
2421int QWizard::currentId()
const
2428
2429
2430
2431
2432
2433
2434void QWizard::setField(
const QString &name,
const QVariant &value)
2438 int index = d->fieldIndexMap.value(name, -1);
2439 if (Q_UNLIKELY(index == -1)) {
2440 qWarning(
"QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2444 const QWizardField &field = d->fields.at(index);
2445 if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2446 qWarning(
"QWizard::setField: Couldn't write to property '%s'",
2447 field.property.constData());
2451
2452
2453
2454
2455
2456
2457QVariant QWizard::field(
const QString &name)
const
2461 int index = d->fieldIndexMap.value(name, -1);
2462 if (Q_UNLIKELY(index == -1)) {
2463 qWarning(
"QWizard::field: No such field '%ls'", qUtf16Printable(name));
2467 const QWizardField &field = d->fields.at(index);
2468 return field.object->property(field.property);
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483void QWizard::setWizardStyle(WizardStyle style)
2487 const bool styleChange = style != d->wizStyle;
2489#if QT_CONFIG(style_windowsvista)
2490 const bool aeroStyleChange =
2491 d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2492 d->vistaStateChanged =
false;
2493 d->vistaInitPending =
false;
2497#if QT_CONFIG(style_windowsvista)
2501 d->disableUpdates();
2502 d->wizStyle = style;
2503 d->updateButtonTexts();
2504#if QT_CONFIG(style_windowsvista)
2505 if (aeroStyleChange) {
2508 QResizeEvent ev(geometry().size(), geometry().size());
2509 QCoreApplication::sendEvent(
this, &ev);
2515#if QT_CONFIG(style_windowsvista)
2517 if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2518 d->vistaInitPending =
true;
2523QWizard::WizardStyle QWizard::wizardStyle()
const
2530
2531
2532
2533
2534
2535void QWizard::setOption(WizardOption option,
bool on)
2538 if (!(d->opts & option) != !on)
2539 setOptions(d->opts ^ option);
2543
2544
2545
2546
2547
2548bool QWizard::testOption(WizardOption option)
const
2551 return (d->opts & option) != 0;
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568void QWizard::setOptions(WizardOptions options)
2572 WizardOptions changed = (options ^ d->opts);
2576 d->disableUpdates();
2579 if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2580 d->cleanupPagesNotInHistory();
2582 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
2583 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
2584 | HaveCustomButton3)) {
2585 d->updateButtonLayout();
2586 }
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2587 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
2588 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)) {
2589 d->_q_updateButtonStates();
2596QWizard::WizardOptions QWizard::options()
const
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619void QWizard::setButtonText(WizardButton which,
const QString &text)
2623 if (!d->ensureButton(which))
2626 d->buttonCustomTexts.insert(which, text);
2628 if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2629 d->btns[which]->setText(text);
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644QString QWizard::buttonText(WizardButton which)
const
2648 if (!d->ensureButton(which))
2651 if (d->buttonCustomTexts.contains(which))
2652 return d->buttonCustomTexts.value(which);
2654 const QString defText = buttonDefaultText(d->wizStyle, which, d);
2655 if (!defText.isNull())
2658 return d->btns[which]->text();
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679void QWizard::setButtonLayout(
const QList<WizardButton> &layout)
2683 for (
int i = 0; i < layout.size(); ++i) {
2684 WizardButton button1 = layout.at(i);
2686 if (button1 == NoButton || button1 == Stretch)
2688 if (!d->ensureButton(button1))
2692 for (
int j = 0; j < i; ++j) {
2693 WizardButton button2 = layout.at(j);
2694 if (Q_UNLIKELY(button2 == button1)) {
2695 qWarning(
"QWizard::setButtonLayout: Duplicate button in layout");
2701 d->buttonsHaveCustomLayout =
true;
2702 d->buttonsCustomLayout = layout;
2703 d->updateButtonLayout();
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716void QWizard::setButton(WizardButton which, QAbstractButton *button)
2720 if (uint(which) >= NButtons || d->btns[which] == button)
2723 if (QAbstractButton *oldButton = d->btns[which]) {
2724 d->buttonLayout->removeWidget(oldButton);
2728 d->btns[which] = button;
2730 button->setParent(d->antiFlickerWidget);
2731 d->buttonCustomTexts.insert(which, button->text());
2732 d->connectButton(which);
2734 d->buttonCustomTexts.remove(which);
2735 d->ensureButton(which);
2738 d->updateButtonLayout();
2742
2743
2744
2745
2746QAbstractButton *QWizard::button(WizardButton which)
const
2749#if QT_CONFIG(style_windowsvista)
2750 if (d->wizStyle == AeroStyle && which == BackButton)
2751 return d->vistaHelper->backButton();
2753 if (!d->ensureButton(which))
2755 return d->btns[which];
2759
2760
2761
2762
2763
2764
2765
2766void QWizard::setTitleFormat(Qt::TextFormat format)
2769 d->titleFmt = format;
2773Qt::TextFormat QWizard::titleFormat()
const
2780
2781
2782
2783
2784
2785
2786
2787void QWizard::setSubTitleFormat(Qt::TextFormat format)
2790 d->subTitleFmt = format;
2794Qt::TextFormat QWizard::subTitleFormat()
const
2797 return d->subTitleFmt;
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812void QWizard::setPixmap(WizardPixmap which,
const QPixmap &pixmap)
2815 Q_ASSERT(uint(which) < NPixmaps);
2816 d->defaultPixmaps[which] = pixmap;
2817 d->updatePixmap(which);
2821
2822
2823
2824
2825
2826
2827
2828QPixmap QWizard::pixmap(WizardPixmap which)
const
2831 Q_ASSERT(uint(which) < NPixmaps);
2833 if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2834 d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2836 return d->defaultPixmaps[which];
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864void QWizard::setDefaultProperty(
const char *className,
const char *property,
2865 const char *changedSignal)
2868 for (
int i = d->defaultPropertyTable.size() - 1; i >= 0; --i) {
2869 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2870 d->defaultPropertyTable.remove(i);
2874 d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899void QWizard::setSideWidget(QWidget *widget)
2903 d->sideWidget = widget;
2904 if (d->watermarkLabel) {
2905 d->watermarkLabel->setSideWidget(widget);
2911
2912
2913
2914
2915QWidget *QWizard::sideWidget()
const
2919 return d->sideWidget;
2923
2924
2925void QWizard::setVisible(
bool visible)
2929 if (d->current == -1)
2932 QDialog::setVisible(visible);
2936
2937
2938QSize QWizard::sizeHint()
const
2941 QSize result = d->mainLayout->totalSizeHint();
2942 QSize extra(500, 360);
2943 if (d->wizStyle == MacStyle && d->current != -1) {
2944 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());
2945 extra.setWidth(616);
2946 if (!pixmap.isNull()) {
2947 extra.setHeight(pixmap.height());
2950
2951
2952
2953
2954
2955 if (pixmap.width() >= pixmap.height())
2956 extra.setWidth(pixmap.width());
2959 return result.expandedTo(extra);
2963
2964
2965
2966
2967
2968
2969
2972
2973
2974
2975
2976
2977
2978
2981
2982
2983
2984
2985
2986
2987
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3031
3032
3033
3034
3035
3036
3040 int n = d->history.size() - 2;
3043 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3047
3048
3049
3050
3051
3052
3057 if (d->current == -1)
3060 if (validateCurrentPage()) {
3061 int next = nextId();
3063 if (Q_UNLIKELY(d->history.contains(next))) {
3064 qWarning(
"QWizard::next: Page %d already met", next);
3067 if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3068 qWarning(
"QWizard::next: No such page %d", next);
3071 d->switchToPage(next, QWizardPrivate::Forward);
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3091void QWizard::setCurrentId(
int id)
3095 if (d->current == -1)
3098 if (currentId() == id)
3101 if (!validateCurrentPage())
3104 if (id < 0 || Q_UNLIKELY(!d->pageMap.contains(id))) {
3105 qWarning(
"QWizard::setCurrentId: No such page: %d", id);
3109 d->switchToPage(id, (id < currentId()) ? QWizardPrivate::Backward : QWizardPrivate::Forward);
3113
3114
3115
3116
3117
3118void QWizard::restart()
3121 d->disableUpdates();
3123 d->switchToPage(startId(), QWizardPrivate::Forward);
3128
3129
3130bool QWizard::event(QEvent *event)
3133 if (event->type() == QEvent::StyleChange) {
3134 d->setStyle(style());
3136 }
else if (event->type() == QEvent::PaletteChange) {
3139#if QT_CONFIG(style_windowsvista)
3140 else if (event->type() == QEvent::Show && d->vistaInitPending) {
3141 d->vistaInitPending =
false;
3142 d->wizStyle = AeroStyle;
3143 d->handleAeroStyleChange();
3145 else if (d->isVistaThemeEnabled()) {
3146 if (event->type() == QEvent::Resize
3147 || event->type() == QEvent::LayoutDirectionChange) {
3148 const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3149 ? width() - d->vistaHelper->backButton()->sizeHint().width()
3152 d->vistaHelper->backButton()->move(buttonLeft,
3153 d->vistaHelper->backButton()->y());
3156 d->vistaHelper->mouseEvent(event);
3159 return QDialog::event(event);
3163
3164
3165void QWizard::resizeEvent(QResizeEvent *event)
3168 int heightOffset = 0;
3169#if QT_CONFIG(style_windowsvista)
3170 if (d->isVistaThemeEnabled()) {
3171 heightOffset = d->vistaHelper->topOffset(
this);
3172 heightOffset += d->vistaHelper->titleBarSize();
3175 d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3176#if QT_CONFIG(style_windowsvista)
3177 if (d->isVistaThemeEnabled())
3178 d->vistaHelper->resizeEvent(event);
3180 QDialog::resizeEvent(event);
3184
3185
3186void QWizard::paintEvent(QPaintEvent * event)
3189 if (d->wizStyle == MacStyle && currentPage()) {
3190 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3191 if (backgroundPixmap.isNull())
3194 QStylePainter painter(
this);
3195 painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3197#if QT_CONFIG(style_windowsvista)
3198 else if (d->isVistaThemeEnabled()) {
3199 d->vistaHelper->paintEvent(event);
3206#if defined(Q_OS_WIN) || defined(Q_QDOC)
3208
3209
3210bool QWizard::nativeEvent(
const QByteArray &eventType,
void *message, qintptr *result)
3212#if QT_CONFIG(style_windowsvista)
3214 if (d->isVistaThemeEnabled() && eventType ==
"windows_generic_MSG") {
3215 MSG *windowsMessage =
static_cast<MSG *>(message);
3216 const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3217 if (d->vistaDirty) {
3220 if (windowsMessage->message == WM_GETICON) {
3221 d->vistaStateChanged =
true;
3222 d->vistaDirty =
false;
3223 setWizardStyle(AeroStyle);
3226 return winEventResult;
3228 return QDialog::nativeEvent(eventType, message, result);
3231 return QDialog::nativeEvent(eventType, message, result);
3237
3238
3239void QWizard::done(
int result)
3243 if (result == Rejected) {
3246 if (!validateCurrentPage())
3249 QDialog::done(result);
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270void QWizard::initializePage(
int theid)
3272 QWizardPage *page =
this->page(theid);
3274 page->initializePage();
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288void QWizard::cleanupPage(
int theid)
3290 QWizardPage *page =
this->page(theid);
3292 page->cleanupPage();
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311bool QWizard::validateCurrentPage()
3313 QWizardPage *page = currentPage();
3317 return page->validatePage();
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334int QWizard::nextId()
const
3336 const QWizardPage *page = currentPage();
3340 return page->nextId();
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3411
3412
3413
3414
3415
3416
3417
3418
3419QWizardPage::QWizardPage(QWidget *parent)
3420 : QWidget(*
new QWizardPagePrivate, parent, { })
3422 connect(
this, SIGNAL(completeChanged()),
this, SLOT(_q_updateCachedCompleteState()));
3426
3427
3428QWizardPage::~QWizardPage()
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446void QWizardPage::setTitle(
const QString &title)
3450 if (d->wizard && d->wizard->currentPage() ==
this)
3451 d->wizard->d_func()->updateLayout();
3454QString QWizardPage::title()
const
3456 Q_D(
const QWizardPage);
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479void QWizardPage::setSubTitle(
const QString &subTitle)
3482 d->subTitle = subTitle;
3483 if (d->wizard && d->wizard->currentPage() ==
this)
3484 d->wizard->d_func()->updateLayout();
3487QString QWizardPage::subTitle()
const
3489 Q_D(
const QWizardPage);
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506void QWizardPage::setPixmap(QWizard::WizardPixmap which,
const QPixmap &pixmap)
3509 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3510 d->pixmaps[which] = pixmap;
3511 if (d->wizard && d->wizard->currentPage() ==
this)
3512 d->wizard->d_func()->updatePixmap(which);
3516
3517
3518
3519
3520
3521
3522
3523
3524QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which)
const
3526 Q_D(
const QWizardPage);
3527 Q_ASSERT(uint(which) < QWizard::NPixmaps);
3529 const QPixmap &pixmap = d->pixmaps[which];
3530 if (!pixmap.isNull())
3534 return wizard()->pixmap(which);
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556void QWizardPage::initializePage()
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571void QWizardPage::cleanupPage()
3575 const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3576 for (
const auto &field : fields) {
3577 if (field.page ==
this)
3578 field.object->setProperty(field.property, field.initialValue);
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597bool QWizardPage::validatePage()
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619bool QWizardPage::isComplete()
const
3621 Q_D(
const QWizardPage);
3626 const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3627 const auto end = wizardFields.crend();
3628 for (
auto it = wizardFields.crbegin(); it != end; ++it) {
3629 const QWizardField &field = *it;
3630 if (field.page ==
this && field.mandatory) {
3631 QVariant value = field.object->property(field.property);
3632 if (value == field.initialValue)
3635#if QT_CONFIG(lineedit)
3636 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3637 if (!lineEdit->hasAcceptableInput())
3641#if QT_CONFIG(spinbox)
3642 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3643 if (!spinBox->hasAcceptableInput())
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664void QWizardPage::setFinalPage(
bool finalPage)
3667 d->explicitlyFinal = finalPage;
3668 QWizard *wizard =
this->wizard();
3669 if (wizard && wizard->currentPage() ==
this)
3670 wizard->d_func()->updateCurrentPage();
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685bool QWizardPage::isFinalPage()
const
3687 Q_D(
const QWizardPage);
3688 if (d->explicitlyFinal)
3691 QWizard *wizard =
this->wizard();
3692 if (wizard && wizard->currentPage() ==
this) {
3694 return wizard->nextId() == -1;
3696 return nextId() == -1;
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714void QWizardPage::setCommitPage(
bool commitPage)
3717 d->commit = commitPage;
3718 QWizard *wizard =
this->wizard();
3719 if (wizard && wizard->currentPage() ==
this)
3720 wizard->d_func()->updateCurrentPage();
3724
3725
3726
3727
3728bool QWizardPage::isCommitPage()
const
3730 Q_D(
const QWizardPage);
3735
3736
3737
3738
3739
3740
3741
3742void QWizardPage::setButtonText(QWizard::WizardButton which,
const QString &text)
3745 d->buttonCustomTexts.insert(which, text);
3746 if (wizard() && wizard()->currentPage() ==
this && wizard()->d_func()->btns[which])
3747 wizard()->d_func()->btns[which]->setText(text);
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763QString QWizardPage::buttonText(QWizard::WizardButton which)
const
3765 Q_D(
const QWizardPage);
3767 if (d->buttonCustomTexts.contains(which))
3768 return d->buttonCustomTexts.value(which);
3771 return wizard()->buttonText(which);
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792int QWizardPage::nextId()
const
3794 Q_D(
const QWizardPage);
3799 bool foundCurrentPage =
false;
3801 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3802 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();
3803 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();
3805 for (; i != end; ++i) {
3806 if (i.value() ==
this) {
3807 foundCurrentPage =
true;
3808 }
else if (foundCurrentPage) {
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3830
3831
3832
3833
3834
3835
3836
3837
3838void QWizardPage::setField(
const QString &name,
const QVariant &value)
3843 d->wizard->setField(name, value);
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859QVariant QWizardPage::field(
const QString &name)
const
3861 Q_D(
const QWizardPage);
3864 return d->wizard->field(name);
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913void QWizardPage::registerField(
const QString &name, QWidget *widget,
const char *property,
3914 const char *changedSignal)
3917 QWizardField field(
this, name, widget, property, changedSignal);
3919 d->wizard->d_func()->addField(field);
3921 d->pendingFields += field;
3926
3927
3928
3929
3930
3931QWizard *QWizardPage::wizard()
const
3933 Q_D(
const QWizardPage);
3939#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