QtBase  v6.3.1
qwizard.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the QtWidgets module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39 
40 #include "qwizard.h"
41 #include <QtWidgets/private/qtwidgetsglobal_p.h>
42 
43 #if QT_CONFIG(spinbox)
44 #include "qabstractspinbox.h"
45 #endif
46 #include "qalgorithms.h"
47 #include "qapplication.h"
48 #include "qboxlayout.h"
49 #include "qlayoutitem.h"
50 #include "qevent.h"
51 #include "qframe.h"
52 #include "qlabel.h"
53 #if QT_CONFIG(lineedit)
54 #include "qlineedit.h"
55 #endif
56 #include <qpointer.h>
57 #include "qpainter.h"
58 #include "qwindow.h"
59 #include "qpushbutton.h"
60 #include "qset.h"
61 #if QT_CONFIG(shortcut)
62 # include "qshortcut.h"
63 #endif
64 #include "qstyle.h"
65 #include "qstyleoption.h"
66 #include "qvarlengtharray.h"
67 #if defined(Q_OS_MACOS)
68 #include <QtCore/QMetaMethod>
69 #include <QtGui/QGuiApplication>
70 #include <qpa/qplatformnativeinterface.h>
71 #elif QT_CONFIG(style_windowsvista)
72 #include "qwizard_win_p.h"
73 #include "qtimer.h"
74 #endif
75 
76 #include "private/qdialog_p.h"
77 #include <qdebug.h>
78 
79 #include <string.h> // for memset()
80 #include <algorithm>
81 
83 
84 // These fudge terms were needed a few places to obtain pixel-perfect results
86 const int ModernHeaderTopMargin = 2;
87 const int ClassicHMargin = 4;
88 const int MacButtonTopMargin = 13;
89 const int MacLayoutLeftMargin = 20;
90 //const int MacLayoutTopMargin = 14; // Unused. Save some space and avoid warning.
91 const int MacLayoutRightMargin = 20;
92 const int MacLayoutBottomMargin = 17;
93 
94 static void changeSpacerSize(QLayout *layout, int index, int width, int height)
95 {
96  QSpacerItem *spacer = layout->itemAt(index)->spacerItem();
97  if (!spacer)
98  return;
99  spacer->changeSize(width, height);
100 }
101 
102 static QWidget *iWantTheFocus(QWidget *ancestor)
103 {
104  const int MaxIterations = 100;
105 
106  QWidget *candidate = ancestor;
107  for (int i = 0; i < MaxIterations; ++i) {
108  candidate = candidate->nextInFocusChain();
109  if (!candidate)
110  break;
111 
112  if (candidate->focusPolicy() & Qt::TabFocus) {
113  if (candidate != ancestor && ancestor->isAncestorOf(candidate))
114  return candidate;
115  }
116  }
117  return nullptr;
118 }
119 
120 static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX,
121  const QByteArray &classY)
122 {
123  const QMetaObject *metaObject = object->metaObject();
124  while (metaObject) {
125  if (metaObject->className() == classX)
126  return true;
127  if (metaObject->className() == classY)
128  return false;
129  metaObject = metaObject->superClass();
130  }
131  return false;
132 }
133 
134 const struct {
135  const char className[16];
136  const char property[13];
137 } fallbackProperties[] = {
138  // If you modify this list, make sure to update the documentation (and the auto test)
139  { "QAbstractButton", "checked" },
140  { "QAbstractSlider", "value" },
141  { "QComboBox", "currentIndex" },
142  { "QDateTimeEdit", "dateTime" },
143  { "QLineEdit", "text" },
144  { "QListWidget", "currentRow" },
145  { "QSpinBox", "value" },
146 };
148 
149 static const char *changed_signal(int which)
150 {
151  // since it might expand to a runtime function call (to
152  // qFlagLocations()), we cannot store the result of SIGNAL() in a
153  // character array and expect it to be statically initialized. To
154  // avoid the relocations caused by a char pointer table, use a
155  // switch statement:
156  switch (which) {
157  case 0: return SIGNAL(toggled(bool));
158  case 1: return SIGNAL(valueChanged(int));
159  case 2: return SIGNAL(currentIndexChanged(int));
160  case 3: return SIGNAL(dateTimeChanged(QDateTime));
161  case 4: return SIGNAL(textChanged(QString));
162  case 5: return SIGNAL(currentRowChanged(int));
163  case 6: return SIGNAL(valueChanged(int));
164  };
165  static_assert(7 == NFallbackDefaultProperties);
166  Q_UNREACHABLE();
167  return nullptr;
168 }
169 
171 {
172 public:
176 
178  inline QWizardDefaultProperty(const char *className, const char *property,
179  const char *changedSignal)
181 };
183 
185 {
186 public:
187  inline QWizardField() {}
188  QWizardField(QWizardPage *page, const QString &spec, QObject *object, const char *property,
189  const char *changedSignal);
190 
191  void resolve(const QList<QWizardDefaultProperty> &defaultPropertyTable);
192  void findProperty(const QWizardDefaultProperty *properties, int propertyCount);
193 
196  bool mandatory;
201 };
203 
205  const char *property, const char *changedSignal)
206  : page(page), name(spec), mandatory(false), object(object), property(property),
207  changedSignal(changedSignal)
208 {
209  if (name.endsWith(QLatin1Char('*'))) {
210  name.chop(1);
211  mandatory = true;
212  }
213 }
214 
215 void QWizardField::resolve(const QList<QWizardDefaultProperty> &defaultPropertyTable)
216 {
217  if (property.isEmpty())
218  findProperty(defaultPropertyTable.constData(), defaultPropertyTable.count());
219  initialValue = object->property(property);
220 }
221 
222 void QWizardField::findProperty(const QWizardDefaultProperty *properties, int propertyCount)
223 {
225 
226  for (int i = 0; i < propertyCount; ++i) {
227  if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)) {
228  className = properties[i].className;
229  property = properties[i].property;
230  changedSignal = properties[i].changedSignal;
231  }
232  }
233 }
234 
236 {
237 public:
242  int childMarginLeft = -1;
244  int childMarginTop = -1;
246  int hspacing = -1;
247  int vspacing = -1;
248  int buttonSpacing = -1;
250  bool header = false;
251  bool watermark = false;
252  bool title = false;
253  bool subTitle = false;
254  bool extension = false;
255  bool sideWidget = false;
256 
257  bool operator==(const QWizardLayoutInfo &other) const;
258  inline bool operator!=(const QWizardLayoutInfo &other) const { return !operator==(other); }
259 };
260 
262 {
263  return topLevelMarginLeft == other.topLevelMarginLeft
264  && topLevelMarginRight == other.topLevelMarginRight
265  && topLevelMarginTop == other.topLevelMarginTop
266  && topLevelMarginBottom == other.topLevelMarginBottom
267  && childMarginLeft == other.childMarginLeft
268  && childMarginRight == other.childMarginRight
269  && childMarginTop == other.childMarginTop
270  && childMarginBottom == other.childMarginBottom
271  && hspacing == other.hspacing
272  && vspacing == other.vspacing
273  && buttonSpacing == other.buttonSpacing
274  && wizStyle == other.wizStyle
275  && header == other.header
276  && watermark == other.watermark
277  && title == other.title
278  && subTitle == other.subTitle
279  && extension == other.extension
280  && sideWidget == other.sideWidget;
281 }
282 
283 class QWizardHeader : public QWidget
284 {
285 public:
286  enum RulerType { Ruler };
287 
288  inline QWizardHeader(RulerType /* ruler */, QWidget *parent = nullptr)
289  : QWidget(parent) { setFixedHeight(2); }
290  QWizardHeader(QWidget *parent = nullptr);
291 
292  void setup(const QWizardLayoutInfo &info, const QString &title,
293  const QString &subTitle, const QPixmap &logo, const QPixmap &banner,
294  Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat);
295 
296 protected:
297  void paintEvent(QPaintEvent *event) override;
298 #if QT_CONFIG(style_windowsvista)
299 private:
300  bool vistaDisabled() const;
301 #endif
302 private:
303  QLabel *titleLabel;
304  QLabel *subTitleLabel;
305  QLabel *logoLabel;
306  QGridLayout *layout;
307  QPixmap bannerPixmap;
308 };
309 
311  : QWidget(parent)
312 {
315 
316  titleLabel = new QLabel(this);
317  titleLabel->setBackgroundRole(QPalette::Base);
318 
319  subTitleLabel = new QLabel(this);
320  subTitleLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
321  subTitleLabel->setWordWrap(true);
322 
323  logoLabel = new QLabel(this);
324 
325  QFont font = titleLabel->font();
326  font.setBold(true);
327  titleLabel->setFont(font);
328 
329  layout = new QGridLayout(this);
330  layout->setContentsMargins(QMargins());
331  layout->setSpacing(0);
332 
333  layout->setRowMinimumHeight(3, 1);
334  layout->setRowStretch(4, 1);
335 
336  layout->setColumnStretch(2, 1);
339 
340  layout->addWidget(titleLabel, 2, 1, 1, 2);
341  layout->addWidget(subTitleLabel, 4, 2);
342  layout->addWidget(logoLabel, 1, 5, 5, 1);
343 }
344 
345 #if QT_CONFIG(style_windowsvista)
346 bool QWizardHeader::vistaDisabled() const
347 {
348  bool styleDisabled = false;
349  QWizard *wiz = parentWidget() ? qobject_cast <QWizard *>(parentWidget()->parentWidget()) : 0;
350  if (wiz) {
351  // Designer doesn't support the Vista style for Wizards. This property is used to turn
352  // off the Vista style.
353  const QVariant v = wiz->property("_q_wizard_vista_off");
354  styleDisabled = v.isValid() && v.toBool();
355  }
356  return styleDisabled;
357 }
358 #endif
359 
361  const QString &subTitle, const QPixmap &logo, const QPixmap &banner,
362  Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat)
363 {
364  bool modern = ((info.wizStyle == QWizard::ModernStyle)
365 #if QT_CONFIG(style_windowsvista)
366  || ((info.wizStyle == QWizard::AeroStyle
367  && QVistaHelper::vistaState() == QVistaHelper::Classic) || vistaDisabled())
368 #endif
369  );
370 
371  layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0);
372  layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0);
373  layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2);
374 
375  int minColumnWidth0 = modern ? info.topLevelMarginLeft + info.topLevelMarginRight : 0;
376  int minColumnWidth1 = modern ? info.topLevelMarginLeft + info.topLevelMarginRight + 1
377  : info.topLevelMarginLeft + ClassicHMargin;
378  layout->setColumnMinimumWidth(0, minColumnWidth0);
379  layout->setColumnMinimumWidth(1, minColumnWidth1);
380 
381  titleLabel->setTextFormat(titleFormat);
382  titleLabel->setText(title);
383  logoLabel->setPixmap(logo);
384 
385  subTitleLabel->setTextFormat(subTitleFormat);
386  subTitleLabel->setText(QLatin1String("Pq\nPq"));
387  int desiredSubTitleHeight = subTitleLabel->sizeHint().height();
388  subTitleLabel->setText(subTitle);
389 
390  if (modern) {
391  bannerPixmap = banner;
392  } else {
393  bannerPixmap = QPixmap();
394  }
395 
396  if (bannerPixmap.isNull()) {
397  /*
398  There is no widthForHeight() function, so we simulate it with a loop.
399  */
400  int candidateSubTitleWidth = qMin(512, 2 * QGuiApplication::primaryScreen()->virtualGeometry().width() / 3);
401  int delta = candidateSubTitleWidth >> 1;
402  while (delta > 0) {
403  if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
404  <= desiredSubTitleHeight)
405  candidateSubTitleWidth -= delta;
406  delta >>= 1;
407  }
408 
409  subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight);
410 
411  QSize size = layout->totalMinimumSize();
414  } else {
415  subTitleLabel->setMinimumSize(0, 0);
416  setFixedSize(banner.size() + QSize(0, 2));
417  }
418  updateGeometry();
419 }
420 
422 {
423  QPainter painter(this);
424  painter.drawPixmap(0, 0, bannerPixmap);
425 
426  int x = width() - 2;
427  int y = height() - 2;
428  const QPalette &pal = palette();
429  painter.setPen(pal.mid().color());
430  painter.drawLine(0, y, x, y);
431  painter.setPen(pal.base().color());
432  painter.drawPoint(x + 1, y);
433  painter.drawLine(0, y + 1, x + 1, y + 1);
434 }
435 
436 // We save one vtable by basing QWizardRuler on QWizardHeader
438 {
439 public:
440  inline QWizardRuler(QWidget *parent = nullptr)
441  : QWizardHeader(Ruler, parent) {}
442 };
443 
444 class QWatermarkLabel : public QLabel
445 {
446 public:
448  m_layout = new QVBoxLayout(this);
449  if (m_sideWidget)
450  m_layout->addWidget(m_sideWidget);
451  }
452 
453  QSize minimumSizeHint() const override {
454  if (!pixmap(Qt::ReturnByValue).isNull())
456  return QFrame::minimumSizeHint();
457  }
458 
460  if (m_sideWidget == widget)
461  return;
462  if (m_sideWidget) {
463  m_layout->removeWidget(m_sideWidget);
464  m_sideWidget->hide();
465  }
466  m_sideWidget = widget;
467  if (m_sideWidget)
468  m_layout->addWidget(m_sideWidget);
469  }
470  QWidget *sideWidget() const {
471  return m_sideWidget;
472  }
473 private:
474  QVBoxLayout *m_layout;
475  QWidget *m_sideWidget;
476 };
477 
479 {
480  Q_DECLARE_PUBLIC(QWizardPage)
481 
482 public:
484 
485  bool cachedIsComplete() const;
488 
489  QWizard *wizard = nullptr;
495  bool explicitlyFinal = false;
496  bool commit = false;
497  bool initialized = false;
499 };
500 
502 {
503  Q_Q(const QWizardPage);
504  if (completeState == Tri_Unknown)
505  completeState = q->isComplete() ? Tri_True : Tri_False;
506  return completeState == Tri_True;
507 }
508 
510 {
511  Q_Q(QWizardPage);
512  TriState newState = q->isComplete() ? Tri_True : Tri_False;
513  if (newState != completeState)
514  emit q->completeChanged();
515 }
516 
518 {
519  Q_Q(QWizardPage);
520  completeState = q->isComplete() ? Tri_True : Tri_False;
521 }
522 
524 {
525 public:
526 #if QT_CONFIG(style_windowsvista)
527  QWizardPrivate *wizardPrivate;
528  QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *wizardPrivate)
529  : QWidget(wizard)
530  , wizardPrivate(wizardPrivate) {}
531 protected:
532  void paintEvent(QPaintEvent *) override;
533 #else
535  : QWidget(wizard)
536  {}
537 #endif
538 };
539 
541 {
542  Q_DECLARE_PUBLIC(QWizard)
543 
544 public:
546 
547  enum Direction {
549  Forward
550  };
551 
552  void init();
553  void reset();
555  void addField(const QWizardField &field);
556  void removeFieldAt(int index);
557  void switchToPage(int newId, Direction direction);
560  void updateLayout();
561  void updatePalette();
563  void updateCurrentPage();
564  bool ensureButton(QWizard::WizardButton which) const;
565  void connectButton(QWizard::WizardButton which) const;
566  void updateButtonTexts();
567  void updateButtonLayout();
571 #if QT_CONFIG(style_windowsvista)
572  bool vistaDisabled() const;
573  bool isVistaThemeEnabled(QVistaHelper::VistaState state) const;
574  bool handleAeroStyleChange();
575 #endif
576  bool isVistaThemeEnabled() const;
577  void disableUpdates();
578  void enableUpdates();
580  void _q_updateButtonStates();
582  void setStyle(QStyle *style);
583 #ifdef Q_OS_MACOS
584  static QPixmap findDefaultBackgroundPixmap();
585 #endif
586 
592  int start = -1;
593  bool startSetByUser = false;
594  int current = -1;
595  bool canContinue = false;
596  bool canFinish = false;
599 
601  QWizard::WizardOptions opts;
608 
609  union {
610  // keep in sync with QWizard::WizardButton
611  mutable struct {
618  } btn;
620  };
626  QWidget *sideWidget = nullptr;
627  QFrame *pageFrame = nullptr;
628  QLabel *titleLabel = nullptr;
629  QLabel *subTitleLabel = nullptr;
631 
635 
636 #if QT_CONFIG(style_windowsvista)
637  QVistaHelper *vistaHelper = nullptr;
638 # if QT_CONFIG(shortcut)
639  QPointer<QShortcut> vistaNextShortcut;
640 # endif
641  bool vistaInitPending = true;
642  QVistaHelper::VistaState vistaState = QVistaHelper::Dirty;
643  bool vistaStateChanged = false;
644  bool inHandleAeroStyleChange = false;
645 #endif
646  int minimumWidth = 0;
647  int minimumHeight = 0;
650 };
651 
652 static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate)
653 {
654 #if !QT_CONFIG(style_windowsvista)
655  Q_UNUSED(wizardPrivate);
656 #endif
657  const bool macStyle = (wstyle == QWizard::MacStyle);
658  switch (which) {
659  case QWizard::BackButton:
660  return macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back");
661  case QWizard::NextButton:
662  if (macStyle)
663  return QWizard::tr("Continue");
664  else
665  return wizardPrivate->isVistaThemeEnabled()
666  ? QWizard::tr("&Next") : QWizard::tr("&Next >");
668  return QWizard::tr("Commit");
670  return macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish");
672  return QWizard::tr("Cancel");
673  case QWizard::HelpButton:
674  return macStyle ? QWizard::tr("Help") : QWizard::tr("&Help");
675  default:
676  return QString();
677  }
678 }
679 
681 {
682  Q_Q(QWizard);
683 
684  std::fill(btns, btns + QWizard::NButtons, nullptr);
685 
687  wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle, nullptr, q));
688  if (wizStyle == QWizard::MacStyle) {
690  } else if (wizStyle == QWizard::ModernStyle) {
692  }
693 
694 #if QT_CONFIG(style_windowsvista)
695  vistaHelper = new QVistaHelper(q);
696 #endif
697 
698  // create these buttons right away; create the other buttons as necessary
703 
706 
711  pageVBoxLayout->addItem(spacerItem);
712 
716 
718 
720  for (uint i = 0; i < NFallbackDefaultProperties; ++i)
723  changed_signal(i)));
724 }
725 
727 {
728  Q_Q(QWizard);
729  if (current != -1) {
730  q->currentPage()->hide();
732  for (int i = history.count() - 1; i >= 0; --i)
733  q->cleanupPage(history.at(i));
734  history.clear();
735  for (QWizardPage *page : qAsConst(pageMap))
736  page->d_func()->initialized = false;
737 
738  current = -1;
739  emit q->currentIdChanged(-1);
740  }
741 }
742 
744 {
745  Q_Q(QWizard);
746 
747  for (auto it = pageMap.begin(), end = pageMap.end(); it != end; ++it) {
748  const auto idx = it.key();
749  const auto page = it.value()->d_func();
750  if (page->initialized && !history.contains(idx)) {
751  q->cleanupPage(idx);
752  page->initialized = false;
753  }
754  }
755 }
756 
758 {
759  Q_Q(QWizard);
760 
761  QWizardField myField = field;
762  myField.resolve(defaultPropertyTable);
763 
764  if (Q_UNLIKELY(fieldIndexMap.contains(myField.name))) {
765  qWarning("QWizardPage::addField: Duplicate field '%ls'", qUtf16Printable(myField.name));
766  return;
767  }
768 
769  fieldIndexMap.insert(myField.name, fields.count());
770  fields += myField;
771  if (myField.mandatory && !myField.changedSignal.isEmpty())
772  QObject::connect(myField.object, myField.changedSignal,
773  myField.page, SLOT(_q_maybeEmitCompleteChanged()));
775  myField.object, SIGNAL(destroyed(QObject*)), q,
777 }
778 
780 {
781  Q_Q(QWizard);
782 
783  const QWizardField &field = fields.at(index);
784  fieldIndexMap.remove(field.name);
785  if (field.mandatory && !field.changedSignal.isEmpty())
787  field.page, SLOT(_q_maybeEmitCompleteChanged()));
789  field.object, SIGNAL(destroyed(QObject*)), q,
792 }
793 
795 {
796  Q_Q(QWizard);
797 
798  disableUpdates();
799 
800  int oldId = current;
801  if (QWizardPage *oldPage = q->currentPage()) {
802  oldPage->hide();
803 
804  if (direction == Backward) {
805  if (!(opts & QWizard::IndependentPages)) {
806  q->cleanupPage(oldId);
807  oldPage->d_func()->initialized = false;
808  }
809  Q_ASSERT(history.constLast() == oldId);
811  Q_ASSERT(history.constLast() == newId);
812  }
813  }
814 
815  current = newId;
816 
817  QWizardPage *newPage = q->currentPage();
818  if (newPage) {
819  if (direction == Forward) {
820  if (!newPage->d_func()->initialized) {
821  newPage->d_func()->initialized = true;
823  }
825  }
826  newPage->show();
827  }
828 
829  canContinue = (q->nextId() != -1);
830  canFinish = (newPage && newPage->isFinalPage());
831 
834 
835  const QWizard::WizardButton nextOrCommit =
836  newPage && newPage->isCommitPage() ? QWizard::CommitButton : QWizard::NextButton;
837  QAbstractButton *nextOrFinishButton =
838  btns[canContinue ? nextOrCommit : QWizard::FinishButton];
839  QWidget *candidate = nullptr;
840 
841  /*
842  If there is no default button and the Next or Finish button
843  is enabled, give focus directly to it as a convenience to the
844  user. This is the normal case on OS X.
845 
846  Otherwise, give the focus to the new page's first child that
847  can handle it. If there is no such child, give the focus to
848  Next or Finish.
849  */
850  if ((opts & QWizard::NoDefaultButton) && nextOrFinishButton->isEnabled()) {
851  candidate = nextOrFinishButton;
852  } else if (newPage) {
853  candidate = iWantTheFocus(newPage);
854  }
855  if (!candidate)
856  candidate = nextOrFinishButton;
857  candidate->setFocus();
858 
860  q->updateGeometry();
861 
862  enableUpdates();
863  updateLayout();
864  updatePalette();
865 
866  emit q->currentIdChanged(current);
867 }
868 
869 // keep in sync with QWizard::WizardButton
870 static const char * buttonSlots(QWizard::WizardButton which)
871 {
872  switch (which) {
873  case QWizard::BackButton:
874  return SLOT(back());
875  case QWizard::NextButton:
877  return SLOT(next());
879  return SLOT(accept());
881  return SLOT(reject());
882  case QWizard::HelpButton:
883  return SIGNAL(helpRequested());
887  case QWizard::Stretch:
888  case QWizard::NoButton:
889  Q_UNREACHABLE();
890  };
891  return nullptr;
892 };
893 
895 {
896  Q_Q(QWizard);
897  QStyle *style = q->style();
898 
900 
902  option.initFrom(q);
903  const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &option);
904  info.topLevelMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, q);
905  info.topLevelMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, nullptr, q);
906  info.topLevelMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, nullptr, q);
907  info.topLevelMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, nullptr, q);
908  info.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, titleLabel);
909  info.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, nullptr, titleLabel);
910  info.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, nullptr, titleLabel);
911  info.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, nullptr, titleLabel);
912  info.hspacing = (layoutHorizontalSpacing == -1)
914  : layoutHorizontalSpacing;
915  info.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &option);
916  info.buttonSpacing = (layoutHorizontalSpacing == -1)
918  : layoutHorizontalSpacing;
919 
921  info.buttonSpacing = 12;
922 
923  info.wizStyle = wizStyle;
924  if (info.wizStyle == QWizard::AeroStyle
925 #if QT_CONFIG(style_windowsvista)
926  && (QVistaHelper::vistaState() == QVistaHelper::Classic || vistaDisabled())
927 #endif
928  )
929  info.wizStyle = QWizard::ModernStyle;
930 
931  QString titleText;
932  QString subTitleText;
933  QPixmap backgroundPixmap;
934  QPixmap watermarkPixmap;
935 
936  if (QWizardPage *page = q->currentPage()) {
937  titleText = page->title();
938  subTitleText = page->subTitle();
939  backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap);
940  watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap);
941  }
942 
943  info.header = (info.wizStyle == QWizard::ClassicStyle || info.wizStyle == QWizard::ModernStyle)
944  && !(opts & QWizard::IgnoreSubTitles) && !subTitleText.isEmpty();
945  info.sideWidget = sideWidget;
946  info.watermark = (info.wizStyle != QWizard::MacStyle) && (info.wizStyle != QWizard::AeroStyle)
947  && !watermarkPixmap.isNull();
948  info.title = !info.header && !titleText.isEmpty();
949  info.subTitle = !(opts & QWizard::IgnoreSubTitles) && !info.header && !subTitleText.isEmpty();
950  info.extension = (info.watermark || info.sideWidget) && (opts & QWizard::ExtendedWatermarkPixmap);
951 
952  return info;
953 }
954 
956 {
957  Q_Q(QWizard);
958 
959  /*
960  Start by undoing the main layout.
961  */
962  for (int i = mainLayout->count() - 1; i >= 0; --i) {
964  if (item->layout()) {
965  item->layout()->setParent(nullptr);
966  } else {
967  delete item;
968  }
969  }
970  for (int i = mainLayout->columnCount() - 1; i >= 0; --i)
972  for (int i = mainLayout->rowCount() - 1; i >= 0; --i)
974 
975  /*
976  Now, recreate it.
977  */
978 
979  bool mac = (info.wizStyle == QWizard::MacStyle);
980  bool classic = (info.wizStyle == QWizard::ClassicStyle);
981  bool modern = (info.wizStyle == QWizard::ModernStyle);
982  bool aero = (info.wizStyle == QWizard::AeroStyle);
983  int deltaMarginLeft = info.topLevelMarginLeft - info.childMarginLeft;
984  int deltaMarginRight = info.topLevelMarginRight - info.childMarginRight;
985  int deltaMarginTop = info.topLevelMarginTop - info.childMarginTop;
986  int deltaMarginBottom = info.topLevelMarginBottom - info.childMarginBottom;
987  int deltaVSpacing = info.topLevelMarginBottom - info.vspacing;
988 
989  int row = 0;
990  int numColumns;
991  if (mac) {
992  numColumns = 3;
993  } else if (info.watermark || info.sideWidget) {
994  numColumns = 2;
995  } else {
996  numColumns = 1;
997  }
998  int pageColumn = qMin(1, numColumns - 1);
999 
1000  if (mac) {
1002  mainLayout->setSpacing(0);
1004  pageVBoxLayout->setContentsMargins(7, 7, 7, 7);
1005  } else {
1006  if (modern) {
1008  mainLayout->setSpacing(0);
1009  pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop,
1010  deltaMarginRight, deltaMarginBottom);
1011  buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1012  info.topLevelMarginRight, info.topLevelMarginBottom);
1013  } else {
1014  mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop,
1015  info.topLevelMarginRight, info.topLevelMarginBottom);
1017  mainLayout->setVerticalSpacing(info.vspacing);
1018  pageVBoxLayout->setContentsMargins(0, 0, 0, 0);
1019  buttonLayout->setContentsMargins(0, 0, 0, 0);
1020  }
1021  }
1022  buttonLayout->setSpacing(info.buttonSpacing);
1023 
1024  if (info.header) {
1025  if (!headerWidget)
1028  mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns);
1029  }
1030  if (headerWidget)
1031  headerWidget->setVisible(info.header);
1032 
1033  int watermarkStartRow = row;
1034 
1035  if (mac)
1037 
1038  if (info.title) {
1039  if (!titleLabel) {
1042  titleLabel->setWordWrap(true);
1043  }
1044 
1045  QFont titleFont = q->font();
1046  titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4));
1047  titleFont.setBold(true);
1049 
1050  if (aero) {
1051  // ### hardcoded for now:
1052  titleFont = QFont(QLatin1String("Segoe UI"), 12);
1053  QPalette pal(titleLabel->palette());
1054  pal.setColor(QPalette::Text, QColor(0x00, 0x33, 0x99));
1055  titleLabel->setPalette(pal);
1056  }
1057 
1058  titleLabel->setFont(titleFont);
1059  const int aeroTitleIndent = 25; // ### hardcoded for now - should be calculated somehow
1060  if (aero)
1061  titleLabel->setIndent(aeroTitleIndent);
1062  else if (mac)
1063  titleLabel->setIndent(2);
1064  else if (classic)
1065  titleLabel->setIndent(info.childMarginLeft);
1066  else
1067  titleLabel->setIndent(info.topLevelMarginLeft);
1068  if (modern) {
1069  if (!placeholderWidget1) {
1072  }
1073  placeholderWidget1->setFixedHeight(info.topLevelMarginLeft + 2);
1074  mainLayout->addWidget(placeholderWidget1, row++, pageColumn);
1075  }
1076  mainLayout->addWidget(titleLabel, row++, pageColumn);
1077  if (modern) {
1078  if (!placeholderWidget2) {
1081  }
1083  mainLayout->addWidget(placeholderWidget2, row++, pageColumn);
1084  }
1085  if (mac)
1087  }
1088  if (placeholderWidget1)
1089  placeholderWidget1->setVisible(info.title && modern);
1090  if (placeholderWidget2)
1091  placeholderWidget2->setVisible(info.title && modern);
1092 
1093  if (info.subTitle) {
1094  if (!subTitleLabel) {
1096  subTitleLabel->setWordWrap(true);
1097 
1098  subTitleLabel->setContentsMargins(info.childMarginLeft , 0,
1099  info.childMarginRight , 0);
1100 
1102  }
1103  }
1104 
1105  // ### try to replace with margin.
1106  changeSpacerSize(pageVBoxLayout, 0, 0, info.subTitle ? info.childMarginLeft : 0);
1107 
1108  int hMargin = mac ? 1 : 0;
1109  int vMargin = hMargin;
1110 
1112  pageFrame->setLineWidth(0);
1113  pageFrame->setMidLineWidth(hMargin);
1114 
1115  if (info.header) {
1116  if (modern) {
1117  hMargin = info.topLevelMarginLeft;
1118  vMargin = deltaMarginBottom;
1119  } else if (classic) {
1120  hMargin = deltaMarginLeft + ClassicHMargin;
1121  vMargin = 0;
1122  }
1123  }
1124 
1125  if (aero) {
1126  int leftMargin = 18; // ### hardcoded for now - should be calculated somehow
1127  int topMargin = vMargin;
1128  int rightMargin = hMargin; // ### for now
1129  int bottomMargin = vMargin;
1130  pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
1131  } else {
1132  pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);
1133  }
1134 
1135  if ((info.watermark || info.sideWidget) && !watermarkLabel) {
1141  }
1142 
1143  //bool wasSemiTransparent = pageFrame->testAttribute(Qt::WA_SetPalette);
1144  const bool wasSemiTransparent =
1146  || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255;
1147  if (mac) {
1150  } else {
1151  if (wasSemiTransparent)
1153 
1154  bool baseBackground = (modern && !info.header); // ### TAG1
1156 
1157  if (titleLabel)
1158  titleLabel->setAutoFillBackground(baseBackground);
1159  pageFrame->setAutoFillBackground(baseBackground);
1160  if (watermarkLabel)
1161  watermarkLabel->setAutoFillBackground(baseBackground);
1162  if (placeholderWidget1)
1163  placeholderWidget1->setAutoFillBackground(baseBackground);
1164  if (placeholderWidget2)
1165  placeholderWidget2->setAutoFillBackground(baseBackground);
1166 
1167  if (aero) {
1168  QPalette pal = pageFrame->palette();
1169  pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1170  pageFrame->setPalette(pal);
1172  pal = antiFlickerWidget->palette();
1173  pal.setBrush(QPalette::Window, QColor(255, 255, 255));
1176  }
1177  }
1178 
1179  mainLayout->addWidget(pageFrame, row++, pageColumn);
1180 
1181  int watermarkEndRow = row;
1182  if (classic)
1183  mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1184 
1185  if (aero) {
1186  buttonLayout->setContentsMargins(9, 9, 9, 9);
1187  mainLayout->setContentsMargins(0, 11, 0, 0);
1188  }
1189 
1190  int buttonStartColumn = info.extension ? 1 : 0;
1191  int buttonNumColumns = info.extension ? 1 : numColumns;
1192 
1193  if (classic || modern) {
1194  if (!bottomRuler)
1196  mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns);
1197  }
1198 
1199  if (classic)
1200  mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
1201 
1202  mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns);
1203 
1204  if (info.watermark || info.sideWidget) {
1205  if (info.extension)
1206  watermarkEndRow = row;
1207  mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0,
1208  watermarkEndRow - watermarkStartRow, 1);
1209  }
1210 
1211  mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0);
1212  if (mac)
1214 
1215  if (headerWidget)
1216  headerWidget->setVisible(info.header);
1217  if (titleLabel)
1218  titleLabel->setVisible(info.title);
1219  if (subTitleLabel)
1220  subTitleLabel->setVisible(info.subTitle);
1221  if (bottomRuler)
1222  bottomRuler->setVisible(classic || modern);
1223  if (watermarkLabel)
1224  watermarkLabel->setVisible(info.watermark || info.sideWidget);
1225 
1226  layoutInfo = info;
1227 }
1228 
1230 {
1231  Q_Q(QWizard);
1232 
1233  disableUpdates();
1234 
1236  if (layoutInfo != info)
1238  QWizardPage *page = q->currentPage();
1239 
1240  // If the page can expand vertically, let it stretch "infinitely" more
1241  // than the QSpacerItem at the bottom. Otherwise, let the QSpacerItem
1242  // stretch "infinitely" more than the page. Change the bottom item's
1243  // policy accordingly. The case that the page has no layout is basically
1244  // for Designer, only.
1245  if (page) {
1246  bool expandPage = !page->layout();
1247  if (!expandPage) {
1249  expandPage = pageItem->expandingDirections() & Qt::Vertical;
1250  }
1251  QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem();
1252  Q_ASSERT(bottomSpacer);
1255  }
1256 
1257  if (info.header) {
1258  Q_ASSERT(page);
1259  headerWidget->setup(info, page->title(), page->subTitle(),
1262  }
1263 
1264  if (info.watermark || info.sideWidget) {
1265  QPixmap pix;
1266  if (info.watermark) {
1267  if (page)
1268  pix = page->pixmap(QWizard::WatermarkPixmap);
1269  else
1270  pix = q->pixmap(QWizard::WatermarkPixmap);
1271  }
1272  watermarkLabel->setPixmap(pix); // in case there is no watermark and we show the side widget we need to clear the watermark
1273  }
1274 
1275  if (info.title) {
1276  Q_ASSERT(page);
1278  titleLabel->setText(page->title());
1279  }
1280  if (info.subTitle) {
1281  Q_ASSERT(page);
1283  subTitleLabel->setText(page->subTitle());
1284  }
1285 
1286  enableUpdates();
1288 }
1289 
1291  if (wizStyle == QWizard::MacStyle) {
1292  // This is required to ensure visual semitransparency when
1293  // switching from ModernStyle to MacStyle.
1294  // See TAG1 in recreateLayout
1295  // This additionally ensures that the colors are correct
1296  // when the theme is changed.
1297 
1298  // we should base the new palette on the default one
1299  // so theme colors will be correct
1301 
1302  QColor windowColor = newPalette.brush(QPalette::Window).color();
1303  windowColor.setAlpha(153);
1304  newPalette.setBrush(QPalette::Window, windowColor);
1305 
1306  QColor baseColor = newPalette.brush(QPalette::Base).color();
1307  baseColor.setAlpha(153);
1308  newPalette.setBrush(QPalette::Base, baseColor);
1309 
1310  pageFrame->setPalette(newPalette);
1311  }
1312 }
1313 
1315 {
1316  Q_Q(QWizard);
1317 
1318  int extraHeight = 0;
1319 #if QT_CONFIG(style_windowsvista)
1320  if (isVistaThemeEnabled())
1321  extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
1322 #endif
1323  QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
1324  QSize maximumSize = mainLayout->totalMaximumSize();
1325  if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) {
1326  minimumSize.setWidth(headerWidget->maximumWidth());
1327  maximumSize.setWidth(headerWidget->maximumWidth());
1328  }
1329  if (info.watermark && !info.sideWidget) {
1330  minimumSize.setHeight(mainLayout->totalSizeHint().height());
1331  }
1332  if (q->minimumWidth() == minimumWidth) {
1333  minimumWidth = minimumSize.width();
1334  q->setMinimumWidth(minimumWidth);
1335  }
1336  if (q->minimumHeight() == minimumHeight) {
1337  minimumHeight = minimumSize.height();
1338  q->setMinimumHeight(minimumHeight);
1339  }
1340  if (q->maximumWidth() == maximumWidth) {
1341  maximumWidth = maximumSize.width();
1342  q->setMaximumWidth(maximumWidth);
1343  }
1344  if (q->maximumHeight() == maximumHeight) {
1345  maximumHeight = maximumSize.height();
1346  q->setMaximumHeight(maximumHeight);
1347  }
1348 }
1349 
1351 {
1352  Q_Q(QWizard);
1353  if (q->currentPage()) {
1354  canContinue = (q->nextId() != -1);
1355  canFinish = q->currentPage()->isFinalPage();
1356  } else {
1357  canContinue = false;
1358  canFinish = false;
1359  }
1362 }
1363 
1364 static QString object_name_for_button(QWizard::WizardButton which)
1365 {
1366  switch (which) {
1367  case QWizard::CommitButton:
1368  return QLatin1String("qt_wizard_") + QLatin1String("commit");
1369  case QWizard::FinishButton:
1370  return QLatin1String("qt_wizard_") + QLatin1String("finish");
1371  case QWizard::CancelButton:
1372  return QLatin1String("qt_wizard_") + QLatin1String("cancel");
1373  case QWizard::BackButton:
1374  case QWizard::NextButton:
1375  case QWizard::HelpButton:
1379  // Make navigation buttons detectable as passive interactor in designer
1380  return QLatin1String("__qt__passive_wizardbutton") + QString::number(which);
1381  case QWizard::Stretch:
1382  case QWizard::NoButton:
1383  //case QWizard::NStandardButtons:
1384  //case QWizard::NButtons:
1385  ;
1386  }
1387  Q_UNREACHABLE();
1388  return QString();
1389 }
1390 
1392 {
1393  Q_Q(const QWizard);
1394  if (uint(which) >= QWizard::NButtons)
1395  return false;
1396 
1397  if (!btns[which]) {
1399  QStyle *style = q->style();
1400  if (style != QApplication::style()) // Propagate style
1402  pushButton->setObjectName(object_name_for_button(which));
1403 #ifdef Q_OS_MACOS
1404  pushButton->setAutoDefault(false);
1405 #endif
1406  pushButton->hide();
1407 #ifdef Q_CC_HPACC
1408  const_cast<QWizardPrivate *>(this)->btns[which] = pushButton;
1409 #else
1410  btns[which] = pushButton;
1411 #endif
1412  if (which < QWizard::NStandardButtons)
1413  pushButton->setText(buttonDefaultText(wizStyle, which, this));
1414 
1415  connectButton(which);
1416  }
1417  return true;
1418 }
1419 
1421 {
1422  Q_Q(const QWizard);
1423  if (which < QWizard::NStandardButtons) {
1424  QObject::connect(btns[which], SIGNAL(clicked()), q, buttonSlots(which));
1425  } else {
1426  QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked()));
1427  }
1428 }
1429 
1431 {
1432  Q_Q(QWizard);
1433  for (int i = 0; i < QWizard::NButtons; ++i) {
1434  if (btns[i]) {
1435  if (q->currentPage() && (q->currentPage()->d_func()->buttonCustomTexts.contains(i)))
1436  btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i));
1437  else if (buttonCustomTexts.contains(i))
1439  else if (i < QWizard::NStandardButtons)
1440  btns[i]->setText(buttonDefaultText(wizStyle, i, this));
1441  }
1442  }
1443  // Vista: Add shortcut for 'next'. Note: native dialogs use ALT-Right
1444  // even in RTL mode, so do the same, even if it might be counter-intuitive.
1445  // The shortcut for 'back' is set in class QVistaBackButton.
1446 #if QT_CONFIG(shortcut) && QT_CONFIG(style_windowsvista)
1448  if (vistaNextShortcut.isNull()) {
1449  vistaNextShortcut =
1452  }
1453  } else {
1454  delete vistaNextShortcut;
1455  }
1456 #endif // shortcut && style_windowsvista
1457 }
1458 
1460 {
1463  for (int i = 0; i < buttonsCustomLayout.count(); ++i)
1465  setButtonLayout(array.constData(), array.count());
1466  } else {
1467  // Positions:
1468  // Help Stretch Custom1 Custom2 Custom3 Cancel Back Next Commit Finish Cancel Help
1469 
1470  const int ArraySize = 12;
1472  memset(array, -1, sizeof(array));
1474 
1475  if (opts & QWizard::HaveHelpButton) {
1476  int i = (opts & QWizard::HelpButtonOnRight) ? 11 : 0;
1478  }
1479  array[1] = QWizard::Stretch;
1486 
1487  if (!(opts & QWizard::NoCancelButton)) {
1488  int i = (opts & QWizard::CancelButtonOnLeft) ? 5 : 10;
1490  }
1495 
1497  }
1498 }
1499 
1501 {
1502  QWidget *prev = pageFrame;
1503 
1504  for (int i = buttonLayout->count() - 1; i >= 0; --i) {
1506  if (QWidget *widget = item->widget())
1507  widget->hide();
1508  delete item;
1509  }
1510 
1511  for (int i = 0; i < size; ++i) {
1512  QWizard::WizardButton which = array[i];
1513  if (which == QWizard::Stretch) {
1515  } else if (which != QWizard::NoButton) {
1516  ensureButton(which);
1517  buttonLayout->addWidget(btns[which]);
1518 
1519  // Back, Next, Commit, and Finish are handled in _q_updateButtonStates()
1520  if (which != QWizard::BackButton && which != QWizard::NextButton
1521  && which != QWizard::CommitButton && which != QWizard::FinishButton)
1522  btns[which]->show();
1523 
1524  if (prev)
1525  QWidget::setTabOrder(prev, btns[which]);
1526  prev = btns[which];
1527  }
1528  }
1529 
1531 }
1532 
1534 {
1536 }
1537 
1539 {
1540  Q_Q(QWizard);
1541  if (which == QWizard::BackgroundPixmap) {
1542  if (wizStyle == QWizard::MacStyle) {
1543  q->update();
1544  q->updateGeometry();
1545  }
1546  } else {
1547  updateLayout();
1548  }
1549 }
1550 
1551 #if QT_CONFIG(style_windowsvista)
1552 bool QWizardPrivate::vistaDisabled() const
1553 {
1554  Q_Q(const QWizard);
1555  const QVariant v = q->property("_q_wizard_vista_off");
1556  return v.isValid() && v.toBool();
1557 }
1558 
1559 bool QWizardPrivate::isVistaThemeEnabled(QVistaHelper::VistaState state) const
1560 {
1561  return wizStyle == QWizard::AeroStyle
1562  && QVistaHelper::vistaState() == state
1563  && !vistaDisabled();
1564 }
1565 
1566 bool QWizardPrivate::handleAeroStyleChange()
1567 {
1568  Q_Q(QWizard);
1569 
1570  if (inHandleAeroStyleChange)
1571  return false; // prevent recursion
1572  // For top-level wizards, we need the platform window handle for the
1573  // DWM changes. Delay aero initialization to the show event handling if
1574  // it does not exist. If we are a child, skip DWM and just make room by
1575  // moving the antiFlickerWidget.
1576  const bool isWindow = q->isWindow();
1577  if (isWindow && (!q->windowHandle() || !q->windowHandle()->handle()))
1578  return false;
1579  inHandleAeroStyleChange = true;
1580 
1581  vistaHelper->disconnectBackButton();
1582  q->removeEventFilter(vistaHelper);
1583 
1584  bool vistaMargins = false;
1585 
1586  if (isVistaThemeEnabled()) {
1587  const int topOffset = vistaHelper->topOffset(q);
1588  const int topPadding = vistaHelper->topPadding(q);
1589  if (isVistaThemeEnabled(QVistaHelper::VistaAero)) {
1590  if (isWindow) {
1591  vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
1592  q->installEventFilter(vistaHelper);
1593  }
1594  q->setMouseTracking(true);
1595  antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
1596  vistaHelper->backButton()->move(
1597  0, topOffset // ### should ideally work without the '+ 1'
1598  - qMin(topOffset, topPadding + 1));
1599  vistaMargins = true;
1600  vistaHelper->backButton()->show();
1601  } else {
1602  if (isWindow)
1603  vistaHelper->setDWMTitleBar(QVistaHelper::NormalTitleBar);
1604  q->setMouseTracking(true);
1605  antiFlickerWidget->move(0, topOffset);
1606  vistaHelper->backButton()->move(0, -1); // ### should ideally work with (0, 0)
1607  }
1608  if (isWindow)
1609  vistaHelper->setTitleBarIconAndCaptionVisible(false);
1611  vistaHelper->backButton(), SIGNAL(clicked()), q, buttonSlots(QWizard::BackButton));
1612  vistaHelper->backButton()->show();
1613  } else {
1614  q->setMouseTracking(true); // ### original value possibly different
1615 #ifndef QT_NO_CURSOR
1616  q->unsetCursor(); // ### ditto
1617 #endif
1618  antiFlickerWidget->move(0, 0);
1619  vistaHelper->hideBackButton();
1620  if (isWindow)
1621  vistaHelper->setTitleBarIconAndCaptionVisible(true);
1622  }
1623 
1625 
1626  vistaHelper->updateCustomMargins(vistaMargins);
1627 
1628  inHandleAeroStyleChange = false;
1629  return true;
1630 }
1631 #endif
1632 
1634 {
1635 #if QT_CONFIG(style_windowsvista)
1636  return isVistaThemeEnabled(QVistaHelper::VistaAero)
1637  || isVistaThemeEnabled(QVistaHelper::VistaBasic);
1638 #else
1639  return false;
1640 #endif
1641 }
1642 
1644 {
1645  Q_Q(QWizard);
1646  if (disableUpdatesCount++ == 0) {
1647  q->setUpdatesEnabled(false);
1649  }
1650 }
1651 
1653 {
1654  Q_Q(QWizard);
1655  if (--disableUpdatesCount == 0) {
1657  q->setUpdatesEnabled(true);
1658  }
1659 }
1660 
1662 {
1663  Q_Q(QWizard);
1664  QObject *button = q->sender();
1665  for (int i = QWizard::NStandardButtons; i < QWizard::NButtons; ++i) {
1666  if (btns[i] == button) {
1667  emit q->customButtonClicked(QWizard::WizardButton(i));
1668  break;
1669  }
1670  }
1671 }
1672 
1674 {
1675  Q_Q(QWizard);
1676 
1677  disableUpdates();
1678 
1679  const QWizardPage *page = q->currentPage();
1680  bool complete = page && page->isComplete();
1681 
1682  btn.back->setEnabled(history.count() > 1
1683  && !q->page(history.at(history.count() - 2))->isCommitPage()
1685  btn.next->setEnabled(canContinue && complete);
1686  btn.commit->setEnabled(canContinue && complete);
1687  btn.finish->setEnabled(canFinish && complete);
1688 
1689  const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
1692  bool commitPage = page && page->isCommitPage();
1693  btn.back->setVisible(backButtonVisible);
1694  btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage
1696  btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage
1697  && canContinue);
1698  btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton)
1700 
1701  if (!(opts & QWizard::NoCancelButton))
1702  btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton)
1704 
1705  bool useDefault = !(opts & QWizard::NoDefaultButton);
1706  if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next))
1707  nextPush->setDefault(canContinue && useDefault && !commitPage);
1708  if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit))
1709  commitPush->setDefault(canContinue && useDefault && commitPage);
1710  if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish))
1711  finishPush->setDefault(!canContinue && useDefault);
1712 
1713 #if QT_CONFIG(style_windowsvista)
1714  if (isVistaThemeEnabled()) {
1715  vistaHelper->backButton()->setEnabled(btn.back->isEnabled());
1716  vistaHelper->backButton()->setVisible(backButtonVisible);
1717  btn.back->setVisible(false);
1718  }
1719 #endif
1720 
1721  enableUpdates();
1722 }
1723 
1725 {
1726  int destroyed_index = -1;
1728  while (it != fields.end()) {
1729  const QWizardField &field = *it;
1730  if (field.object == object) {
1731  destroyed_index = fieldIndexMap.value(field.name, -1);
1732  fieldIndexMap.remove(field.name);
1733  it = fields.erase(it);
1734  } else {
1735  ++it;
1736  }
1737  }
1738  if (destroyed_index != -1) {
1740  while (it2 != fieldIndexMap.end()) {
1741  int index = it2.value();
1742  if (index > destroyed_index) {
1743  QString field_name = it2.key();
1744  fieldIndexMap.insert(field_name, index-1);
1745  }
1746  ++it2;
1747  }
1748  }
1749 }
1750 
1752 {
1753  for (int i = 0; i < QWizard::NButtons; i++)
1754  if (btns[i])
1755  btns[i]->setStyle(style);
1756  const PageMap::const_iterator pcend = pageMap.constEnd();
1757  for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend; ++it)
1758  it.value()->setStyle(style);
1759 }
1760 
1761 #ifdef Q_OS_MACOS
1762 
1763 QPixmap QWizardPrivate::findDefaultBackgroundPixmap()
1764 {
1765  QGuiApplication *app = qobject_cast<QGuiApplication *>(QCoreApplication::instance());
1766  if (!app)
1767  return QPixmap();
1768  QPlatformNativeInterface *platformNativeInterface = app->platformNativeInterface();
1769  int at = platformNativeInterface->metaObject()->indexOfMethod("defaultBackgroundPixmapForQWizard()");
1770  if (at == -1)
1771  return QPixmap();
1772  QMetaMethod defaultBackgroundPixmapForQWizard = platformNativeInterface->metaObject()->method(at);
1773  QPixmap result;
1774  if (!defaultBackgroundPixmapForQWizard.invoke(platformNativeInterface, Q_RETURN_ARG(QPixmap, result)))
1775  return QPixmap();
1776  return result;
1777 }
1778 
1779 #endif
1780 
1781 #if QT_CONFIG(style_windowsvista)
1783 {
1784  if (wizardPrivate->isVistaThemeEnabled()) {
1785  int leftMargin, topMargin, rightMargin, bottomMargin;
1786  wizardPrivate->buttonLayout->getContentsMargins(
1787  &leftMargin, &topMargin, &rightMargin, &bottomMargin);
1788  const int buttonLayoutTop = wizardPrivate->buttonLayout->contentsRect().top() - topMargin;
1789  QPainter painter(this);
1790  const QBrush brush(QColor(240, 240, 240)); // ### hardcoded for now
1791  painter.fillRect(0, buttonLayoutTop, width(), height() - buttonLayoutTop, brush);
1792  painter.setPen(QPen(QBrush(QColor(223, 223, 223)), 0)); // ### hardcoded for now
1793  painter.drawLine(0, buttonLayoutTop, width(), buttonLayoutTop);
1794  if (wizardPrivate->isVistaThemeEnabled(QVistaHelper::VistaBasic)) {
1795  if (window()->isActiveWindow())
1796  painter.setPen(QPen(QBrush(QColor(169, 191, 214)), 0)); // ### hardcoded for now
1797  else
1798  painter.setPen(QPen(QBrush(QColor(182, 193, 204)), 0)); // ### hardcoded for now
1799  painter.drawLine(0, 0, width(), 0);
1800  }
1801  }
1802 }
1803 #endif
1804 
2201 {
2202  Q_D(QWizard);
2203  d->init();
2204 }
2205 
2210 {
2211  Q_D(QWizard);
2212  delete d->buttonLayout;
2213 }
2214 
2224 {
2225  Q_D(QWizard);
2226  int theid = 0;
2227  if (!d->pageMap.isEmpty())
2228  theid = d->pageMap.lastKey() + 1;
2229  setPage(theid, page);
2230  return theid;
2231 }
2232 
2244 {
2245  Q_D(QWizard);
2246 
2247  if (Q_UNLIKELY(!page)) {
2248  qWarning("QWizard::setPage: Cannot insert null page");
2249  return;
2250  }
2251 
2252  if (Q_UNLIKELY(theid == -1)) {
2253  qWarning("QWizard::setPage: Cannot insert page with ID -1");
2254  return;
2255  }
2256 
2257  if (Q_UNLIKELY(d->pageMap.contains(theid))) {
2258  qWarning("QWizard::setPage: Page with duplicate ID %d ignored", theid);
2259  return;
2260  }
2261 
2262  page->setParent(d->pageFrame);
2263 
2264  QList<QWizardField> &pendingFields = page->d_func()->pendingFields;
2265  for (int i = 0; i < pendingFields.count(); ++i)
2266  d->addField(pendingFields.at(i));
2267  pendingFields.clear();
2268 
2269  connect(page, SIGNAL(completeChanged()), this, SLOT(_q_updateButtonStates()));
2270 
2271  d->pageMap.insert(theid, page);
2272  page->d_func()->wizard = this;
2273 
2274  int n = d->pageVBoxLayout->count();
2275 
2276  // disable layout to prevent layout updates while adding
2277  bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled();
2278  d->pageVBoxLayout->setEnabled(false);
2279 
2280  d->pageVBoxLayout->insertWidget(n - 1, page);
2281 
2282  // hide new page and reset layout to old status
2283  page->hide();
2284  d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled);
2285 
2286  if (!d->startSetByUser && d->pageMap.constBegin().key() == theid)
2287  d->start = theid;
2288  emit pageAdded(theid);
2289 }
2290 
2300 {
2301  Q_D(QWizard);
2302 
2303  QWizardPage *removedPage = nullptr;
2304 
2305  // update startItem accordingly
2306  if (d->pageMap.count() > 0) { // only if we have any pages
2307  if (d->start == id) {
2308  const int firstId = d->pageMap.constBegin().key();
2309  if (firstId == id) {
2310  if (d->pageMap.count() > 1)
2311  d->start = (++d->pageMap.constBegin()).key(); // secondId
2312  else
2313  d->start = -1; // removing the last page
2314  } else { // startSetByUser has to be "true" here
2315  d->start = firstId;
2316  }
2317  d->startSetByUser = false;
2318  }
2319  }
2320 
2321  if (d->pageMap.contains(id))
2322  emit pageRemoved(id);
2323 
2324  if (!d->history.contains(id)) {
2325  // Case 1: removing a page not in the history
2326  removedPage = d->pageMap.take(id);
2327  d->updateCurrentPage();
2328  } else if (id != d->current) {
2329  // Case 2: removing a page in the history before the current page
2330  removedPage = d->pageMap.take(id);
2331  d->history.removeOne(id);
2332  d->_q_updateButtonStates();
2333  } else if (d->history.count() == 1) {
2334  // Case 3: removing the current page which is the first (and only) one in the history
2335  d->reset();
2336  removedPage = d->pageMap.take(id);
2337  if (d->pageMap.isEmpty())
2338  d->updateCurrentPage();
2339  else
2340  restart();
2341  } else {
2342  // Case 4: removing the current page which is not the first one in the history
2343  back();
2344  removedPage = d->pageMap.take(id);
2345  d->updateCurrentPage();
2346  }
2347 
2348  if (removedPage) {
2349  if (removedPage->d_func()->initialized) {
2350  cleanupPage(id);
2351  removedPage->d_func()->initialized = false;
2352  }
2353 
2354  d->pageVBoxLayout->removeWidget(removedPage);
2355 
2356  for (int i = d->fields.count() - 1; i >= 0; --i) {
2357  if (d->fields.at(i).page == removedPage) {
2358  removedPage->d_func()->pendingFields += d->fields.at(i);
2359  d->removeFieldAt(i);
2360  }
2361  }
2362  }
2363 }
2364 
2373 QWizardPage *QWizard::page(int theid) const
2374 {
2375  Q_D(const QWizard);
2376  return d->pageMap.value(theid);
2377 }
2378 
2389 bool QWizard::hasVisitedPage(int theid) const
2390 {
2391  Q_D(const QWizard);
2392  return d->history.contains(theid);
2393 }
2394 
2404 {
2405  Q_D(const QWizard);
2406  return d->history;
2407 }
2408 
2414 {
2415  Q_D(const QWizard);
2416  return d->pageMap.keys();
2417 }
2418 
2429 void QWizard::setStartId(int theid)
2430 {
2431  Q_D(QWizard);
2432  int newStart = theid;
2433  if (theid == -1)
2434  newStart = d->pageMap.count() ? d->pageMap.constBegin().key() : -1;
2435 
2436  if (d->start == newStart) {
2437  d->startSetByUser = theid != -1;
2438  return;
2439  }
2440 
2441  if (Q_UNLIKELY(!d->pageMap.contains(newStart))) {
2442  qWarning("QWizard::setStartId: Invalid page ID %d", newStart);
2443  return;
2444  }
2445  d->start = newStart;
2446  d->startSetByUser = theid != -1;
2447 }
2448 
2449 int QWizard::startId() const
2450 {
2451  Q_D(const QWizard);
2452  return d->start;
2453 }
2454 
2464 {
2465  Q_D(const QWizard);
2466  return page(d->current);
2467 }
2468 
2482 {
2483  Q_D(const QWizard);
2484  return d->current;
2485 }
2486 
2495 {
2496  Q_D(QWizard);
2497 
2498  int index = d->fieldIndexMap.value(name, -1);
2499  if (Q_UNLIKELY(index == -1)) {
2500  qWarning("QWizard::setField: No such field '%ls'", qUtf16Printable(name));
2501  return;
2502  }
2503 
2504  const QWizardField &field = d->fields.at(index);
2505  if (Q_UNLIKELY(!field.object->setProperty(field.property, value)))
2506  qWarning("QWizard::setField: Couldn't write to property '%s'",
2507  field.property.constData());
2508 }
2509 
2518 {
2519  Q_D(const QWizard);
2520 
2521  int index = d->fieldIndexMap.value(name, -1);
2522  if (Q_UNLIKELY(index == -1)) {
2523  qWarning("QWizard::field: No such field '%ls'", qUtf16Printable(name));
2524  return QVariant();
2525  }
2526 
2527  const QWizardField &field = d->fields.at(index);
2528  return field.object->property(field.property);
2529 }
2530 
2544 {
2545  Q_D(QWizard);
2546 
2547  const bool styleChange = style != d->wizStyle;
2548 
2549 #if QT_CONFIG(style_windowsvista)
2550  const bool aeroStyleChange =
2551  d->vistaInitPending || d->vistaStateChanged || (styleChange && (style == AeroStyle || d->wizStyle == AeroStyle));
2552  d->vistaStateChanged = false;
2553  d->vistaInitPending = false;
2554 #endif
2555 
2556  if (styleChange
2557 #if QT_CONFIG(style_windowsvista)
2558  || aeroStyleChange
2559 #endif
2560  ) {
2561  d->disableUpdates();
2562  d->wizStyle = style;
2563  d->updateButtonTexts();
2564 #if QT_CONFIG(style_windowsvista)
2565  if (aeroStyleChange) {
2566  //Send a resizeevent since the antiflicker widget probably needs a new size
2567  //because of the backbutton in the window title
2568  QResizeEvent ev(geometry().size(), geometry().size());
2569  QCoreApplication::sendEvent(this, &ev);
2570  }
2571 #endif
2572  d->updateLayout();
2573  updateGeometry();
2574  d->enableUpdates();
2575 #if QT_CONFIG(style_windowsvista)
2576  // Delay initialization when activating Aero style fails due to missing native window.
2577  if (aeroStyleChange && !d->handleAeroStyleChange() && d->wizStyle == AeroStyle)
2578  d->vistaInitPending = true;
2579 #endif
2580  }
2581 }
2582 
2584 {
2585  Q_D(const QWizard);
2586  return d->wizStyle;
2587 }
2588 
2596 {
2597  Q_D(QWizard);
2598  if (!(d->opts & option) != !on)
2599  setOptions(d->opts ^ option);
2600 }
2601 
2609 {
2610  Q_D(const QWizard);
2611  return (d->opts & option) != 0;
2612 }
2613 
2628 void QWizard::setOptions(WizardOptions options)
2629 {
2630  Q_D(QWizard);
2631 
2632  WizardOptions changed = (options ^ d->opts);
2633  if (!changed)
2634  return;
2635 
2636  d->disableUpdates();
2637 
2638  d->opts = options;
2639  if ((changed & IndependentPages) && !(d->opts & IndependentPages))
2640  d->cleanupPagesNotInHistory();
2641 
2644  | HaveCustomButton3)) {
2645  d->updateButtonLayout();
2646  } else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
2649  d->_q_updateButtonStates();
2650  }
2651 
2652  d->enableUpdates();
2653  d->updateLayout();
2654 }
2655 
2656 QWizard::WizardOptions QWizard::options() const
2657 {
2658  Q_D(const QWizard);
2659  return d->opts;
2660 }
2661 
2680 {
2681  Q_D(QWizard);
2682 
2683  if (!d->ensureButton(which))
2684  return;
2685 
2686  d->buttonCustomTexts.insert(which, text);
2687 
2688  if (!currentPage() || !currentPage()->d_func()->buttonCustomTexts.contains(which))
2689  d->btns[which]->setText(text);
2690 }
2691 
2705 {
2706  Q_D(const QWizard);
2707 
2708  if (!d->ensureButton(which))
2709  return QString();
2710 
2711  if (d->buttonCustomTexts.contains(which))
2712  return d->buttonCustomTexts.value(which);
2713 
2714  const QString defText = buttonDefaultText(d->wizStyle, which, d);
2715  if (!defText.isNull())
2716  return defText;
2717 
2718  return d->btns[which]->text();
2719 }
2720 
2740 {
2741  Q_D(QWizard);
2742 
2743  for (int i = 0; i < layout.count(); ++i) {
2744  WizardButton button1 = layout.at(i);
2745 
2746  if (button1 == NoButton || button1 == Stretch)
2747  continue;
2748  if (!d->ensureButton(button1))
2749  return;
2750 
2751  // O(n^2), but n is very small
2752  for (int j = 0; j < i; ++j) {
2753  WizardButton button2 = layout.at(j);
2754  if (Q_UNLIKELY(button2 == button1)) {
2755  qWarning("QWizard::setButtonLayout: Duplicate button in layout");
2756  return;
2757  }
2758  }
2759  }
2760 
2761  d->buttonsHaveCustomLayout = true;
2762  d->buttonsCustomLayout = layout;
2763  d->updateButtonLayout();
2764 }
2765 
2777 {
2778  Q_D(QWizard);
2779 
2780  if (uint(which) >= NButtons || d->btns[which] == button)
2781  return;
2782 
2783  if (QAbstractButton *oldButton = d->btns[which]) {
2784  d->buttonLayout->removeWidget(oldButton);
2785  delete oldButton;
2786  }
2787 
2788  d->btns[which] = button;
2789  if (button) {
2790  button->setParent(d->antiFlickerWidget);
2791  d->buttonCustomTexts.insert(which, button->text());
2792  d->connectButton(which);
2793  } else {
2794  d->buttonCustomTexts.remove(which); // ### what about page-specific texts set for 'which'
2795  d->ensureButton(which); // (QWizardPage::setButtonText())? Clear them as well?
2796  }
2797 
2798  d->updateButtonLayout();
2799 }
2800 
2807 {
2808  Q_D(const QWizard);
2809 #if QT_CONFIG(style_windowsvista)
2810  if (d->wizStyle == AeroStyle && which == BackButton)
2811  return d->vistaHelper->backButton();
2812 #endif
2813  if (!d->ensureButton(which))
2814  return nullptr;
2815  return d->btns[which];
2816 }
2817 
2827 {
2828  Q_D(QWizard);
2829  d->titleFmt = format;
2830  d->updateLayout();
2831 }
2832 
2834 {
2835  Q_D(const QWizard);
2836  return d->titleFmt;
2837 }
2838 
2848 {
2849  Q_D(QWizard);
2850  d->subTitleFmt = format;
2851  d->updateLayout();
2852 }
2853 
2855 {
2856  Q_D(const QWizard);
2857  return d->subTitleFmt;
2858 }
2859 
2873 {
2874  Q_D(QWizard);
2875  Q_ASSERT(uint(which) < NPixmaps);
2876  d->defaultPixmaps[which] = pixmap;
2877  d->updatePixmap(which);
2878 }
2879 
2889 {
2890  Q_D(const QWizard);
2891  Q_ASSERT(uint(which) < NPixmaps);
2892 #ifdef Q_OS_MACOS
2893  if (which == BackgroundPixmap && d->defaultPixmaps[BackgroundPixmap].isNull())
2894  d->defaultPixmaps[BackgroundPixmap] = d->findDefaultBackgroundPixmap();
2895 #endif
2896  return d->defaultPixmaps[which];
2897 }
2898 
2924 void QWizard::setDefaultProperty(const char *className, const char *property,
2925  const char *changedSignal)
2926 {
2927  Q_D(QWizard);
2928  for (int i = d->defaultPropertyTable.count() - 1; i >= 0; --i) {
2929  if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0) {
2930  d->defaultPropertyTable.remove(i);
2931  break;
2932  }
2933  }
2934  d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal));
2935 }
2936 
2962 {
2963  Q_D(QWizard);
2964 
2965  d->sideWidget = widget;
2966  if (d->watermarkLabel) {
2967  d->watermarkLabel->setSideWidget(widget);
2968  d->updateLayout();
2969  }
2970 }
2971 
2980 {
2981  Q_D(const QWizard);
2982 
2983  return d->sideWidget;
2984 }
2985 
2989 void QWizard::setVisible(bool visible)
2990 {
2991  Q_D(QWizard);
2992  if (visible) {
2993  if (d->current == -1)
2994  restart();
2995  }
2997 }
2998 
3003 {
3004  Q_D(const QWizard);
3005  QSize result = d->mainLayout->totalSizeHint();
3006  QSize extra(500, 360);
3007  if (d->wizStyle == MacStyle && d->current != -1) {
3009  extra.setWidth(616);
3010  if (!pixmap.isNull()) {
3011  extra.setHeight(pixmap.height());
3012 
3013  /*
3014  The width isn't always reliable as a size hint, as
3015  some wizard backgrounds just cover the leftmost area.
3016  Use a rule of thumb to determine if the width is
3017  reliable or not.
3018  */
3019  if (pixmap.width() >= pixmap.height())
3020  extra.setWidth(pixmap.width());
3021  }
3022  }
3023  return result.expandedTo(extra);
3024 }
3025 
3106 {
3107  Q_D(QWizard);
3108  int n = d->history.count() - 2;
3109  if (n < 0)
3110  return;
3111  d->switchToPage(d->history.at(n), QWizardPrivate::Backward);
3112 }
3113 
3122 {
3123  Q_D(QWizard);
3124 
3125  if (d->current == -1)
3126  return;
3127 
3128  if (validateCurrentPage()) {
3129  int next = nextId();
3130  if (next != -1) {
3131  if (Q_UNLIKELY(d->history.contains(next))) {
3132  qWarning("QWizard::next: Page %d already met", next);
3133  return;
3134  }
3135  if (Q_UNLIKELY(!d->pageMap.contains(next))) {
3136  qWarning("QWizard::next: No such page %d", next);
3137  return;
3138  }
3139  d->switchToPage(next, QWizardPrivate::Forward);
3140  }
3141  }
3142 }
3143 
3151 {
3152  Q_D(QWizard);
3153  d->disableUpdates();
3154  d->reset();
3155  d->switchToPage(startId(), QWizardPrivate::Forward);
3156  d->enableUpdates();
3157 }
3158 
3163 {
3164  Q_D(QWizard);
3165  if (event->type() == QEvent::StyleChange) { // Propagate style
3166  d->setStyle(style());
3167  d->updateLayout();
3168  } else if (event->type() == QEvent::PaletteChange) { // Emitted on theme change
3169  d->updatePalette();
3170  }
3171 #if QT_CONFIG(style_windowsvista)
3172  else if (event->type() == QEvent::Show && d->vistaInitPending) {
3173  d->vistaInitPending = false;
3174  // Do not force AeroStyle when in Classic theme.
3175  // Note that d->handleAeroStyleChange() needs to be called in any case as it does some
3176  // necessary initialization, like ensures that the Aero specific back button is hidden if
3177  // Aero theme isn't active.
3178  if (QVistaHelper::vistaState() != QVistaHelper::Classic)
3179  d->wizStyle = AeroStyle;
3180  d->handleAeroStyleChange();
3181  }
3182  else if (d->isVistaThemeEnabled()) {
3183  if (event->type() == QEvent::Resize
3184  || event->type() == QEvent::LayoutDirectionChange) {
3185  const int buttonLeft = (layoutDirection() == Qt::RightToLeft
3186  ? width() - d->vistaHelper->backButton()->sizeHint().width()
3187  : 0);
3188 
3189  d->vistaHelper->backButton()->move(buttonLeft,
3190  d->vistaHelper->backButton()->y());
3191  }
3192 
3193  d->vistaHelper->mouseEvent(event);
3194  }
3195 #endif
3196  return QDialog::event(event);
3197 }
3198 
3203 {
3204  Q_D(QWizard);
3205  int heightOffset = 0;
3206 #if QT_CONFIG(style_windowsvista)
3207  if (d->isVistaThemeEnabled()) {
3208  heightOffset = d->vistaHelper->topOffset(this);
3209  if (d->isVistaThemeEnabled(QVistaHelper::VistaAero))
3210  heightOffset += d->vistaHelper->titleBarSize();
3211  }
3212 #endif
3213  d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset);
3214 #if QT_CONFIG(style_windowsvista)
3215  if (d->isVistaThemeEnabled())
3216  d->vistaHelper->resizeEvent(event);
3217 #endif
3219 }
3220 
3225 {
3226  Q_D(QWizard);
3227  if (d->wizStyle == MacStyle && currentPage()) {
3228  QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);
3229  if (backgroundPixmap.isNull())
3230  return;
3231 
3232  QPainter painter(this);
3233  painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap);
3234  }
3235 #if QT_CONFIG(style_windowsvista)
3236  else if (d->isVistaThemeEnabled()) {
3237  if (d->isVistaThemeEnabled(QVistaHelper::VistaBasic)) {
3238  QPainter painter(this);
3239  QColor color = d->vistaHelper->basicWindowFrameColor();
3240  painter.fillRect(0, 0, width(), QVistaHelper::topOffset(this), color);
3241  }
3242  d->vistaHelper->paintEvent(event);
3243  }
3244 #else
3245  Q_UNUSED(event);
3246 #endif
3247 }
3248 
3249 #if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
3253 bool QWizard::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
3254 {
3255 #if QT_CONFIG(style_windowsvista)
3256  Q_D(QWizard);
3257  if (d->isVistaThemeEnabled() && eventType == "windows_generic_MSG") {
3258  MSG *windowsMessage = static_cast<MSG *>(message);
3259  const bool winEventResult = d->vistaHelper->handleWinEvent(windowsMessage, result);
3260  if (QVistaHelper::vistaState() != d->vistaState) {
3261  // QTBUG-78300: When Qt::AA_NativeWindows is set, delay further
3262  // window creation until after the platform window creation events.
3263  if (windowsMessage->message == WM_GETICON) {
3264  d->vistaStateChanged = true;
3265  d->vistaState = QVistaHelper::vistaState();
3267  }
3268  }
3269  return winEventResult;
3270  } else {
3271  return QDialog::nativeEvent(eventType, message, result);
3272  }
3273 #else
3274  return QDialog::nativeEvent(eventType, message, result);
3275 #endif
3276 }
3277 #endif
3278 
3283 {
3284  Q_D(QWizard);
3285  // canceling leaves the wizard in a known state
3286  if (result == Rejected) {
3287  d->reset();
3288  } else {
3289  if (!validateCurrentPage())
3290  return;
3291  }
3293 }
3294 
3314 {
3315  QWizardPage *page = this->page(theid);
3316  if (page)
3317  page->initializePage();
3318 }
3319 
3331 void QWizard::cleanupPage(int theid)
3332 {
3333  QWizardPage *page = this->page(theid);
3334  if (page)
3335  page->cleanupPage();
3336 }
3337 
3355 {
3357  if (!page)
3358  return true;
3359 
3360  return page->validatePage();
3361 }
3362 
3377 int QWizard::nextId() const
3378 {
3379  const QWizardPage *page = currentPage();
3380  if (!page)
3381  return -1;
3382 
3383  return page->nextId();
3384 }
3385 
3464  : QWidget(*new QWizardPagePrivate, parent, { })
3465 {
3466  connect(this, SIGNAL(completeChanged()), this, SLOT(_q_updateCachedCompleteState()));
3467 }
3468 
3473 {
3474 }
3475 
3491 {
3492  Q_D(QWizardPage);
3493  d->title = title;
3494  if (d->wizard && d->wizard->currentPage() == this)
3495  d->wizard->d_func()->updateLayout();
3496 }
3497 
3499 {
3500  Q_D(const QWizardPage);
3501  return d->title;
3502 }
3503 
3523 void QWizardPage::setSubTitle(const QString &subTitle)
3524 {
3525  Q_D(QWizardPage);
3526  d->subTitle = subTitle;
3527  if (d->wizard && d->wizard->currentPage() == this)
3528  d->wizard->d_func()->updateLayout();
3529 }
3530 
3532 {
3533  Q_D(const QWizardPage);
3534  return d->subTitle;
3535 }
3536 
3551 {
3552  Q_D(QWizardPage);
3553  Q_ASSERT(uint(which) < QWizard::NPixmaps);
3554  d->pixmaps[which] = pixmap;
3555  if (d->wizard && d->wizard->currentPage() == this)
3556  d->wizard->d_func()->updatePixmap(which);
3557 }
3558 
3569 {
3570  Q_D(const QWizardPage);
3571  Q_ASSERT(uint(which) < QWizard::NPixmaps);
3572 
3573  const QPixmap &pixmap = d->pixmaps[which];
3574  if (!pixmap.isNull())
3575  return pixmap;
3576 
3577  if (wizard())
3578  return wizard()->pixmap(which);
3579 
3580  return pixmap;
3581 }
3582 
3601 {
3602 }
3603 
3616 {
3617  Q_D(QWizardPage);
3618  if (d->wizard) {
3619  const QList<QWizardField> &fields = d->wizard->d_func()->fields;
3620  for (const auto &field : fields) {
3621  if (field.page == this)
3622  field.object->setProperty(field.property, field.initialValue);
3623  }
3624  }
3625 }
3626 
3642 {
3643  return true;
3644 }
3645 
3664 {
3665  Q_D(const QWizardPage);
3666 
3667  if (!d->wizard)
3668  return true;
3669 
3670  const QList<QWizardField> &wizardFields = d->wizard->d_func()->fields;
3671  for (int i = wizardFields.count() - 1; i >= 0; --i) {
3672  const QWizardField &field = wizardFields.at(i);
3673  if (field.page == this && field.mandatory) {
3674  QVariant value = field.object->property(field.property);
3675  if (value == field.initialValue)
3676  return false;
3677 
3678 #if QT_CONFIG(lineedit)
3679  if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
3680  if (!lineEdit->hasAcceptableInput())
3681  return false;
3682  }
3683 #endif
3684 #if QT_CONFIG(spinbox)
3685  if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
3686  if (!spinBox->hasAcceptableInput())
3687  return false;
3688  }
3689 #endif
3690  }
3691  }
3692  return true;
3693 }
3694 
3707 void QWizardPage::setFinalPage(bool finalPage)
3708 {
3709  Q_D(QWizardPage);
3710  d->explicitlyFinal = finalPage;
3711  QWizard *wizard = this->wizard();
3712  if (wizard && wizard->currentPage() == this)
3713  wizard->d_func()->updateCurrentPage();
3714 }
3715 
3729 {
3730  Q_D(const QWizardPage);
3731  if (d->explicitlyFinal)
3732  return true;
3733 
3734  QWizard *wizard = this->wizard();
3735  if (wizard && wizard->currentPage() == this) {
3736  // try to use the QWizard implementation if possible
3737  return wizard->nextId() == -1;
3738  } else {
3739  return nextId() == -1;
3740  }
3741 }
3742 
3757 void QWizardPage::setCommitPage(bool commitPage)
3758 {
3759  Q_D(QWizardPage);
3760  d->commit = commitPage;
3761  QWizard *wizard = this->wizard();
3762  if (wizard && wizard->currentPage() == this)
3763  wizard->d_func()->updateCurrentPage();
3764 }
3765 
3772 {
3773  Q_D(const QWizardPage);
3774  return d->commit;
3775 }
3776 
3786 {
3787  Q_D(QWizardPage);
3788  d->buttonCustomTexts.insert(which, text);
3789  if (wizard() && wizard()->currentPage() == this && wizard()->d_func()->btns[which])
3790  wizard()->d_func()->btns[which]->setText(text);
3791 }
3792 
3807 {
3808  Q_D(const QWizardPage);
3809 
3810  if (d->buttonCustomTexts.contains(which))
3811  return d->buttonCustomTexts.value(which);
3812 
3813  if (wizard())
3814  return wizard()->buttonText(which);
3815 
3816  return QString();
3817 }
3818 
3836 {
3837  Q_D(const QWizardPage);
3838 
3839  if (!d->wizard)
3840  return -1;
3841 
3842  bool foundCurrentPage = false;
3843 
3844  const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;
3847 
3848  for (; i != end; ++i) {
3849  if (i.value() == this) {
3850  foundCurrentPage = true;
3851  } else if (foundCurrentPage) {
3852  return i.key();
3853  }
3854  }
3855  return -1;
3856 }
3857 
3882 {
3883  Q_D(QWizardPage);
3884  if (!d->wizard)
3885  return;
3886  d->wizard->setField(name, value);
3887 }
3888 
3903 {
3904  Q_D(const QWizardPage);
3905  if (!d->wizard)
3906  return QVariant();
3907  return d->wizard->field(name);
3908 }
3909 
3957  const char *changedSignal)
3958 {
3959  Q_D(QWizardPage);
3960  QWizardField field(this, name, widget, property, changedSignal);
3961  if (d->wizard) {
3962  d->wizard->d_func()->addField(field);
3963  } else {
3964  d->pendingFields += field;
3965  }
3966 }
3967 
3975 {
3976  Q_D(const QWizardPage);
3977  return d->wizard;
3978 }
3979 
3981 
3982 #include "moc_qwizard.cpp"
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
Arabic default style
Definition: afstyles.h:94
FT_UInt idx
Definition: cffcmap.c:135
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
void setText(const QString &text)
QString text
the text shown on the button
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
bool hasAcceptableInput() const
static QStyle * style()
static QPalette palette()
void invalidate() override
Definition: qboxlayout.cpp:697
int count() const override
Definition: qboxlayout.cpp:707
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
QLayoutItem * takeAt(int) override
Definition: qboxlayout.cpp:725
void addItem(QLayoutItem *) override
Definition: qboxlayout.cpp:832
void addSpacing(int size)
Definition: qboxlayout.cpp:997
void addStretch(int stretch=0)
QLayoutItem * itemAt(int) const override
Definition: qboxlayout.cpp:716
void insertWidget(int index, QWidget *widget, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Definition: qboxlayout.cpp:973
void setSpacing(int spacing) override
Definition: qboxlayout.cpp:605
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:66
const QColor & color() const
Definition: qbrush.h:157
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:85
bool isEmpty() const noexcept
Definition: qbytearray.h:129
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
int alpha() const noexcept
Definition: qcolor.cpp:1463
void setAlpha(int alpha)
Definition: qcolor.cpp:1478
static QCoreApplication * instance()
static bool sendEvent(QObject *receiver, QEvent *event)
The QDateTime class provides date and time functions.
Definition: qdatetime.h:238
The QDialog class is the base class of dialog windows.
Definition: qdialog.h:55
@ Rejected
Definition: qdialog.h:66
void resizeEvent(QResizeEvent *) override
Definition: qdialog.cpp:1088
virtual void done(int)
Definition: qdialog.cpp:654
void setVisible(bool visible) override
Definition: qdialog.cpp:783
The QEvent class is the base class of all event classes. Event objects contain event parameters.
Definition: qcoreevent.h:58
@ LayoutDirectionChange
Definition: qcoreevent.h:137
@ StyleChange
Definition: qcoreevent.h:149
@ Show
Definition: qcoreevent.h:89
@ Resize
Definition: qcoreevent.h:86
@ PaletteChange
Definition: qcoreevent.h:107
The QFont class specifies a query for a font used for drawing text.
Definition: qfont.h:56
void setPointSize(int)
Definition: qfont.cpp:1006
int pointSize() const
Definition: qfont.cpp:899
void setBold(bool)
Definition: qfont.h:335
The QFrame class is the base class of widgets that can have a frame.
Definition: qframe.h:53
@ Raised
Definition: qframe.h:86
void setFrameStyle(int)
Definition: qframe.cpp:335
void setLineWidth(int)
Definition: qframe.cpp:371
@ NoFrame
Definition: qframe.h:75
@ Box
Definition: qframe.h:76
void setMidLineWidth(int)
Definition: qframe.cpp:395
The QGridLayout class lays out widgets in a grid.
Definition: qgridlayout.h:57
void setHorizontalSpacing(int spacing)
void addWidget(QWidget *w)
Definition: qgridlayout.h:100
void addLayout(QLayout *, int row, int column, Qt::Alignment=Qt::Alignment())
void setRowMinimumHeight(int row, int minSize)
int count() const override
void setColumnMinimumWidth(int column, int minSize)
void setSpacing(int spacing) override
int rowCount() const
void setVerticalSpacing(int spacing)
void setRowStretch(int row, int stretch)
int columnCount() const
QLayoutItem * takeAt(int index) override
void setColumnStretch(int column, int stretch)
The QGuiApplication class manages the GUI application's control flow and main settings.
static QPlatformNativeInterface * platformNativeInterface()
QScreen * primaryScreen
the primary (or default) screen of the application.
The QHBoxLayout class lines up widgets horizontally.
Definition: qboxlayout.h:114
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition: qkeysequence.h:71
The QLabel widget provides a text or image display.
Definition: qlabel.h:56
int heightForWidth(int) const override
Definition: qlabel.cpp:684
void setText(const QString &)
Definition: qlabel.cpp:297
void setTextFormat(Qt::TextFormat)
Definition: qlabel.cpp:1410
QPixmap pixmap
the label's pixmap.
Definition: qlabel.h:60
void setIndent(int)
Definition: qlabel.cpp:544
void setPixmap(const QPixmap &)
Definition: qlabel.cpp:373
void setAlignment(Qt::Alignment)
Definition: qlabel.cpp:476
void setWordWrap(bool on)
Definition: qlabel.cpp:506
QSize sizeHint() const override
Definition: qlabel.cpp:854
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
Definition: qstring.h:84
The QLayout class is the base class of geometry managers.
Definition: qlayout.h:62
QSize totalSizeHint() const
Definition: qlayout.cpp:678
void removeWidget(QWidget *w)
Definition: qlayout.cpp:1356
void setSizeConstraint(SizeConstraint)
Definition: qlayout.cpp:1274
QSize totalMaximumSize() const
Definition: qlayout.cpp:703
QSize totalMinimumSize() const
Definition: qlayout.cpp:655
@ SetNoConstraint
Definition: qlayout.h:73
virtual int count() const =0
virtual int indexOf(const QWidget *) const
Definition: qlayout.cpp:1210
void setContentsMargins(int left, int top, int right, int bottom)
Definition: qlayout.cpp:325
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:61
virtual Qt::Orientations expandingDirections() const =0
virtual QSpacerItem * spacerItem()
The QLineEdit widget is a one-line text editor.
Definition: qlineedit.h:64
bool hasAcceptableInput() const
Definition: qlineedit.cpp:1128
const_pointer constData() const noexcept
Definition: qlist.h:444
iterator erase(const_iterator begin, const_iterator end)
Definition: qlist.h:893
iterator end()
Definition: qlist.h:624
const_reference at(qsizetype i) const noexcept
Definition: qlist.h:457
void remove(qsizetype i, qsizetype n=1)
Definition: qlist.h:798
qsizetype count() const noexcept
Definition: qlist.h:415
iterator begin()
Definition: qlist.h:623
void reserve(qsizetype size)
Definition: qlist.h:757
const T & constLast() const noexcept
Definition: qlist.h:648
void removeLast() noexcept
Definition: qlist.h:819
void append(parameter_type t)
Definition: qlist.h:469
void clear()
Definition: qlist.h:445
iterator insert(const Key &key, const T &value)
Definition: qmap.h:719
T value(const Key &key, const T &defaultValue=T()) const
Definition: qmap.h:392
bool contains(const Key &key) const
Definition: qmap.h:376
size_type remove(const Key &key)
Definition: qmap.h:335
iterator begin()
Definition: qmap.h:633
iterator end()
Definition: qmap.h:637
const_iterator constBegin() const
Definition: qmap.h:635
Key key(const T &value, const Key &defaultKey=Key()) const
Definition: qmap.h:384
const_iterator constEnd() const
Definition: qmap.h:639
The QMargins class defines the four margins of a rectangle.
Definition: qmargins.h:52
The QMetaMethod class provides meta-data about a member function.
Definition: qmetaobject.h:54
bool invoke(QObject *object, Qt::ConnectionType connectionType, QGenericReturnArgument returnValue, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument()) const
uint isWindow
Definition: qobject.h:108
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125
QObject * parent() const
Definition: qobject.h:409
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Definition: qobject.cpp:2772
QObject * sender() const
Definition: qobject.cpp:2472
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Definition: qobject.cpp:3048
friend class QWidget
Definition: qobject.h:445
QVariant property(const char *name) const
Definition: qobject.cpp:4118
void setObjectName(const QString &name)
Definition: qobject.cpp:1261
The QPaintEvent class contains event parameters for paint events. \inmodule QtGui.
Definition: qevent.h:539
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:82
void drawPoint(const QPointF &pt)
Definition: qpainter.h:580
void setPen(const QColor &color)
Definition: qpainter.cpp:3640
void drawLine(const QLineF &line)
Definition: qpainter.h:477
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Definition: qpainter.cpp:4883
void fillRect(const QRectF &, const QBrush &)
Definition: qpainter.cpp:6644
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:55
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Definition: qpalette.cpp:738
const QBrush & mid() const
Definition: qpalette.h:121
void setBrush(ColorRole cr, const QBrush &brush)
Definition: qpalette.h:184
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Definition: qpalette.h:179
const QBrush & base() const
Definition: qpalette.h:123
@ Window
Definition: qpalette.h:87
@ Base
Definition: qpalette.h:87
@ Text
Definition: qpalette.h:87
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:61
The QPixmap class is an off-screen image representation that can be used as a paint device.
Definition: qpixmap.h:63
int height() const
Definition: qpixmap.cpp:515
QSizeF deviceIndependentSize() const
Definition: qpixmap.cpp:659
QSize size() const
Definition: qpixmap.cpp:528
bool isNull() const
Definition: qpixmap.cpp:491
int width() const
Definition: qpixmap.cpp:503
The QPointer class is a template class that provides guarded pointers to QObject.
Definition: qpointer.h:54
The QPushButton widget provides a command button.
Definition: qpushbutton.h:56
void setAutoDefault(bool)
The QResizeEvent class contains event parameters for resize events. \inmodule QtGui.
Definition: qevent.h:612
The QShortcut class is used to create keyboard shortcuts.
Definition: qshortcut.h:55
constexpr QSize toSize() const noexcept
Definition: qsize.h:418
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:55
constexpr int height() const noexcept
Definition: qsize.h:160
constexpr int width() const noexcept
Definition: qsize.h:157
constexpr void setWidth(int w) noexcept
Definition: qsize.h:163
constexpr void setHeight(int h) noexcept
Definition: qsize.h:166
@ MinimumExpanding
Definition: qsizepolicy.h:70
The QSpacerItem class provides blank space in a layout.
Definition: qlayoutitem.h:93
void changeSize(int w, int h, QSizePolicy::Policy hData=QSizePolicy::Minimum, QSizePolicy::Policy vData=QSizePolicy::Minimum)
The QString class provides a Unicode character string.
Definition: qstring.h:388
bool isNull() const
Definition: qstring.h:1078
bool isEmpty() const
Definition: qstring.h:1216
static QString number(int, int base=10)
Definition: qstring.cpp:7538
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Definition: qstyle.h:65
@ SH_WizardStyle
Definition: qstyle.h:697
@ PM_LayoutBottomMargin
Definition: qstyle.h:549
@ PM_LayoutLeftMargin
Definition: qstyle.h:546
@ PM_LayoutVerticalSpacing
Definition: qstyle.h:551
@ PM_LayoutHorizontalSpacing
Definition: qstyle.h:550
@ PM_LayoutTopMargin
Definition: qstyle.h:547
@ PM_LayoutRightMargin
Definition: qstyle.h:548
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:75
The QVBoxLayout class lines up widgets vertically.
Definition: qboxlayout.h:127
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:95
bool isValid() const
Definition: qvariant.h:582
const void * constData() const
Definition: qvariant.h:350
QSize minimumSizeHint() const override
Definition: qwizard.cpp:453
void setSideWidget(QWidget *widget)
Definition: qwizard.cpp:459
QWatermarkLabel(QWidget *parent, QWidget *sideWidget)
Definition: qwizard.cpp:447
QWidget * sideWidget() const
Definition: qwizard.cpp:470
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:133
void setAutoFillBackground(bool enabled)
Definition: qwidget.cpp:361
QWidget * window() const
Definition: qwidget.cpp:4319
virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
Definition: qwidget.cpp:10035
Qt::LayoutDirection layoutDirection
the layout direction for this widget.
Definition: qwidget.h:204
void setBackgroundRole(QPalette::ColorRole)
Definition: qwidget.cpp:4397
void setContentsMargins(int left, int top, int right, int bottom)
Definition: qwidget.cpp:7545
void setParent(QWidget *parent)
Definition: qwidget.cpp:10512
void setMinimumSize(const QSize &)
Definition: qwidget.h:865
void updateGeometry()
Definition: qwidget.cpp:10386
void setSizePolicy(QSizePolicy)
void setStyle(QStyle *)
Definition: qwidget.cpp:2642
QWidget * nextInFocusChain() const
Definition: qwidget.cpp:6820
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:147
static void setTabOrder(QWidget *, QWidget *)
Definition: qwidget.cpp:6930
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition: qwidget.h:140
QLayout * layout() const
Definition: qwidget.cpp:10115
void setPalette(const QPalette &)
Definition: qwidget.cpp:4536
QPalette palette
the widget's palette
Definition: qwidget.h:166
int width
the width of the widget excluding any window frame
Definition: qwidget.h:148
void move(int x, int y)
Definition: qwidget.h:913
QSize minimumSizeHint
the recommended minimum size for the widget
Definition: qwidget.h:183
void hide()
Definition: qwidget.cpp:8078
void setMinimumHeight(int minh)
Definition: qwidget.cpp:4127
int height
the height of the widget excluding any window frame
Definition: qwidget.h:149
void setFocus()
Definition: qwidget.h:454
void show()
Definition: qwidget.cpp:7825
virtual void setVisible(bool visible)
Definition: qwidget.cpp:8198
void setMaximumSize(const QSize &)
Definition: qwidget.h:868
bool isEnabled() const
Definition: qwidget.h:847
void setFixedHeight(int h)
Definition: qwidget.cpp:4181
friend class QPixmap
Definition: qwidget.h:778
bool event(QEvent *event) override
Definition: qwidget.cpp:8772
QStyle * style() const
Definition: qwidget.cpp:2612
int maximumWidth
the widget's maximum width in pixels
Definition: qwidget.h:161
void setFont(const QFont &)
Definition: qwidget.cpp:4673
QFont font
the font currently set for the widget
Definition: qwidget.h:167
Qt::FocusPolicy focusPolicy
the way the widget accepts keyboard focus
Definition: qwidget.h:174
QWidget * parentWidget() const
Definition: qwidget.h:937
bool isAncestorOf(const QWidget *child) const
Definition: qwidget.cpp:8728
bool isActiveWindow
whether this widget's window is the active window
Definition: qwidget.h:173
void setFixedSize(const QSize &)
virtual void paintEvent(QPaintEvent *event)
Definition: qwidget.cpp:9684
bool visible
whether the widget is visible
Definition: qwidget.h:178
QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *)
Definition: qwizard.cpp:534
QByteArray className
Definition: qwizard.cpp:173
QWizardDefaultProperty(const char *className, const char *property, const char *changedSignal)
Definition: qwizard.cpp:178
QByteArray changedSignal
Definition: qwizard.cpp:175
QString name
Definition: qwizard.cpp:195
void resolve(const QList< QWizardDefaultProperty > &defaultPropertyTable)
Definition: qwizard.cpp:215
void findProperty(const QWizardDefaultProperty *properties, int propertyCount)
Definition: qwizard.cpp:222
QWizardPage * page
Definition: qwizard.cpp:194
QObject * object
Definition: qwizard.cpp:197
QByteArray property
Definition: qwizard.cpp:198
QByteArray changedSignal
Definition: qwizard.cpp:199
QVariant initialValue
Definition: qwizard.cpp:200
bool mandatory
Definition: qwizard.cpp:196
void paintEvent(QPaintEvent *event) override
Definition: qwizard.cpp:421
QWizardHeader(RulerType, QWidget *parent=nullptr)
Definition: qwizard.cpp:288
void setup(const QWizardLayoutInfo &info, const QString &title, const QString &subTitle, const QPixmap &logo, const QPixmap &banner, Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat)
Definition: qwizard.cpp:360
The QWizard class provides a framework for wizards.
Definition: qwizard.h:55
WizardOptions options
the various options that affect the look and feel of the wizard
Definition: qwizard.h:58
void resizeEvent(QResizeEvent *event) override
Definition: qwizard.cpp:3202
void setWizardStyle(WizardStyle style)
Definition: qwizard.cpp:2543
void paintEvent(QPaintEvent *event) override
Definition: qwizard.cpp:3224
void setPage(int id, QWizardPage *page)
Definition: qwizard.cpp:2243
int currentId
the ID of the current page
Definition: qwizard.h:62
QAbstractButton * button(WizardButton which) const
Definition: qwizard.cpp:2806
QWidget * sideWidget() const
Definition: qwizard.cpp:2979
virtual int nextId() const
Definition: qwizard.cpp:3377
void setButtonText(WizardButton which, const QString &text)
Definition: qwizard.cpp:2679
void setSubTitleFormat(Qt::TextFormat format)
Definition: qwizard.cpp:2847
QList< int > pageIds() const
Definition: qwizard.cpp:2413
QVariant field(const QString &name) const
Definition: qwizard.cpp:2517
void setStartId(int id)
Definition: qwizard.cpp:2429
WizardOption
Definition: qwizard.h:99
@ NoCancelButtonOnLastPage
Definition: qwizard.h:116
@ DisabledBackButtonOnLastPage
Definition: qwizard.h:106
@ NoDefaultButton
Definition: qwizard.h:103
@ CancelButtonOnLeft
Definition: qwizard.h:110
@ IndependentPages
Definition: qwizard.h:100
@ NoBackButtonOnLastPage
Definition: qwizard.h:105
@ HelpButtonOnRight
Definition: qwizard.h:112
@ HaveCustomButton1
Definition: qwizard.h:113
@ HaveCustomButton2
Definition: qwizard.h:114
@ HaveFinishButtonOnEarlyPages
Definition: qwizard.h:108
@ IgnoreSubTitles
Definition: qwizard.h:101
@ HaveCustomButton3
Definition: qwizard.h:115
@ NoCancelButton
Definition: qwizard.h:109
@ NoBackButtonOnStartPage
Definition: qwizard.h:104
@ ExtendedWatermarkPixmap
Definition: qwizard.h:102
@ HaveNextButtonOnLastPage
Definition: qwizard.h:107
@ HaveHelpButton
Definition: qwizard.h:111
void setButtonLayout(const QList< WizardButton > &layout)
Definition: qwizard.cpp:2739
Qt::TextFormat subTitleFormat
the text format used by page subtitles
Definition: qwizard.h:60
virtual void initializePage(int id)
Definition: qwizard.cpp:3313
QWizardPage * page(int id) const
Definition: qwizard.cpp:2373
QSize sizeHint() const override
Definition: qwizard.cpp:3002
void setOptions(WizardOptions options)
Definition: qwizard.cpp:2628
void next()
Definition: qwizard.cpp:3121
void pageAdded(int id)
void setOption(WizardOption option, bool on=true)
Definition: qwizard.cpp:2595
WizardPixmap
Definition: qwizard.h:82
@ BackgroundPixmap
Definition: qwizard.h:86
@ BannerPixmap
Definition: qwizard.h:85
@ WatermarkPixmap
Definition: qwizard.h:83
@ NPixmaps
Definition: qwizard.h:87
@ LogoPixmap
Definition: qwizard.h:84
WizardStyle wizardStyle
the look and feel of the wizard
Definition: qwizard.h:57
virtual bool validateCurrentPage()
Definition: qwizard.cpp:3354
WizardStyle
Definition: qwizard.h:90
@ AeroStyle
Definition: qwizard.h:94
@ ModernStyle
Definition: qwizard.h:92
@ ClassicStyle
Definition: qwizard.h:91
@ MacStyle
Definition: qwizard.h:93
void pageRemoved(int id)
QWizardPage * currentPage() const
Definition: qwizard.cpp:2463
bool hasVisitedPage(int id) const
Definition: qwizard.cpp:2389
~QWizard()
Definition: qwizard.cpp:2209
void setPixmap(WizardPixmap which, const QPixmap &pixmap)
Definition: qwizard.cpp:2872
void setSideWidget(QWidget *widget)
Definition: qwizard.cpp:2961
void done(int result) override
Definition: qwizard.cpp:3282
void setDefaultProperty(const char *className, const char *property, const char *changedSignal)
Definition: qwizard.cpp:2924
virtual void cleanupPage(int id)
Definition: qwizard.cpp:3331
QWizard(QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Definition: qwizard.cpp:2199
int addPage(QWizardPage *page)
Definition: qwizard.cpp:2223
bool testOption(WizardOption option) const
Definition: qwizard.cpp:2608
QString buttonText(WizardButton which) const
Definition: qwizard.cpp:2704
Qt::TextFormat titleFormat
the text format used by page titles
Definition: qwizard.h:59
void setField(const QString &name, const QVariant &value)
Definition: qwizard.cpp:2494
QList< int > visitedIds() const
Definition: qwizard.cpp:2403
void setVisible(bool visible) override
Definition: qwizard.cpp:2989
void back()
Definition: qwizard.cpp:3105
void setButton(WizardButton which, QAbstractButton *button)
Definition: qwizard.cpp:2776
void removePage(int id)
Definition: qwizard.cpp:2299
QPixmap pixmap(WizardPixmap which) const
Definition: qwizard.cpp:2888
WizardButton
Definition: qwizard.h:65
@ NButtons
Definition: qwizard.h:79
@ CommitButton
Definition: qwizard.h:68
@ BackButton
Definition: qwizard.h:66
@ NoButton
Definition: qwizard.h:77
@ HelpButton
Definition: qwizard.h:71
@ FinishButton
Definition: qwizard.h:69
@ Stretch
Definition: qwizard.h:75
@ CustomButton3
Definition: qwizard.h:74
@ NextButton
Definition: qwizard.h:67
@ NStandardButtons
Definition: qwizard.h:78
@ CustomButton1
Definition: qwizard.h:72
@ CancelButton
Definition: qwizard.h:70
@ CustomButton2
Definition: qwizard.h:73
void setTitleFormat(Qt::TextFormat format)
Definition: qwizard.cpp:2826
bool event(QEvent *event) override
Definition: qwizard.cpp:3162
void restart()
Definition: qwizard.cpp:3150
int startId
the ID of the first page
Definition: qwizard.h:61
QWizard::WizardStyle wizStyle
Definition: qwizard.cpp:249
bool operator!=(const QWizardLayoutInfo &other) const
Definition: qwizard.cpp:258
bool operator==(const QWizardLayoutInfo &other) const
Definition: qwizard.cpp:261
int topLevelMarginBottom
Definition: qwizard.cpp:241
The QWizardPage class is the base class for wizard pages.
Definition: qwizard.h:212
QString title
the title of the page
Definition: qwizard.h:214
void setFinalPage(bool finalPage)
Definition: qwizard.cpp:3707
QVariant field(const QString &name) const
Definition: qwizard.cpp:3902
void setButtonText(QWizard::WizardButton which, const QString &text)
Definition: qwizard.cpp:3785
bool isCommitPage() const
Definition: qwizard.cpp:3771
virtual void initializePage()
Definition: qwizard.cpp:3600
void registerField(const QString &name, QWidget *widget, const char *property=nullptr, const char *changedSignal=nullptr)
Definition: qwizard.cpp:3956
virtual void cleanupPage()
Definition: qwizard.cpp:3615
void setTitle(const QString &title)
Definition: qwizard.cpp:3490
void setField(const QString &name, const QVariant &value)
Definition: qwizard.cpp:3881
virtual bool validatePage()
Definition: qwizard.cpp:3641
QWizard * wizard() const
Definition: qwizard.cpp:3974
virtual int nextId() const
Definition: qwizard.cpp:3835
void setSubTitle(const QString &subTitle)
Definition: qwizard.cpp:3523
bool isFinalPage() const
Definition: qwizard.cpp:3728
virtual bool isComplete() const
Definition: qwizard.cpp:3663
QString buttonText(QWizard::WizardButton which) const
Definition: qwizard.cpp:3806
QWizardPage(QWidget *parent=nullptr)
Definition: qwizard.cpp:3463
QPixmap pixmap(QWizard::WizardPixmap which) const
Definition: qwizard.cpp:3568
void setPixmap(QWizard::WizardPixmap which, const QPixmap &pixmap)
Definition: qwizard.cpp:3550
QString subTitle
the subtitle of the page
Definition: qwizard.h:215
void setCommitPage(bool commitPage)
Definition: qwizard.cpp:3757
TriState completeState
Definition: qwizard.cpp:494
QPixmap pixmaps[QWizard::NPixmaps]
Definition: qwizard.cpp:492
QWizard * wizard
Definition: qwizard.cpp:489
void _q_maybeEmitCompleteChanged()
Definition: qwizard.cpp:509
QList< QWizardField > pendingFields
Definition: qwizard.cpp:493
QMap< int, QString > buttonCustomTexts
Definition: qwizard.cpp:498
void _q_updateCachedCompleteState()
Definition: qwizard.cpp:517
bool cachedIsComplete() const
Definition: qwizard.cpp:501
QWizardAntiFlickerWidget * antiFlickerWidget
Definition: qwizard.cpp:621
void setStyle(QStyle *style)
Definition: qwizard.cpp:1751
PageMap pageMap
Definition: qwizard.cpp:587
bool canContinue
Definition: qwizard.cpp:595
QAbstractButton * commit
Definition: qwizard.cpp:614
bool buttonLayoutContains(QWizard::WizardButton which)
Definition: qwizard.cpp:1533
QWizard::WizardOptions opts
Definition: qwizard.cpp:601
void updateCurrentPage()
Definition: qwizard.cpp:1350
QList< QWizardField > fields
Definition: qwizard.cpp:588
QLabel * subTitleLabel
Definition: qwizard.cpp:629
void _q_updateButtonStates()
Definition: qwizard.cpp:1673
QAbstractButton * cancel
Definition: qwizard.cpp:616
QWizardHeader * headerWidget
Definition: qwizard.cpp:624
QWizardLayoutInfo layoutInfoForCurrentPage()
Definition: qwizard.cpp:894
bool startSetByUser
Definition: qwizard.cpp:593
QWidget * sideWidget
Definition: qwizard.cpp:626
QMap< QString, int > fieldIndexMap
Definition: qwizard.cpp:589
void connectButton(QWizard::WizardButton which) const
Definition: qwizard.cpp:1420
QFrame * pageFrame
Definition: qwizard.cpp:627
void removeFieldAt(int index)
Definition: qwizard.cpp:779
QAbstractButton * next
Definition: qwizard.cpp:613
QAbstractButton * help
Definition: qwizard.cpp:617
QAbstractButton * back
Definition: qwizard.cpp:612
QWatermarkLabel * watermarkLabel
Definition: qwizard.cpp:625
QHBoxLayout * buttonLayout
Definition: qwizard.cpp:633
void recreateLayout(const QWizardLayoutInfo &info)
Definition: qwizard.cpp:955
QList< QWizard::WizardButton > buttonsCustomLayout
Definition: qwizard.cpp:604
QAbstractButton * finish
Definition: qwizard.cpp:615
void updateLayout()
Definition: qwizard.cpp:1229
QList< QWizardDefaultProperty > defaultPropertyTable
Definition: qwizard.cpp:590
void updateMinMaxSizes(const QWizardLayoutInfo &info)
Definition: qwizard.cpp:1314
QGridLayout * mainLayout
Definition: qwizard.cpp:634
void _q_emitCustomButtonClicked()
Definition: qwizard.cpp:1661
void setButtonLayout(const QWizard::WizardButton *array, int size)
Definition: qwizard.cpp:1500
void reset()
Definition: qwizard.cpp:726
QList< int > history
Definition: qwizard.cpp:591
bool isVistaThemeEnabled() const
Definition: qwizard.cpp:1633
QPixmap defaultPixmaps[QWizard::NPixmaps]
Definition: qwizard.cpp:607
QMap< int, QWizardPage * > PageMap
Definition: qwizard.cpp:545
void updatePixmap(QWizard::WizardPixmap which)
Definition: qwizard.cpp:1538
void _q_handleFieldObjectDestroyed(QObject *)
Definition: qwizard.cpp:1724
void switchToPage(int newId, Direction direction)
Definition: qwizard.cpp:794
void enableUpdates()
Definition: qwizard.cpp:1652
int disableUpdatesCount
Definition: qwizard.cpp:598
Qt::TextFormat subTitleFmt
Definition: qwizard.cpp:606
void updateButtonTexts()
Definition: qwizard.cpp:1430
void updateButtonLayout()
Definition: qwizard.cpp:1459
QVBoxLayout * pageVBoxLayout
Definition: qwizard.cpp:632
QLabel * titleLabel
Definition: qwizard.cpp:628
bool ensureButton(QWizard::WizardButton which) const
Definition: qwizard.cpp:1391
QWizard::WizardStyle wizStyle
Definition: qwizard.cpp:600
void updatePalette()
Definition: qwizard.cpp:1290
QWidget * placeholderWidget1
Definition: qwizard.cpp:622
QWizardRuler * bottomRuler
Definition: qwizard.cpp:630
QWidget * placeholderWidget2
Definition: qwizard.cpp:623
bool buttonsHaveCustomLayout
Definition: qwizard.cpp:603
void cleanupPagesNotInHistory()
Definition: qwizard.cpp:743
QAbstractButton * btns[QWizard::NButtons]
Definition: qwizard.cpp:619
Qt::TextFormat titleFmt
Definition: qwizard.cpp:605
void disableUpdates()
Definition: qwizard.cpp:1643
struct QWizardPrivate::@813::@815 btn
QMap< int, QString > buttonCustomTexts
Definition: qwizard.cpp:602
void addField(const QWizardField &field)
Definition: qwizard.cpp:757
QWizardLayoutInfo layoutInfo
Definition: qwizard.cpp:597
QWizardRuler(QWidget *parent=nullptr)
Definition: qwizard.cpp:440
QPushButton
[1]
QOpenGLWidget * widget
[1]
QString text
[meta data]
QPushButton * button
[2]
void textChanged(const QString &newText)
box animateClick()
QPixmap pix
direction
else opt state
[0]
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
backing_store_ptr info
[4]
Definition: jmemsys.h:161
short next
Definition: keywords.cpp:454
typename C::const_iterator const_iterator
@ AlignTop
Definition: qnamespace.h:178
@ AlignLeft
Definition: qnamespace.h:169
@ ALT
Definition: qnamespace.h:1097
TextFormat
Definition: qnamespace.h:1204
@ AutoText
Definition: qnamespace.h:1207
@ RightToLeft
Definition: qnamespace.h:1464
@ TabFocus
Definition: qnamespace.h:133
@ Horizontal
Definition: qnamespace.h:124
@ Vertical
Definition: qnamespace.h:125
@ ReturnByValue
Definition: qnamespace.h:1733
@ Key_Right
Definition: qnamespace.h:700
Definition: brush.cpp:52
#define QString()
Definition: parse-defines.h:51
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
#define Q_UNLIKELY(x)
#define Q_UNREACHABLE()
EGLOutputLayerEXT EGLint EGLAttrib value
unsigned int uint
Definition: qglobal.h:334
#define QT_CONFIG(feature)
Definition: qglobal.h:107
ptrdiff_t qintptr
Definition: qglobal.h:309
@ text
#define qWarning
Definition: qlogging.h:179
#define SLOT(a)
Definition: qobjectdefs.h:87
#define SIGNAL(a)
Definition: qobjectdefs.h:88
#define Q_RETURN_ARG(type, data)
Definition: qobjectdefs.h:99
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: qopengl.h:270
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLuint64 key
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLuint GLuint end
GLint GLint GLint GLint GLsizei GLsizei GLsizei GLboolean commit
GLuint object
[3]
GLint GLsizei width
GLuint color
[2]
GLbitfield flags
GLuint start
GLuint name
GLfloat n
GLint GLsizei GLsizei GLenum format
GLint y
struct _cl_event * event
Definition: qopenglext.h:2998
GLenum array
Definition: qopenglext.h:7028
GLdouble GLdouble GLdouble GLdouble q
Definition: qopenglext.h:259
GLenum GLenum GLsizei void * row
Definition: qopenglext.h:2747
GLuint64EXT * result
[6]
Definition: qopenglext.h:10932
GLuint GLenum option
Definition: qopenglext.h:5929
#define Q_ASSERT(cond)
Definition: qrandom.cpp:84
#define tr(X)
#define emit
Definition: qtmetamacros.h:85
@ Q_RELOCATABLE_TYPE
Definition: qtypeinfo.h:156
#define QWIDGETSIZE_MAX
Definition: qwidget.h:951
struct tagMSG MSG
Q_DECLARE_TYPEINFO(QWizardDefaultProperty, Q_RELOCATABLE_TYPE)
const int ModernHeaderTopMargin
Definition: qwizard.cpp:86
const int MacLayoutLeftMargin
Definition: qwizard.cpp:89
QT_BEGIN_NAMESPACE const int GapBetweenLogoAndRightEdge
Definition: qwizard.cpp:85
const int MacLayoutBottomMargin
Definition: qwizard.cpp:92
const int MacLayoutRightMargin
Definition: qwizard.cpp:91
const char property[13]
Definition: qwizard.cpp:136
const size_t NFallbackDefaultProperties
Definition: qwizard.cpp:147
const int ClassicHMargin
Definition: qwizard.cpp:87
const int MacButtonTopMargin
Definition: qwizard.cpp:88
const char className[16]
[1]
Definition: qwizard.cpp:135
const struct @812 fallbackProperties[]
Q_UNUSED(salary)
[21]
#define ArraySize(X)
Definition: sqlite3.c:14194
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QPushButton * pushButton
obj metaObject() -> className()
QVBoxLayout * layout
QLineEdit * lineEdit
QString title
[35]
QByteArray page
[45]
ba fill(true)
QSharedPointer< T > other(t)
[5]
QGraphicsItem * item
QApplication app(argc, argv)
[0]
widget render & pixmap
QPainter painter(this)
[7]
QSpinBox * spinBox
[0]
QAction * at
QStringList::Iterator it
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:53
bool contains(const AT &t) const noexcept
Definition: qlist.h:78
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:165
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
Direction
Definition: main.cpp:217