| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/dialogs/qwizard.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | const int GapBetweenLogoAndRightEdge = 5; | - | ||||||||||||||||||||||||
| 8 | const int ModernHeaderTopMargin = 2; | - | ||||||||||||||||||||||||
| 9 | const int ClassicHMargin = 4; | - | ||||||||||||||||||||||||
| 10 | const int MacButtonTopMargin = 13; | - | ||||||||||||||||||||||||
| 11 | const int MacLayoutLeftMargin = 20; | - | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | const int MacLayoutRightMargin = 20; | - | ||||||||||||||||||||||||
| 14 | const int MacLayoutBottomMargin = 17; | - | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | static void changeSpacerSize(QLayout *layout, int index, int width, int height) | - | ||||||||||||||||||||||||
| 17 | { | - | ||||||||||||||||||||||||
| 18 | QSpacerItem *spacer = layout->itemAt(index)->spacerItem(); | - | ||||||||||||||||||||||||
| 19 | if (!spacer
| 0 | ||||||||||||||||||||||||
| 20 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 21 | spacer->changeSize(width, height); | - | ||||||||||||||||||||||||
| 22 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | static QWidget *iWantTheFocus(QWidget *ancestor) | - | ||||||||||||||||||||||||
| 25 | { | - | ||||||||||||||||||||||||
| 26 | const int MaxIterations = 100; | - | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | QWidget *candidate = ancestor; | - | ||||||||||||||||||||||||
| 29 | for (int i = 0; i < MaxIterations
| 0 | ||||||||||||||||||||||||
| 30 | candidate = candidate->nextInFocusChain(); | - | ||||||||||||||||||||||||
| 31 | if (!candidate
| 0 | ||||||||||||||||||||||||
| 32 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||
| 34 | if (candidate->focusPolicy() & Qt::TabFocus
| 0 | ||||||||||||||||||||||||
| 35 | if (candidate != ancestor
| 0 | ||||||||||||||||||||||||
| 36 | return never executed: candidate;return candidate;never executed: return candidate; | 0 | ||||||||||||||||||||||||
| 37 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 38 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 39 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 40 | } | - | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX, | - | ||||||||||||||||||||||||
| 43 | const QByteArray &classY) | - | ||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||
| 45 | const QMetaObject *metaObject = object->metaObject(); | - | ||||||||||||||||||||||||
| 46 | while (metaObject
| 0 | ||||||||||||||||||||||||
| 47 | if (metaObject->className() == classX
| 0 | ||||||||||||||||||||||||
| 48 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 49 | if (metaObject->className() == classY
| 0 | ||||||||||||||||||||||||
| 50 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 51 | metaObject = metaObject->superClass(); | - | ||||||||||||||||||||||||
| 52 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 53 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 54 | } | - | ||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | const struct { | - | ||||||||||||||||||||||||
| 57 | const char className[16]; | - | ||||||||||||||||||||||||
| 58 | const char property[13]; | - | ||||||||||||||||||||||||
| 59 | } fallbackProperties[] = { | - | ||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | { "QAbstractButton", "checked" }, | - | ||||||||||||||||||||||||
| 62 | { "QAbstractSlider", "value" }, | - | ||||||||||||||||||||||||
| 63 | { "QComboBox", "currentIndex" }, | - | ||||||||||||||||||||||||
| 64 | { "QDateTimeEdit", "dateTime" }, | - | ||||||||||||||||||||||||
| 65 | { "QLineEdit", "text" }, | - | ||||||||||||||||||||||||
| 66 | { "QListWidget", "currentRow" }, | - | ||||||||||||||||||||||||
| 67 | { "QSpinBox", "value" }, | - | ||||||||||||||||||||||||
| 68 | }; | - | ||||||||||||||||||||||||
| 69 | const size_t NFallbackDefaultProperties = sizeof fallbackProperties / sizeof *fallbackProperties; | - | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | static const char *changed_signal(int which) | - | ||||||||||||||||||||||||
| 72 | { | - | ||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | switch (which) { | - | ||||||||||||||||||||||||
| 79 | case never executed: 0:case 0:never executed: returncase 0:never executed: qFlagLocation("2""toggled(bool)" "\0" __FILE__ ":" "148");return qFlagLocation("2""toggled(bool)" "\0" __FILE__ ":" "148");never executed: return qFlagLocation("2""toggled(bool)" "\0" __FILE__ ":" "148"); | 0 | ||||||||||||||||||||||||
| 80 | case never executed: 1:case 1:never executed: returncase 1:never executed: qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "149");return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "149");never executed: return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "149"); | 0 | ||||||||||||||||||||||||
| 81 | case never executed: 2:case 2:never executed: returncase 2:never executed: qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "150");return qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "150");never executed: return qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "150"); | 0 | ||||||||||||||||||||||||
| 82 | case never executed: 3:case 3:never executed: returncase 3:never executed: qFlagLocation("2""dateTimeChanged(QDateTime)" "\0" __FILE__ ":" "151");return qFlagLocation("2""dateTimeChanged(QDateTime)" "\0" __FILE__ ":" "151");never executed: return qFlagLocation("2""dateTimeChanged(QDateTime)" "\0" __FILE__ ":" "151"); | 0 | ||||||||||||||||||||||||
| 83 | case never executed: 4:case 4:never executed: returncase 4:never executed: qFlagLocation("2""textChanged(QString)" "\0" __FILE__ ":" "152");return qFlagLocation("2""textChanged(QString)" "\0" __FILE__ ":" "152");never executed: return qFlagLocation("2""textChanged(QString)" "\0" __FILE__ ":" "152"); | 0 | ||||||||||||||||||||||||
| 84 | case never executed: 5:case 5:never executed: returncase 5:never executed: qFlagLocation("2""currentRowChanged(int)" "\0" __FILE__ ":" "153");return qFlagLocation("2""currentRowChanged(int)" "\0" __FILE__ ":" "153");never executed: return qFlagLocation("2""currentRowChanged(int)" "\0" __FILE__ ":" "153"); | 0 | ||||||||||||||||||||||||
| 85 | case never executed: 6:case 6:never executed: returncase 6:never executed: qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "154");return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "154");never executed: return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "154"); | 0 | ||||||||||||||||||||||||
| 86 | }; | - | ||||||||||||||||||||||||
| 87 | static_assert(bool(7 == NFallbackDefaultProperties), "7 == NFallbackDefaultProperties"); | - | ||||||||||||||||||||||||
| 88 | do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,157) : qt_noop()); __builtin_unreachable(); } while (0); | - | ||||||||||||||||||||||||
| 89 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 90 | } | - | ||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | class QWizardDefaultProperty | - | ||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||
| 94 | public: | - | ||||||||||||||||||||||||
| 95 | QByteArray className; | - | ||||||||||||||||||||||||
| 96 | QByteArray property; | - | ||||||||||||||||||||||||
| 97 | QByteArray changedSignal; | - | ||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | inline QWizardDefaultProperty() {} | - | ||||||||||||||||||||||||
| 100 | inline QWizardDefaultProperty(const char *className, const char *property, | - | ||||||||||||||||||||||||
| 101 | const char *changedSignal) | - | ||||||||||||||||||||||||
| 102 | : className(className), property(property), changedSignal(changedSignal) {} never executed: end of block | 0 | ||||||||||||||||||||||||
| 103 | }; | - | ||||||||||||||||||||||||
| 104 | template<> class QTypeInfo<QWizardDefaultProperty > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_MOVABLE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QWizardDefaultProperty)>sizeof(void*)), isPointer = false, isIntegral = QtPrivate::is_integral< QWizardDefaultProperty >::value, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QWizardDefaultProperty) }; static inline const char *name() { return "QWizardDefaultProperty"; } }; | - | ||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | class QWizardField | - | ||||||||||||||||||||||||
| 107 | { | - | ||||||||||||||||||||||||
| 108 | public: | - | ||||||||||||||||||||||||
| 109 | inline QWizardField() {} | - | ||||||||||||||||||||||||
| 110 | QWizardField(QWizardPage *page, const QString &spec, QObject *object, const char *property, | - | ||||||||||||||||||||||||
| 111 | const char *changedSignal); | - | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | void resolve(const QVector<QWizardDefaultProperty> &defaultPropertyTable); | - | ||||||||||||||||||||||||
| 114 | void findProperty(const QWizardDefaultProperty *properties, int propertyCount); | - | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | QWizardPage *page; | - | ||||||||||||||||||||||||
| 117 | QString name; | - | ||||||||||||||||||||||||
| 118 | bool mandatory; | - | ||||||||||||||||||||||||
| 119 | QObject *object; | - | ||||||||||||||||||||||||
| 120 | QByteArray property; | - | ||||||||||||||||||||||||
| 121 | QByteArray changedSignal; | - | ||||||||||||||||||||||||
| 122 | QVariant initialValue; | - | ||||||||||||||||||||||||
| 123 | }; | - | ||||||||||||||||||||||||
| 124 | template<> class QTypeInfo<QWizardField > { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_MOVABLE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QWizardField)>sizeof(void*)), isPointer = false, isIntegral = QtPrivate::is_integral< QWizardField >::value, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QWizardField) }; static inline const char *name() { return "QWizardField"; } }; | - | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | QWizardField::QWizardField(QWizardPage *page, const QString &spec, QObject *object, | - | ||||||||||||||||||||||||
| 127 | const char *property, const char *changedSignal) | - | ||||||||||||||||||||||||
| 128 | : page(page), name(spec), mandatory(false), object(object), property(property), | - | ||||||||||||||||||||||||
| 129 | changedSignal(changedSignal) | - | ||||||||||||||||||||||||
| 130 | { | - | ||||||||||||||||||||||||
| 131 | if (name.endsWith(QLatin1Char('*'))
| 0 | ||||||||||||||||||||||||
| 132 | name.chop(1); | - | ||||||||||||||||||||||||
| 133 | mandatory = true; | - | ||||||||||||||||||||||||
| 134 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 135 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||
| 137 | void QWizardField::resolve(const QVector<QWizardDefaultProperty> &defaultPropertyTable) | - | ||||||||||||||||||||||||
| 138 | { | - | ||||||||||||||||||||||||
| 139 | if (property.isEmpty()
| 0 | ||||||||||||||||||||||||
| 140 | findProperty(defaultPropertyTable.constData(), defaultPropertyTable.count()); never executed: findProperty(defaultPropertyTable.constData(), defaultPropertyTable.count()); | 0 | ||||||||||||||||||||||||
| 141 | initialValue = object->property(property); | - | ||||||||||||||||||||||||
| 142 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||
| 144 | void QWizardField::findProperty(const QWizardDefaultProperty *properties, int propertyCount) | - | ||||||||||||||||||||||||
| 145 | { | - | ||||||||||||||||||||||||
| 146 | QByteArray className; | - | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | for (int i = 0; i < propertyCount
| 0 | ||||||||||||||||||||||||
| 149 | if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)
| 0 | ||||||||||||||||||||||||
| 150 | className = properties[i].className; | - | ||||||||||||||||||||||||
| 151 | property = properties[i].property; | - | ||||||||||||||||||||||||
| 152 | changedSignal = properties[i].changedSignal; | - | ||||||||||||||||||||||||
| 153 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 154 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 155 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | class QWizardLayoutInfo | - | ||||||||||||||||||||||||
| 158 | { | - | ||||||||||||||||||||||||
| 159 | public: | - | ||||||||||||||||||||||||
| 160 | inline QWizardLayoutInfo() | - | ||||||||||||||||||||||||
| 161 | : topLevelMarginLeft(-1), topLevelMarginRight(-1), topLevelMarginTop(-1), | - | ||||||||||||||||||||||||
| 162 | topLevelMarginBottom(-1), childMarginLeft(-1), childMarginRight(-1), | - | ||||||||||||||||||||||||
| 163 | childMarginTop(-1), childMarginBottom(-1), hspacing(-1), vspacing(-1), | - | ||||||||||||||||||||||||
| 164 | wizStyle(QWizard::ClassicStyle), header(false), watermark(false), title(false), | - | ||||||||||||||||||||||||
| 165 | subTitle(false), extension(false), sideWidget(false) {} never executed: end of block | 0 | ||||||||||||||||||||||||
| 166 | - | |||||||||||||||||||||||||
| 167 | int topLevelMarginLeft; | - | ||||||||||||||||||||||||
| 168 | int topLevelMarginRight; | - | ||||||||||||||||||||||||
| 169 | int topLevelMarginTop; | - | ||||||||||||||||||||||||
| 170 | int topLevelMarginBottom; | - | ||||||||||||||||||||||||
| 171 | int childMarginLeft; | - | ||||||||||||||||||||||||
| 172 | int childMarginRight; | - | ||||||||||||||||||||||||
| 173 | int childMarginTop; | - | ||||||||||||||||||||||||
| 174 | int childMarginBottom; | - | ||||||||||||||||||||||||
| 175 | int hspacing; | - | ||||||||||||||||||||||||
| 176 | int vspacing; | - | ||||||||||||||||||||||||
| 177 | int buttonSpacing; | - | ||||||||||||||||||||||||
| 178 | QWizard::WizardStyle wizStyle; | - | ||||||||||||||||||||||||
| 179 | bool header; | - | ||||||||||||||||||||||||
| 180 | bool watermark; | - | ||||||||||||||||||||||||
| 181 | bool title; | - | ||||||||||||||||||||||||
| 182 | bool subTitle; | - | ||||||||||||||||||||||||
| 183 | bool extension; | - | ||||||||||||||||||||||||
| 184 | bool sideWidget; | - | ||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||
| 186 | bool operator==(const QWizardLayoutInfo &other); | - | ||||||||||||||||||||||||
| 187 | inline bool operator!=(const QWizardLayoutInfo &other) { return never executed: !operator==(other);return !operator==(other);never executed: }return !operator==(other); | 0 | ||||||||||||||||||||||||
| 188 | }; | - | ||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | bool QWizardLayoutInfo::operator==(const QWizardLayoutInfo &other) | - | ||||||||||||||||||||||||
| 191 | { | - | ||||||||||||||||||||||||
| 192 | return never executed: topLevelMarginLeft == other.topLevelMarginLeftreturn topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget;
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 193 | && topLevelMarginRight == other.topLevelMarginRight
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 194 | && topLevelMarginTop == other.topLevelMarginTop
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 195 | && topLevelMarginBottom == other.topLevelMarginBottom
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 196 | && childMarginLeft == other.childMarginLeft
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 197 | && childMarginRight == other.childMarginRight
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 198 | && childMarginTop == other.childMarginTop
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 199 | && childMarginBottom == other.childMarginBottom
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 200 | && hspacing == other.hspacing
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 201 | && vspacing == other.vspacing
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 202 | && buttonSpacing == other.buttonSpacing
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 203 | && wizStyle == other.wizStyle
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 204 | && header == other.header
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 205 | && watermark == other.watermark
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 206 | && title == other.title
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 207 | && subTitle == other.subTitle
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 208 | && extension == other.extension
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 209 | && sideWidget == other.sideWidget
never executed: return topLevelMarginLeft == other.topLevelMarginLeft && topLevelMarginRight == other.topLevelMarginRight && topLevelMarginTop == other.topLevelMarginTop && topLevelMarginBottom == other.topLevelMarginBottom && childMarginLeft == other.childMarginLeft && ...pacing && buttonSpacing == other.buttonSpacing && wizStyle == other.wizStyle && header == other.header && watermark == other.watermark && title == other.title && subTitle == other.subTitle && extension == other.extension && sideWidget == other.sideWidget; | 0 | ||||||||||||||||||||||||
| 210 | } | - | ||||||||||||||||||||||||
| 211 | - | |||||||||||||||||||||||||
| 212 | class QWizardHeader : public QWidget | - | ||||||||||||||||||||||||
| 213 | { | - | ||||||||||||||||||||||||
| 214 | public: | - | ||||||||||||||||||||||||
| 215 | enum RulerType { Ruler }; | - | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | inline QWizardHeader(RulerType , QWidget *parent = 0) | - | ||||||||||||||||||||||||
| 218 | : QWidget(parent) { setFixedHeight(2); } never executed: end of block | 0 | ||||||||||||||||||||||||
| 219 | QWizardHeader(QWidget *parent = 0); | - | ||||||||||||||||||||||||
| 220 | - | |||||||||||||||||||||||||
| 221 | void setup(const QWizardLayoutInfo &info, const QString &title, | - | ||||||||||||||||||||||||
| 222 | const QString &subTitle, const QPixmap &logo, const QPixmap &banner, | - | ||||||||||||||||||||||||
| 223 | Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat); | - | ||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||
| 225 | protected: | - | ||||||||||||||||||||||||
| 226 | void paintEvent(QPaintEvent *event) override; | - | ||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | - | |||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | private: | - | ||||||||||||||||||||||||
| 232 | QLabel *titleLabel; | - | ||||||||||||||||||||||||
| 233 | QLabel *subTitleLabel; | - | ||||||||||||||||||||||||
| 234 | QLabel *logoLabel; | - | ||||||||||||||||||||||||
| 235 | QGridLayout *layout; | - | ||||||||||||||||||||||||
| 236 | QPixmap bannerPixmap; | - | ||||||||||||||||||||||||
| 237 | }; | - | ||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||
| 239 | QWizardHeader::QWizardHeader(QWidget *parent) | - | ||||||||||||||||||||||||
| 240 | : QWidget(parent) | - | ||||||||||||||||||||||||
| 241 | { | - | ||||||||||||||||||||||||
| 242 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); | - | ||||||||||||||||||||||||
| 243 | setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
| 244 | - | |||||||||||||||||||||||||
| 245 | titleLabel = new QLabel(this); | - | ||||||||||||||||||||||||
| 246 | titleLabel->setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
| 247 | - | |||||||||||||||||||||||||
| 248 | subTitleLabel = new QLabel(this); | - | ||||||||||||||||||||||||
| 249 | subTitleLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); | - | ||||||||||||||||||||||||
| 250 | subTitleLabel->setWordWrap(true); | - | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | logoLabel = new QLabel(this); | - | ||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||
| 254 | QFont font = titleLabel->font(); | - | ||||||||||||||||||||||||
| 255 | font.setBold(true); | - | ||||||||||||||||||||||||
| 256 | titleLabel->setFont(font); | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | layout = new QGridLayout(this); | - | ||||||||||||||||||||||||
| 259 | layout->setMargin(0); | - | ||||||||||||||||||||||||
| 260 | layout->setSpacing(0); | - | ||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | layout->setRowMinimumHeight(3, 1); | - | ||||||||||||||||||||||||
| 263 | layout->setRowStretch(4, 1); | - | ||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||
| 265 | layout->setColumnStretch(2, 1); | - | ||||||||||||||||||||||||
| 266 | layout->setColumnMinimumWidth(4, 2 * GapBetweenLogoAndRightEdge); | - | ||||||||||||||||||||||||
| 267 | layout->setColumnMinimumWidth(6, GapBetweenLogoAndRightEdge); | - | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | layout->addWidget(titleLabel, 2, 1, 1, 2); | - | ||||||||||||||||||||||||
| 270 | layout->addWidget(subTitleLabel, 4, 2); | - | ||||||||||||||||||||||||
| 271 | layout->addWidget(logoLabel, 1, 5, 5, 1); | - | ||||||||||||||||||||||||
| 272 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 273 | void QWizardHeader::setup(const QWizardLayoutInfo &info, const QString &title, | - | ||||||||||||||||||||||||
| 274 | const QString &subTitle, const QPixmap &logo, const QPixmap &banner, | - | ||||||||||||||||||||||||
| 275 | Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat) | - | ||||||||||||||||||||||||
| 276 | { | - | ||||||||||||||||||||||||
| 277 | bool modern = ((info.wizStyle == QWizard::ModernStyle) | - | ||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | ); | - | ||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||
| 284 | layout->setRowMinimumHeight(0, modern ? ModernHeaderTopMargin : 0); | - | ||||||||||||||||||||||||
| 285 | layout->setRowMinimumHeight(1, modern ? info.topLevelMarginTop - ModernHeaderTopMargin - 1 : 0); | - | ||||||||||||||||||||||||
| 286 | layout->setRowMinimumHeight(6, (modern ? 3 : GapBetweenLogoAndRightEdge) + 2); | - | ||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||
| 288 | int minColumnWidth0 = modern
| 0 | ||||||||||||||||||||||||
| 289 | int minColumnWidth1 = modern
| 0 | ||||||||||||||||||||||||
| 290 | : info.topLevelMarginLeft + ClassicHMargin; | - | ||||||||||||||||||||||||
| 291 | layout->setColumnMinimumWidth(0, minColumnWidth0); | - | ||||||||||||||||||||||||
| 292 | layout->setColumnMinimumWidth(1, minColumnWidth1); | - | ||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||
| 294 | titleLabel->setTextFormat(titleFormat); | - | ||||||||||||||||||||||||
| 295 | titleLabel->setText(title); | - | ||||||||||||||||||||||||
| 296 | logoLabel->setPixmap(logo); | - | ||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | subTitleLabel->setTextFormat(subTitleFormat); | - | ||||||||||||||||||||||||
| 299 | subTitleLabel->setText(QLatin1String("Pq\nPq")); | - | ||||||||||||||||||||||||
| 300 | int desiredSubTitleHeight = subTitleLabel->sizeHint().height(); | - | ||||||||||||||||||||||||
| 301 | subTitleLabel->setText(subTitle); | - | ||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||
| 303 | if (modern
| 0 | ||||||||||||||||||||||||
| 304 | bannerPixmap = banner; | - | ||||||||||||||||||||||||
| 305 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 306 | bannerPixmap = QPixmap(); | - | ||||||||||||||||||||||||
| 307 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||
| 309 | if (bannerPixmap.isNull()
| 0 | ||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | int candidateSubTitleWidth = qMin(512, 2 * QApplication::desktop()->width() / 3); | - | ||||||||||||||||||||||||
| 314 | int delta = candidateSubTitleWidth >> 1; | - | ||||||||||||||||||||||||
| 315 | while (delta > 0
| 0 | ||||||||||||||||||||||||
| 316 | if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
| 0 | ||||||||||||||||||||||||
| 317 | <= desiredSubTitleHeight
| 0 | ||||||||||||||||||||||||
| 318 | candidateSubTitleWidth -= delta; never executed: candidateSubTitleWidth -= delta; | 0 | ||||||||||||||||||||||||
| 319 | delta >>= 1; | - | ||||||||||||||||||||||||
| 320 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | subTitleLabel->setMinimumSize(candidateSubTitleWidth, desiredSubTitleHeight); | - | ||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||
| 324 | QSize size = layout->totalMinimumSize(); | - | ||||||||||||||||||||||||
| 325 | setMinimumSize(size); | - | ||||||||||||||||||||||||
| 326 | setMaximumSize(((1<<24)-1), size.height()); | - | ||||||||||||||||||||||||
| 327 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 328 | subTitleLabel->setMinimumSize(0, 0); | - | ||||||||||||||||||||||||
| 329 | setFixedSize(banner.size() + QSize(0, 2)); | - | ||||||||||||||||||||||||
| 330 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 331 | updateGeometry(); | - | ||||||||||||||||||||||||
| 332 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 333 | - | |||||||||||||||||||||||||
| 334 | void QWizardHeader::paintEvent(QPaintEvent * ) | - | ||||||||||||||||||||||||
| 335 | { | - | ||||||||||||||||||||||||
| 336 | QPainter painter(this); | - | ||||||||||||||||||||||||
| 337 | painter.drawPixmap(0, 0, bannerPixmap); | - | ||||||||||||||||||||||||
| 338 | - | |||||||||||||||||||||||||
| 339 | int x = width() - 2; | - | ||||||||||||||||||||||||
| 340 | int y = height() - 2; | - | ||||||||||||||||||||||||
| 341 | const QPalette &pal = palette(); | - | ||||||||||||||||||||||||
| 342 | painter.setPen(pal.mid().color()); | - | ||||||||||||||||||||||||
| 343 | painter.drawLine(0, y, x, y); | - | ||||||||||||||||||||||||
| 344 | painter.setPen(pal.base().color()); | - | ||||||||||||||||||||||||
| 345 | painter.drawPoint(x + 1, y); | - | ||||||||||||||||||||||||
| 346 | painter.drawLine(0, y + 1, x + 1, y + 1); | - | ||||||||||||||||||||||||
| 347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||
| 349 | - | |||||||||||||||||||||||||
| 350 | class QWizardRuler : public QWizardHeader | - | ||||||||||||||||||||||||
| 351 | { | - | ||||||||||||||||||||||||
| 352 | public: | - | ||||||||||||||||||||||||
| 353 | inline QWizardRuler(QWidget *parent = 0) | - | ||||||||||||||||||||||||
| 354 | : QWizardHeader(Ruler, parent) {} never executed: end of block | 0 | ||||||||||||||||||||||||
| 355 | }; | - | ||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | class QWatermarkLabel : public QLabel | - | ||||||||||||||||||||||||
| 358 | { | - | ||||||||||||||||||||||||
| 359 | public: | - | ||||||||||||||||||||||||
| 360 | QWatermarkLabel(QWidget *parent, QWidget *sideWidget) : QLabel(parent), m_sideWidget(sideWidget) { | - | ||||||||||||||||||||||||
| 361 | m_layout = new QVBoxLayout(this); | - | ||||||||||||||||||||||||
| 362 | if (m_sideWidget
| 0 | ||||||||||||||||||||||||
| 363 | m_layout->addWidget(m_sideWidget); never executed: m_layout->addWidget(m_sideWidget); | 0 | ||||||||||||||||||||||||
| 364 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 365 | - | |||||||||||||||||||||||||
| 366 | QSize minimumSizeHint() const override { | - | ||||||||||||||||||||||||
| 367 | if (!pixmap()
| 0 | ||||||||||||||||||||||||
| 368 | return never executed: pixmap()->size();return pixmap()->size();never executed: return pixmap()->size(); | 0 | ||||||||||||||||||||||||
| 369 | return never executed: QFrame::minimumSizeHint();return QFrame::minimumSizeHint();never executed: return QFrame::minimumSizeHint(); | 0 | ||||||||||||||||||||||||
| 370 | } | - | ||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | void setSideWidget(QWidget *widget) { | - | ||||||||||||||||||||||||
| 373 | if (m_sideWidget == widget
| 0 | ||||||||||||||||||||||||
| 374 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 375 | if (m_sideWidget
| 0 | ||||||||||||||||||||||||
| 376 | m_layout->removeWidget(m_sideWidget); | - | ||||||||||||||||||||||||
| 377 | m_sideWidget->hide(); | - | ||||||||||||||||||||||||
| 378 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 379 | m_sideWidget = widget; | - | ||||||||||||||||||||||||
| 380 | if (m_sideWidget
| 0 | ||||||||||||||||||||||||
| 381 | m_layout->addWidget(m_sideWidget); never executed: m_layout->addWidget(m_sideWidget); | 0 | ||||||||||||||||||||||||
| 382 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 383 | QWidget *sideWidget() const { | - | ||||||||||||||||||||||||
| 384 | return never executed: m_sideWidget;return m_sideWidget;never executed: return m_sideWidget; | 0 | ||||||||||||||||||||||||
| 385 | } | - | ||||||||||||||||||||||||
| 386 | private: | - | ||||||||||||||||||||||||
| 387 | QVBoxLayout *m_layout; | - | ||||||||||||||||||||||||
| 388 | QWidget *m_sideWidget; | - | ||||||||||||||||||||||||
| 389 | }; | - | ||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||
| 391 | class QWizardPagePrivate : public QWidgetPrivate | - | ||||||||||||||||||||||||
| 392 | { | - | ||||||||||||||||||||||||
| 393 | inline QWizardPage* q_func() { return static_cast<QWizardPage *>(q_ptr); } inline const QWizardPage* q_func() const { return static_cast<const QWizardPage *>(q_ptr); } friend class QWizardPage; | - | ||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||
| 395 | public: | - | ||||||||||||||||||||||||
| 396 | enum TriState { Tri_Unknown = -1, Tri_False, Tri_True }; | - | ||||||||||||||||||||||||
| 397 | - | |||||||||||||||||||||||||
| 398 | inline QWizardPagePrivate() | - | ||||||||||||||||||||||||
| 399 | : wizard(0), completeState(Tri_Unknown), explicitlyFinal(false), commit(false) {} never executed: end of block | 0 | ||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | bool cachedIsComplete() const; | - | ||||||||||||||||||||||||
| 402 | void _q_maybeEmitCompleteChanged(); | - | ||||||||||||||||||||||||
| 403 | void _q_updateCachedCompleteState(); | - | ||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||
| 405 | QWizard *wizard; | - | ||||||||||||||||||||||||
| 406 | QString title; | - | ||||||||||||||||||||||||
| 407 | QString subTitle; | - | ||||||||||||||||||||||||
| 408 | QPixmap pixmaps[QWizard::NPixmaps]; | - | ||||||||||||||||||||||||
| 409 | QVector<QWizardField> pendingFields; | - | ||||||||||||||||||||||||
| 410 | mutable TriState completeState; | - | ||||||||||||||||||||||||
| 411 | bool explicitlyFinal; | - | ||||||||||||||||||||||||
| 412 | bool commit; | - | ||||||||||||||||||||||||
| 413 | QMap<int, QString> buttonCustomTexts; | - | ||||||||||||||||||||||||
| 414 | }; | - | ||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||
| 416 | bool QWizardPagePrivate::cachedIsComplete() const | - | ||||||||||||||||||||||||
| 417 | { | - | ||||||||||||||||||||||||
| 418 | const QWizardPage * const q = q_func(); | - | ||||||||||||||||||||||||
| 419 | if (completeState == Tri_Unknown
| 0 | ||||||||||||||||||||||||
| 420 | completeState = q->isComplete()
never executed: completeState = q->isComplete() ? Tri_True : Tri_False; | 0 | ||||||||||||||||||||||||
| 421 | return never executed: completeState == Tri_True;return completeState == Tri_True;never executed: return completeState == Tri_True; | 0 | ||||||||||||||||||||||||
| 422 | } | - | ||||||||||||||||||||||||
| 423 | - | |||||||||||||||||||||||||
| 424 | void QWizardPagePrivate::_q_maybeEmitCompleteChanged() | - | ||||||||||||||||||||||||
| 425 | { | - | ||||||||||||||||||||||||
| 426 | QWizardPage * const q = q_func(); | - | ||||||||||||||||||||||||
| 427 | TriState newState = q->isComplete()
| 0 | ||||||||||||||||||||||||
| 428 | if (newState != completeState
| 0 | ||||||||||||||||||||||||
| 429 | q->completeChanged(); never executed: q->completeChanged(); | 0 | ||||||||||||||||||||||||
| 430 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||
| 432 | void QWizardPagePrivate::_q_updateCachedCompleteState() | - | ||||||||||||||||||||||||
| 433 | { | - | ||||||||||||||||||||||||
| 434 | QWizardPage * const q = q_func(); | - | ||||||||||||||||||||||||
| 435 | completeState = q->isComplete()
| 0 | ||||||||||||||||||||||||
| 436 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||
| 438 | class QWizardAntiFlickerWidget : public QWidget | - | ||||||||||||||||||||||||
| 439 | { | - | ||||||||||||||||||||||||
| 440 | public: | - | ||||||||||||||||||||||||
| 441 | QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *) | - | ||||||||||||||||||||||||
| 442 | : QWidget(wizard) | - | ||||||||||||||||||||||||
| 443 | {} never executed: end of block | 0 | ||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||
| 445 | }; | - | ||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||
| 447 | class QWizardPrivate : public QDialogPrivate | - | ||||||||||||||||||||||||
| 448 | { | - | ||||||||||||||||||||||||
| 449 | inline QWizard* q_func() { return static_cast<QWizard *>(q_ptr); } inline const QWizard* q_func() const { return static_cast<const QWizard *>(q_ptr); } friend class QWizard; | - | ||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | public: | - | ||||||||||||||||||||||||
| 452 | typedef QMap<int, QWizardPage *> PageMap; | - | ||||||||||||||||||||||||
| 453 | - | |||||||||||||||||||||||||
| 454 | enum Direction { | - | ||||||||||||||||||||||||
| 455 | Backward, | - | ||||||||||||||||||||||||
| 456 | Forward | - | ||||||||||||||||||||||||
| 457 | }; | - | ||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | inline QWizardPrivate() | - | ||||||||||||||||||||||||
| 460 | : start(-1) | - | ||||||||||||||||||||||||
| 461 | , startSetByUser(false) | - | ||||||||||||||||||||||||
| 462 | , current(-1) | - | ||||||||||||||||||||||||
| 463 | , canContinue(false) | - | ||||||||||||||||||||||||
| 464 | , canFinish(false) | - | ||||||||||||||||||||||||
| 465 | , disableUpdatesCount(0) | - | ||||||||||||||||||||||||
| 466 | , wizStyle(QWizard::ClassicStyle) | - | ||||||||||||||||||||||||
| 467 | , opts(0) | - | ||||||||||||||||||||||||
| 468 | , buttonsHaveCustomLayout(false) | - | ||||||||||||||||||||||||
| 469 | , titleFmt(Qt::AutoText) | - | ||||||||||||||||||||||||
| 470 | , subTitleFmt(Qt::AutoText) | - | ||||||||||||||||||||||||
| 471 | , placeholderWidget1(0) | - | ||||||||||||||||||||||||
| 472 | , placeholderWidget2(0) | - | ||||||||||||||||||||||||
| 473 | , headerWidget(0) | - | ||||||||||||||||||||||||
| 474 | , watermarkLabel(0) | - | ||||||||||||||||||||||||
| 475 | , sideWidget(0) | - | ||||||||||||||||||||||||
| 476 | , pageFrame(0) | - | ||||||||||||||||||||||||
| 477 | , titleLabel(0) | - | ||||||||||||||||||||||||
| 478 | , subTitleLabel(0) | - | ||||||||||||||||||||||||
| 479 | , bottomRuler(0) | - | ||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||
| 485 | - | |||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||
| 487 | , minimumWidth(0) | - | ||||||||||||||||||||||||
| 488 | , minimumHeight(0) | - | ||||||||||||||||||||||||
| 489 | , maximumWidth(((1<<24)-1)) | - | ||||||||||||||||||||||||
| 490 | , maximumHeight(((1<<24)-1)) | - | ||||||||||||||||||||||||
| 491 | { | - | ||||||||||||||||||||||||
| 492 | std::fill(btns, btns + QWizard::NButtons, static_cast<QAbstractButton *>(0)); | - | ||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||
| 498 | - | |||||||||||||||||||||||||
| 499 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||
| 501 | void init(); | - | ||||||||||||||||||||||||
| 502 | void reset(); | - | ||||||||||||||||||||||||
| 503 | void cleanupPagesNotInHistory(); | - | ||||||||||||||||||||||||
| 504 | void addField(const QWizardField &field); | - | ||||||||||||||||||||||||
| 505 | void removeFieldAt(int index); | - | ||||||||||||||||||||||||
| 506 | void switchToPage(int newId, Direction direction); | - | ||||||||||||||||||||||||
| 507 | QWizardLayoutInfo layoutInfoForCurrentPage(); | - | ||||||||||||||||||||||||
| 508 | void recreateLayout(const QWizardLayoutInfo &info); | - | ||||||||||||||||||||||||
| 509 | void updateLayout(); | - | ||||||||||||||||||||||||
| 510 | void updateMinMaxSizes(const QWizardLayoutInfo &info); | - | ||||||||||||||||||||||||
| 511 | void updateCurrentPage(); | - | ||||||||||||||||||||||||
| 512 | bool ensureButton(QWizard::WizardButton which) const; | - | ||||||||||||||||||||||||
| 513 | void connectButton(QWizard::WizardButton which) const; | - | ||||||||||||||||||||||||
| 514 | void updateButtonTexts(); | - | ||||||||||||||||||||||||
| 515 | void updateButtonLayout(); | - | ||||||||||||||||||||||||
| 516 | void setButtonLayout(const QWizard::WizardButton *array, int size); | - | ||||||||||||||||||||||||
| 517 | bool buttonLayoutContains(QWizard::WizardButton which); | - | ||||||||||||||||||||||||
| 518 | void updatePixmap(QWizard::WizardPixmap which); | - | ||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||
| 521 | - | |||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||
| 524 | bool isVistaThemeEnabled() const; | - | ||||||||||||||||||||||||
| 525 | void disableUpdates(); | - | ||||||||||||||||||||||||
| 526 | void enableUpdates(); | - | ||||||||||||||||||||||||
| 527 | void _q_emitCustomButtonClicked(); | - | ||||||||||||||||||||||||
| 528 | void _q_updateButtonStates(); | - | ||||||||||||||||||||||||
| 529 | void _q_handleFieldObjectDestroyed(QObject *); | - | ||||||||||||||||||||||||
| 530 | void setStyle(QStyle *style); | - | ||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||
| 535 | PageMap pageMap; | - | ||||||||||||||||||||||||
| 536 | QVector<QWizardField> fields; | - | ||||||||||||||||||||||||
| 537 | QMap<QString, int> fieldIndexMap; | - | ||||||||||||||||||||||||
| 538 | QVector<QWizardDefaultProperty> defaultPropertyTable; | - | ||||||||||||||||||||||||
| 539 | QList<int> history; | - | ||||||||||||||||||||||||
| 540 | QSet<int> initialized; | - | ||||||||||||||||||||||||
| 541 | int start; | - | ||||||||||||||||||||||||
| 542 | bool startSetByUser; | - | ||||||||||||||||||||||||
| 543 | int current; | - | ||||||||||||||||||||||||
| 544 | bool canContinue; | - | ||||||||||||||||||||||||
| 545 | bool canFinish; | - | ||||||||||||||||||||||||
| 546 | QWizardLayoutInfo layoutInfo; | - | ||||||||||||||||||||||||
| 547 | int disableUpdatesCount; | - | ||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||
| 549 | QWizard::WizardStyle wizStyle; | - | ||||||||||||||||||||||||
| 550 | QWizard::WizardOptions opts; | - | ||||||||||||||||||||||||
| 551 | QMap<int, QString> buttonCustomTexts; | - | ||||||||||||||||||||||||
| 552 | bool buttonsHaveCustomLayout; | - | ||||||||||||||||||||||||
| 553 | QList<QWizard::WizardButton> buttonsCustomLayout; | - | ||||||||||||||||||||||||
| 554 | Qt::TextFormat titleFmt; | - | ||||||||||||||||||||||||
| 555 | Qt::TextFormat subTitleFmt; | - | ||||||||||||||||||||||||
| 556 | mutable QPixmap defaultPixmaps[QWizard::NPixmaps]; | - | ||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | union { | - | ||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||
| 560 | mutable struct { | - | ||||||||||||||||||||||||
| 561 | QAbstractButton *back; | - | ||||||||||||||||||||||||
| 562 | QAbstractButton *next; | - | ||||||||||||||||||||||||
| 563 | QAbstractButton *commit; | - | ||||||||||||||||||||||||
| 564 | QAbstractButton *finish; | - | ||||||||||||||||||||||||
| 565 | QAbstractButton *cancel; | - | ||||||||||||||||||||||||
| 566 | QAbstractButton *help; | - | ||||||||||||||||||||||||
| 567 | } btn; | - | ||||||||||||||||||||||||
| 568 | mutable QAbstractButton *btns[QWizard::NButtons]; | - | ||||||||||||||||||||||||
| 569 | }; | - | ||||||||||||||||||||||||
| 570 | QWizardAntiFlickerWidget *antiFlickerWidget; | - | ||||||||||||||||||||||||
| 571 | QWidget *placeholderWidget1; | - | ||||||||||||||||||||||||
| 572 | QWidget *placeholderWidget2; | - | ||||||||||||||||||||||||
| 573 | QWizardHeader *headerWidget; | - | ||||||||||||||||||||||||
| 574 | QWatermarkLabel *watermarkLabel; | - | ||||||||||||||||||||||||
| 575 | QWidget *sideWidget; | - | ||||||||||||||||||||||||
| 576 | QFrame *pageFrame; | - | ||||||||||||||||||||||||
| 577 | QLabel *titleLabel; | - | ||||||||||||||||||||||||
| 578 | QLabel *subTitleLabel; | - | ||||||||||||||||||||||||
| 579 | QWizardRuler *bottomRuler; | - | ||||||||||||||||||||||||
| 580 | - | |||||||||||||||||||||||||
| 581 | QVBoxLayout *pageVBoxLayout; | - | ||||||||||||||||||||||||
| 582 | QHBoxLayout *buttonLayout; | - | ||||||||||||||||||||||||
| 583 | QGridLayout *mainLayout; | - | ||||||||||||||||||||||||
| 584 | int minimumWidth; | - | ||||||||||||||||||||||||
| 585 | int minimumHeight; | - | ||||||||||||||||||||||||
| 586 | int maximumWidth; | - | ||||||||||||||||||||||||
| 587 | int maximumHeight; | - | ||||||||||||||||||||||||
| 588 | }; | - | ||||||||||||||||||||||||
| 589 | - | |||||||||||||||||||||||||
| 590 | static QString buttonDefaultText(int wstyle, int which, const QWizardPrivate *wizardPrivate) | - | ||||||||||||||||||||||||
| 591 | { | - | ||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||
| 593 | (void)wizardPrivate;; | - | ||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||
| 595 | const bool macStyle = (wstyle == QWizard::MacStyle); | - | ||||||||||||||||||||||||
| 596 | switch (which) { | - | ||||||||||||||||||||||||
| 597 | case never executed: QWizard::BackButton:case QWizard::BackButton:never executed: case QWizard::BackButton: | 0 | ||||||||||||||||||||||||
| 598 | return never executed: macStylereturn macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back");
never executed: return macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back"); | 0 | ||||||||||||||||||||||||
| 599 | case never executed: QWizard::NextButton:case QWizard::NextButton:never executed: case QWizard::NextButton: | 0 | ||||||||||||||||||||||||
| 600 | if (macStyle
| 0 | ||||||||||||||||||||||||
| 601 | return never executed: QWizard::tr("Continue");return QWizard::tr("Continue");never executed: return QWizard::tr("Continue"); | 0 | ||||||||||||||||||||||||
| 602 | else | - | ||||||||||||||||||||||||
| 603 | return never executed: wizardPrivate->isVistaThemeEnabled()return wizardPrivate->isVistaThemeEnabled() ? QWizard::tr("&Next") : QWizard::tr("&Next >");
never executed: return wizardPrivate->isVistaThemeEnabled() ? QWizard::tr("&Next") : QWizard::tr("&Next >"); | 0 | ||||||||||||||||||||||||
| 604 | ? QWizard::tr("&Next") : QWizard::tr("&Next >"); never executed: return wizardPrivate->isVistaThemeEnabled() ? QWizard::tr("&Next") : QWizard::tr("&Next >"); | 0 | ||||||||||||||||||||||||
| 605 | case never executed: QWizard::CommitButton:case QWizard::CommitButton:never executed: case QWizard::CommitButton: | 0 | ||||||||||||||||||||||||
| 606 | return never executed: QWizard::tr("Commit");return QWizard::tr("Commit");never executed: return QWizard::tr("Commit"); | 0 | ||||||||||||||||||||||||
| 607 | case never executed: QWizard::FinishButton:case QWizard::FinishButton:never executed: case QWizard::FinishButton: | 0 | ||||||||||||||||||||||||
| 608 | return never executed: macStylereturn macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish");
never executed: return macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish"); | 0 | ||||||||||||||||||||||||
| 609 | case never executed: QWizard::CancelButton:case QWizard::CancelButton:never executed: case QWizard::CancelButton: | 0 | ||||||||||||||||||||||||
| 610 | return never executed: QWizard::tr("Cancel");return QWizard::tr("Cancel");never executed: return QWizard::tr("Cancel"); | 0 | ||||||||||||||||||||||||
| 611 | case never executed: QWizard::HelpButton:case QWizard::HelpButton:never executed: case QWizard::HelpButton: | 0 | ||||||||||||||||||||||||
| 612 | return never executed: macStylereturn macStyle ? QWizard::tr("Help") : QWizard::tr("&Help");
never executed: return macStyle ? QWizard::tr("Help") : QWizard::tr("&Help"); | 0 | ||||||||||||||||||||||||
| 613 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 614 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 615 | } | - | ||||||||||||||||||||||||
| 616 | } | - | ||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||
| 618 | void QWizardPrivate::init() | - | ||||||||||||||||||||||||
| 619 | { | - | ||||||||||||||||||||||||
| 620 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 621 | - | |||||||||||||||||||||||||
| 622 | antiFlickerWidget = new QWizardAntiFlickerWidget(q, this); | - | ||||||||||||||||||||||||
| 623 | wizStyle = QWizard::WizardStyle(q->style()->styleHint(QStyle::SH_WizardStyle, 0, q)); | - | ||||||||||||||||||||||||
| 624 | if (wizStyle == QWizard::MacStyle
| 0 | ||||||||||||||||||||||||
| 625 | opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton); | - | ||||||||||||||||||||||||
| 626 | } never executed: else if (wizStyle == QWizard::ModernStyleend of block
| 0 | ||||||||||||||||||||||||
| 627 | opts = QWizard::HelpButtonOnRight; | - | ||||||||||||||||||||||||
| 628 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||
| 632 | - | |||||||||||||||||||||||||
| 633 | - | |||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | ensureButton(QWizard::BackButton); | - | ||||||||||||||||||||||||
| 636 | ensureButton(QWizard::NextButton); | - | ||||||||||||||||||||||||
| 637 | ensureButton(QWizard::CommitButton); | - | ||||||||||||||||||||||||
| 638 | ensureButton(QWizard::FinishButton); | - | ||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 | pageFrame = new QFrame(antiFlickerWidget); | - | ||||||||||||||||||||||||
| 641 | pageFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); | - | ||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||
| 643 | pageVBoxLayout = new QVBoxLayout(pageFrame); | - | ||||||||||||||||||||||||
| 644 | pageVBoxLayout->setSpacing(0); | - | ||||||||||||||||||||||||
| 645 | pageVBoxLayout->addSpacing(0); | - | ||||||||||||||||||||||||
| 646 | QSpacerItem *spacerItem = new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding); | - | ||||||||||||||||||||||||
| 647 | pageVBoxLayout->addItem(spacerItem); | - | ||||||||||||||||||||||||
| 648 | - | |||||||||||||||||||||||||
| 649 | buttonLayout = new QHBoxLayout; | - | ||||||||||||||||||||||||
| 650 | mainLayout = new QGridLayout(antiFlickerWidget); | - | ||||||||||||||||||||||||
| 651 | mainLayout->setSizeConstraint(QLayout::SetNoConstraint); | - | ||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||
| 653 | updateButtonLayout(); | - | ||||||||||||||||||||||||
| 654 | - | |||||||||||||||||||||||||
| 655 | defaultPropertyTable.reserve(NFallbackDefaultProperties); | - | ||||||||||||||||||||||||
| 656 | for (uint i = 0; i < NFallbackDefaultProperties
| 0 | ||||||||||||||||||||||||
| 657 | defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className, never executed: defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className, fallbackProperties[i].property, changed_signal(i))); | 0 | ||||||||||||||||||||||||
| 658 | fallbackProperties[i].property, never executed: defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className, fallbackProperties[i].property, changed_signal(i))); | 0 | ||||||||||||||||||||||||
| 659 | changed_signal(i))); never executed: defaultPropertyTable.append(QWizardDefaultProperty(fallbackProperties[i].className, fallbackProperties[i].property, changed_signal(i))); | 0 | ||||||||||||||||||||||||
| 660 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 661 | - | |||||||||||||||||||||||||
| 662 | void QWizardPrivate::reset() | - | ||||||||||||||||||||||||
| 663 | { | - | ||||||||||||||||||||||||
| 664 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 665 | if (current != -1
| 0 | ||||||||||||||||||||||||
| 666 | q->currentPage()->hide(); | - | ||||||||||||||||||||||||
| 667 | cleanupPagesNotInHistory(); | - | ||||||||||||||||||||||||
| 668 | for (int i = history.count() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 669 | q->cleanupPage(history.at(i)); never executed: q->cleanupPage(history.at(i)); | 0 | ||||||||||||||||||||||||
| 670 | history.clear(); | - | ||||||||||||||||||||||||
| 671 | initialized.clear(); | - | ||||||||||||||||||||||||
| 672 | - | |||||||||||||||||||||||||
| 673 | current = -1; | - | ||||||||||||||||||||||||
| 674 | q->currentIdChanged(-1); | - | ||||||||||||||||||||||||
| 675 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 676 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 677 | - | |||||||||||||||||||||||||
| 678 | void QWizardPrivate::cleanupPagesNotInHistory() | - | ||||||||||||||||||||||||
| 679 | { | - | ||||||||||||||||||||||||
| 680 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||
| 682 | const QSet<int> original = initialized; | - | ||||||||||||||||||||||||
| 683 | QSet<int>::const_iterator i = original.constBegin(); | - | ||||||||||||||||||||||||
| 684 | QSet<int>::const_iterator end = original.constEnd(); | - | ||||||||||||||||||||||||
| 685 | - | |||||||||||||||||||||||||
| 686 | for (; i != end
| 0 | ||||||||||||||||||||||||
| 687 | if (!history.contains(*i)
| 0 | ||||||||||||||||||||||||
| 688 | q->cleanupPage(*i); | - | ||||||||||||||||||||||||
| 689 | initialized.remove(*i); | - | ||||||||||||||||||||||||
| 690 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 691 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 692 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 693 | - | |||||||||||||||||||||||||
| 694 | void QWizardPrivate::addField(const QWizardField &field) | - | ||||||||||||||||||||||||
| 695 | { | - | ||||||||||||||||||||||||
| 696 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 697 | - | |||||||||||||||||||||||||
| 698 | QWizardField myField = field; | - | ||||||||||||||||||||||||
| 699 | myField.resolve(defaultPropertyTable); | - | ||||||||||||||||||||||||
| 700 | - | |||||||||||||||||||||||||
| 701 | if (fieldIndexMap.contains(myField.name)
| 0 | ||||||||||||||||||||||||
| 702 | QMessageLogger(__FILE__, 803, __PRETTY_FUNCTION__).warning("QWizardPage::addField: Duplicate field '%s'", QString(myField.name).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||
| 703 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 704 | } | - | ||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||
| 706 | fieldIndexMap.insert(myField.name, fields.count()); | - | ||||||||||||||||||||||||
| 707 | fields += myField; | - | ||||||||||||||||||||||||
| 708 | if (myField.mandatory
| 0 | ||||||||||||||||||||||||
| 709 | QObject::connect(myField.object, myField.changedSignal, never executed: QObject::connect(myField.object, myField.changedSignal, myField.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "811")); | 0 | ||||||||||||||||||||||||
| 710 | myField.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "811")); never executed: QObject::connect(myField.object, myField.changedSignal, myField.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "811")); | 0 | ||||||||||||||||||||||||
| 711 | QObject::connect( | - | ||||||||||||||||||||||||
| 712 | myField.object, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "813"), q, | - | ||||||||||||||||||||||||
| 713 | qFlagLocation("1""_q_handleFieldObjectDestroyed(QObject*)" "\0" __FILE__ ":" "814")); | - | ||||||||||||||||||||||||
| 714 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||
| 716 | void QWizardPrivate::removeFieldAt(int index) | - | ||||||||||||||||||||||||
| 717 | { | - | ||||||||||||||||||||||||
| 718 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||
| 720 | const QWizardField &field = fields.at(index); | - | ||||||||||||||||||||||||
| 721 | fieldIndexMap.remove(field.name); | - | ||||||||||||||||||||||||
| 722 | if (field.mandatory
| 0 | ||||||||||||||||||||||||
| 723 | QObject::disconnect(field.object, field.changedSignal, never executed: QObject::disconnect(field.object, field.changedSignal, field.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "825")); | 0 | ||||||||||||||||||||||||
| 724 | field.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "825")); never executed: QObject::disconnect(field.object, field.changedSignal, field.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "825")); | 0 | ||||||||||||||||||||||||
| 725 | QObject::disconnect( | - | ||||||||||||||||||||||||
| 726 | field.object, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "827"), q, | - | ||||||||||||||||||||||||
| 727 | qFlagLocation("1""_q_handleFieldObjectDestroyed(QObject*)" "\0" __FILE__ ":" "828")); | - | ||||||||||||||||||||||||
| 728 | fields.remove(index); | - | ||||||||||||||||||||||||
| 729 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 730 | - | |||||||||||||||||||||||||
| 731 | void QWizardPrivate::switchToPage(int newId, Direction direction) | - | ||||||||||||||||||||||||
| 732 | { | - | ||||||||||||||||||||||||
| 733 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 734 | - | |||||||||||||||||||||||||
| 735 | disableUpdates(); | - | ||||||||||||||||||||||||
| 736 | - | |||||||||||||||||||||||||
| 737 | int oldId = current; | - | ||||||||||||||||||||||||
| 738 | if (QWizardPage *oldPage = q->currentPage()
| 0 | ||||||||||||||||||||||||
| 739 | oldPage->hide(); | - | ||||||||||||||||||||||||
| 740 | - | |||||||||||||||||||||||||
| 741 | if (direction == Backward
| 0 | ||||||||||||||||||||||||
| 742 | if (!(opts & QWizard::IndependentPages)
| 0 | ||||||||||||||||||||||||
| 743 | q->cleanupPage(oldId); | - | ||||||||||||||||||||||||
| 744 | initialized.remove(oldId); | - | ||||||||||||||||||||||||
| 745 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 746 | ((!(history.last() == oldId)) ? qt_assert("history.last() == oldId",__FILE__,847) : qt_noop()); | - | ||||||||||||||||||||||||
| 747 | history.removeLast(); | - | ||||||||||||||||||||||||
| 748 | ((!(history.last() == newId)) ? qt_assert("history.last() == newId",__FILE__,849) : qt_noop()); | - | ||||||||||||||||||||||||
| 749 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 750 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 751 | - | |||||||||||||||||||||||||
| 752 | current = newId; | - | ||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||
| 754 | QWizardPage *newPage = q->currentPage(); | - | ||||||||||||||||||||||||
| 755 | if (newPage
| 0 | ||||||||||||||||||||||||
| 756 | if (direction == Forward
| 0 | ||||||||||||||||||||||||
| 757 | if (!initialized.contains(current)
| 0 | ||||||||||||||||||||||||
| 758 | initialized.insert(current); | - | ||||||||||||||||||||||||
| 759 | q->initializePage(current); | - | ||||||||||||||||||||||||
| 760 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 761 | history.append(current); | - | ||||||||||||||||||||||||
| 762 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 763 | newPage->show(); | - | ||||||||||||||||||||||||
| 764 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||
| 766 | canContinue = (q->nextId() != -1); | - | ||||||||||||||||||||||||
| 767 | canFinish = (newPage
| 0 | ||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||
| 769 | _q_updateButtonStates(); | - | ||||||||||||||||||||||||
| 770 | updateButtonTexts(); | - | ||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||
| 772 | const QWizard::WizardButton nextOrCommit = | - | ||||||||||||||||||||||||
| 773 | newPage
| 0 | ||||||||||||||||||||||||
| 774 | QAbstractButton *nextOrFinishButton = | - | ||||||||||||||||||||||||
| 775 | btns[canContinue ? nextOrCommit : QWizard::FinishButton]; | - | ||||||||||||||||||||||||
| 776 | QWidget *candidate = 0; | - | ||||||||||||||||||||||||
| 777 | if ((
| 0 | ||||||||||||||||||||||||
| 778 | candidate = nextOrFinishButton; | - | ||||||||||||||||||||||||
| 779 | } never executed: else if (newPageend of block
| 0 | ||||||||||||||||||||||||
| 780 | candidate = iWantTheFocus(newPage); | - | ||||||||||||||||||||||||
| 781 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 782 | if (!candidate
| 0 | ||||||||||||||||||||||||
| 783 | candidate = nextOrFinishButton; never executed: candidate = nextOrFinishButton; | 0 | ||||||||||||||||||||||||
| 784 | candidate->setFocus(); | - | ||||||||||||||||||||||||
| 785 | - | |||||||||||||||||||||||||
| 786 | if (wizStyle == QWizard::MacStyle
| 0 | ||||||||||||||||||||||||
| 787 | q->updateGeometry(); never executed: q->updateGeometry(); | 0 | ||||||||||||||||||||||||
| 788 | - | |||||||||||||||||||||||||
| 789 | enableUpdates(); | - | ||||||||||||||||||||||||
| 790 | updateLayout(); | - | ||||||||||||||||||||||||
| 791 | - | |||||||||||||||||||||||||
| 792 | q->currentIdChanged(current); | - | ||||||||||||||||||||||||
| 793 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 794 | - | |||||||||||||||||||||||||
| 795 | - | |||||||||||||||||||||||||
| 796 | static const char * buttonSlots(QWizard::WizardButton which) | - | ||||||||||||||||||||||||
| 797 | { | - | ||||||||||||||||||||||||
| 798 | switch (which) { | - | ||||||||||||||||||||||||
| 799 | case never executed: QWizard::BackButton:case QWizard::BackButton:never executed: case QWizard::BackButton: | 0 | ||||||||||||||||||||||||
| 800 | return never executed: qFlagLocation("1""back()" "\0" __FILE__ ":" "911");return qFlagLocation("1""back()" "\0" __FILE__ ":" "911");never executed: return qFlagLocation("1""back()" "\0" __FILE__ ":" "911"); | 0 | ||||||||||||||||||||||||
| 801 | case never executed: QWizard::NextButton:case QWizard::NextButton:never executed: case QWizard::NextButton: | 0 | ||||||||||||||||||||||||
| 802 | case never executed: QWizard::CommitButton:case QWizard::CommitButton:never executed: case QWizard::CommitButton: | 0 | ||||||||||||||||||||||||
| 803 | return never executed: qFlagLocation("1""next()" "\0" __FILE__ ":" "914");return qFlagLocation("1""next()" "\0" __FILE__ ":" "914");never executed: return qFlagLocation("1""next()" "\0" __FILE__ ":" "914"); | 0 | ||||||||||||||||||||||||
| 804 | case never executed: QWizard::FinishButton:case QWizard::FinishButton:never executed: case QWizard::FinishButton: | 0 | ||||||||||||||||||||||||
| 805 | return never executed: qFlagLocation("1""accept()" "\0" __FILE__ ":" "916");return qFlagLocation("1""accept()" "\0" __FILE__ ":" "916");never executed: return qFlagLocation("1""accept()" "\0" __FILE__ ":" "916"); | 0 | ||||||||||||||||||||||||
| 806 | case never executed: QWizard::CancelButton:case QWizard::CancelButton:never executed: case QWizard::CancelButton: | 0 | ||||||||||||||||||||||||
| 807 | return never executed: qFlagLocation("1""reject()" "\0" __FILE__ ":" "918");return qFlagLocation("1""reject()" "\0" __FILE__ ":" "918");never executed: return qFlagLocation("1""reject()" "\0" __FILE__ ":" "918"); | 0 | ||||||||||||||||||||||||
| 808 | case never executed: QWizard::HelpButton:case QWizard::HelpButton:never executed: case QWizard::HelpButton: | 0 | ||||||||||||||||||||||||
| 809 | return never executed: qFlagLocation("2""helpRequested()" "\0" __FILE__ ":" "920");return qFlagLocation("2""helpRequested()" "\0" __FILE__ ":" "920");never executed: return qFlagLocation("2""helpRequested()" "\0" __FILE__ ":" "920"); | 0 | ||||||||||||||||||||||||
| 810 | case never executed: QWizard::CustomButton1:case QWizard::CustomButton1:never executed: case QWizard::CustomButton1: | 0 | ||||||||||||||||||||||||
| 811 | case never executed: QWizard::CustomButton2:case QWizard::CustomButton2:never executed: case QWizard::CustomButton2: | 0 | ||||||||||||||||||||||||
| 812 | case never executed: QWizard::CustomButton3:case QWizard::CustomButton3:never executed: case QWizard::CustomButton3: | 0 | ||||||||||||||||||||||||
| 813 | case never executed: QWizard::Stretch:case QWizard::Stretch:never executed: case QWizard::Stretch: | 0 | ||||||||||||||||||||||||
| 814 | case never executed: QWizard::NoButton:case QWizard::NoButton:never executed: case QWizard::NoButton: | 0 | ||||||||||||||||||||||||
| 815 | do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,926) : qt_noop()); __builtin_unreachable(); } while (0); | - | ||||||||||||||||||||||||
| 816 | } never executed: ;end of block | 0 | ||||||||||||||||||||||||
| 817 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 818 | }; | - | ||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||
| 820 | QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage() | - | ||||||||||||||||||||||||
| 821 | { | - | ||||||||||||||||||||||||
| 822 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 823 | QStyle *style = q->style(); | - | ||||||||||||||||||||||||
| 824 | - | |||||||||||||||||||||||||
| 825 | QWizardLayoutInfo info; | - | ||||||||||||||||||||||||
| 826 | - | |||||||||||||||||||||||||
| 827 | const int layoutHorizontalSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing); | - | ||||||||||||||||||||||||
| 828 | info.topLevelMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, 0, q); | - | ||||||||||||||||||||||||
| 829 | info.topLevelMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, 0, q); | - | ||||||||||||||||||||||||
| 830 | info.topLevelMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, 0, q); | - | ||||||||||||||||||||||||
| 831 | info.topLevelMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, 0, q); | - | ||||||||||||||||||||||||
| 832 | info.childMarginLeft = style->pixelMetric(QStyle::PM_LayoutLeftMargin, 0, titleLabel); | - | ||||||||||||||||||||||||
| 833 | info.childMarginRight = style->pixelMetric(QStyle::PM_LayoutRightMargin, 0, titleLabel); | - | ||||||||||||||||||||||||
| 834 | info.childMarginTop = style->pixelMetric(QStyle::PM_LayoutTopMargin, 0, titleLabel); | - | ||||||||||||||||||||||||
| 835 | info.childMarginBottom = style->pixelMetric(QStyle::PM_LayoutBottomMargin, 0, titleLabel); | - | ||||||||||||||||||||||||
| 836 | info.hspacing = (
| 0 | ||||||||||||||||||||||||
| 837 | ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal) | - | ||||||||||||||||||||||||
| 838 | : layoutHorizontalSpacing; | - | ||||||||||||||||||||||||
| 839 | info.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing); | - | ||||||||||||||||||||||||
| 840 | info.buttonSpacing = (
| 0 | ||||||||||||||||||||||||
| 841 | ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal) | - | ||||||||||||||||||||||||
| 842 | : layoutHorizontalSpacing; | - | ||||||||||||||||||||||||
| 843 | - | |||||||||||||||||||||||||
| 844 | if (wizStyle == QWizard::MacStyle
| 0 | ||||||||||||||||||||||||
| 845 | info.buttonSpacing = 12; never executed: info.buttonSpacing = 12; | 0 | ||||||||||||||||||||||||
| 846 | - | |||||||||||||||||||||||||
| 847 | info.wizStyle = wizStyle; | - | ||||||||||||||||||||||||
| 848 | if (info.wizStyle == QWizard::AeroStyle
| 0 | ||||||||||||||||||||||||
| 849 | - | |||||||||||||||||||||||||
| 850 | - | |||||||||||||||||||||||||
| 851 | - | |||||||||||||||||||||||||
| 852 | ) | - | ||||||||||||||||||||||||
| 853 | info.wizStyle = QWizard::ModernStyle; never executed: info.wizStyle = QWizard::ModernStyle; | 0 | ||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||
| 855 | QString titleText; | - | ||||||||||||||||||||||||
| 856 | QString subTitleText; | - | ||||||||||||||||||||||||
| 857 | QPixmap backgroundPixmap; | - | ||||||||||||||||||||||||
| 858 | QPixmap watermarkPixmap; | - | ||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||
| 860 | if (QWizardPage *page = q->currentPage()
| 0 | ||||||||||||||||||||||||
| 861 | titleText = page->title(); | - | ||||||||||||||||||||||||
| 862 | subTitleText = page->subTitle(); | - | ||||||||||||||||||||||||
| 863 | backgroundPixmap = page->pixmap(QWizard::BackgroundPixmap); | - | ||||||||||||||||||||||||
| 864 | watermarkPixmap = page->pixmap(QWizard::WatermarkPixmap); | - | ||||||||||||||||||||||||
| 865 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 866 | - | |||||||||||||||||||||||||
| 867 | info.header = (info.wizStyle == QWizard::ClassicStyle
| 0 | ||||||||||||||||||||||||
| 868 | && !(opts & QWizard::IgnoreSubTitles)
| 0 | ||||||||||||||||||||||||
| 869 | info.sideWidget = sideWidget; | - | ||||||||||||||||||||||||
| 870 | info.watermark = (
| 0 | ||||||||||||||||||||||||
| 871 | && !watermarkPixmap.isNull()
| 0 | ||||||||||||||||||||||||
| 872 | info.title = !info.header
| 0 | ||||||||||||||||||||||||
| 873 | info.subTitle = !(opts & QWizard::IgnoreSubTitles)
| 0 | ||||||||||||||||||||||||
| 874 | info.extension = (info.watermark
| 0 | ||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||
| 876 | return never executed: info;return info;never executed: return info; | 0 | ||||||||||||||||||||||||
| 877 | } | - | ||||||||||||||||||||||||
| 878 | - | |||||||||||||||||||||||||
| 879 | void QWizardPrivate::recreateLayout(const QWizardLayoutInfo &info) | - | ||||||||||||||||||||||||
| 880 | { | - | ||||||||||||||||||||||||
| 881 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 882 | - | |||||||||||||||||||||||||
| 883 | - | |||||||||||||||||||||||||
| 884 | - | |||||||||||||||||||||||||
| 885 | - | |||||||||||||||||||||||||
| 886 | for (int i = mainLayout->count() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 887 | QLayoutItem *item = mainLayout->takeAt(i); | - | ||||||||||||||||||||||||
| 888 | if (item->layout()
| 0 | ||||||||||||||||||||||||
| 889 | item->layout()->setParent(0); | - | ||||||||||||||||||||||||
| 890 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 891 | delete item; | - | ||||||||||||||||||||||||
| 892 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 893 | } | - | ||||||||||||||||||||||||
| 894 | for (int i = mainLayout->columnCount() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 895 | mainLayout->setColumnMinimumWidth(i, 0); never executed: mainLayout->setColumnMinimumWidth(i, 0); | 0 | ||||||||||||||||||||||||
| 896 | for (int i = mainLayout->rowCount() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 897 | mainLayout->setRowMinimumHeight(i, 0); never executed: mainLayout->setRowMinimumHeight(i, 0); | 0 | ||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||
| 899 | - | |||||||||||||||||||||||||
| 900 | - | |||||||||||||||||||||||||
| 901 | - | |||||||||||||||||||||||||
| 902 | - | |||||||||||||||||||||||||
| 903 | bool mac = (info.wizStyle == QWizard::MacStyle); | - | ||||||||||||||||||||||||
| 904 | bool classic = (info.wizStyle == QWizard::ClassicStyle); | - | ||||||||||||||||||||||||
| 905 | bool modern = (info.wizStyle == QWizard::ModernStyle); | - | ||||||||||||||||||||||||
| 906 | bool aero = (info.wizStyle == QWizard::AeroStyle); | - | ||||||||||||||||||||||||
| 907 | int deltaMarginLeft = info.topLevelMarginLeft - info.childMarginLeft; | - | ||||||||||||||||||||||||
| 908 | int deltaMarginRight = info.topLevelMarginRight - info.childMarginRight; | - | ||||||||||||||||||||||||
| 909 | int deltaMarginTop = info.topLevelMarginTop - info.childMarginTop; | - | ||||||||||||||||||||||||
| 910 | int deltaMarginBottom = info.topLevelMarginBottom - info.childMarginBottom; | - | ||||||||||||||||||||||||
| 911 | int deltaVSpacing = info.topLevelMarginBottom - info.vspacing; | - | ||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||
| 913 | int row = 0; | - | ||||||||||||||||||||||||
| 914 | int numColumns; | - | ||||||||||||||||||||||||
| 915 | if (mac
| 0 | ||||||||||||||||||||||||
| 916 | numColumns = 3; | - | ||||||||||||||||||||||||
| 917 | } never executed: else if (info.watermarkend of block
| 0 | ||||||||||||||||||||||||
| 918 | numColumns = 2; | - | ||||||||||||||||||||||||
| 919 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 920 | numColumns = 1; | - | ||||||||||||||||||||||||
| 921 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 922 | int pageColumn = qMin(1, numColumns - 1); | - | ||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||
| 924 | if (mac
| 0 | ||||||||||||||||||||||||
| 925 | mainLayout->setMargin(0); | - | ||||||||||||||||||||||||
| 926 | mainLayout->setSpacing(0); | - | ||||||||||||||||||||||||
| 927 | buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin); | - | ||||||||||||||||||||||||
| 928 | pageVBoxLayout->setMargin(7); | - | ||||||||||||||||||||||||
| 929 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 930 | if (modern
| 0 | ||||||||||||||||||||||||
| 931 | mainLayout->setMargin(0); | - | ||||||||||||||||||||||||
| 932 | mainLayout->setSpacing(0); | - | ||||||||||||||||||||||||
| 933 | pageVBoxLayout->setContentsMargins(deltaMarginLeft, deltaMarginTop, | - | ||||||||||||||||||||||||
| 934 | deltaMarginRight, deltaMarginBottom); | - | ||||||||||||||||||||||||
| 935 | buttonLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop, | - | ||||||||||||||||||||||||
| 936 | info.topLevelMarginRight, info.topLevelMarginBottom); | - | ||||||||||||||||||||||||
| 937 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 938 | mainLayout->setContentsMargins(info.topLevelMarginLeft, info.topLevelMarginTop, | - | ||||||||||||||||||||||||
| 939 | info.topLevelMarginRight, info.topLevelMarginBottom); | - | ||||||||||||||||||||||||
| 940 | mainLayout->setHorizontalSpacing(info.hspacing); | - | ||||||||||||||||||||||||
| 941 | mainLayout->setVerticalSpacing(info.vspacing); | - | ||||||||||||||||||||||||
| 942 | pageVBoxLayout->setContentsMargins(0, 0, 0, 0); | - | ||||||||||||||||||||||||
| 943 | buttonLayout->setContentsMargins(0, 0, 0, 0); | - | ||||||||||||||||||||||||
| 944 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 945 | } | - | ||||||||||||||||||||||||
| 946 | buttonLayout->setSpacing(info.buttonSpacing); | - | ||||||||||||||||||||||||
| 947 | - | |||||||||||||||||||||||||
| 948 | if (info.header
| 0 | ||||||||||||||||||||||||
| 949 | if (!headerWidget
| 0 | ||||||||||||||||||||||||
| 950 | headerWidget = new QWizardHeader(antiFlickerWidget); never executed: headerWidget = new QWizardHeader(antiFlickerWidget); | 0 | ||||||||||||||||||||||||
| 951 | headerWidget->setAutoFillBackground(modern); | - | ||||||||||||||||||||||||
| 952 | mainLayout->addWidget(headerWidget, row++, 0, 1, numColumns); | - | ||||||||||||||||||||||||
| 953 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 954 | if (headerWidget
| 0 | ||||||||||||||||||||||||
| 955 | headerWidget->setVisible(info.header); never executed: headerWidget->setVisible(info.header); | 0 | ||||||||||||||||||||||||
| 956 | - | |||||||||||||||||||||||||
| 957 | int watermarkStartRow = row; | - | ||||||||||||||||||||||||
| 958 | - | |||||||||||||||||||||||||
| 959 | if (mac
| 0 | ||||||||||||||||||||||||
| 960 | mainLayout->setRowMinimumHeight(row++, 10); never executed: mainLayout->setRowMinimumHeight(row++, 10); | 0 | ||||||||||||||||||||||||
| 961 | - | |||||||||||||||||||||||||
| 962 | if (info.title
| 0 | ||||||||||||||||||||||||
| 963 | if (!titleLabel
| 0 | ||||||||||||||||||||||||
| 964 | titleLabel = new QLabel(antiFlickerWidget); | - | ||||||||||||||||||||||||
| 965 | titleLabel->setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
| 966 | titleLabel->setWordWrap(true); | - | ||||||||||||||||||||||||
| 967 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||
| 969 | QFont titleFont = q->font(); | - | ||||||||||||||||||||||||
| 970 | titleFont.setPointSize(titleFont.pointSize() + (mac ? 3 : 4)); | - | ||||||||||||||||||||||||
| 971 | titleFont.setBold(true); | - | ||||||||||||||||||||||||
| 972 | titleLabel->setPalette(QPalette()); | - | ||||||||||||||||||||||||
| 973 | - | |||||||||||||||||||||||||
| 974 | if (aero
| 0 | ||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||
| 976 | titleFont = QFont(QLatin1String("Segoe UI"), 12); | - | ||||||||||||||||||||||||
| 977 | QPalette pal(titleLabel->palette()); | - | ||||||||||||||||||||||||
| 978 | pal.setColor(QPalette::Text, "#003399"); | - | ||||||||||||||||||||||||
| 979 | titleLabel->setPalette(pal); | - | ||||||||||||||||||||||||
| 980 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 981 | - | |||||||||||||||||||||||||
| 982 | titleLabel->setFont(titleFont); | - | ||||||||||||||||||||||||
| 983 | const int aeroTitleIndent = 25; | - | ||||||||||||||||||||||||
| 984 | if (aero
| 0 | ||||||||||||||||||||||||
| 985 | titleLabel->setIndent(aeroTitleIndent); never executed: titleLabel->setIndent(aeroTitleIndent); | 0 | ||||||||||||||||||||||||
| 986 | else if (mac
| 0 | ||||||||||||||||||||||||
| 987 | titleLabel->setIndent(2); never executed: titleLabel->setIndent(2); | 0 | ||||||||||||||||||||||||
| 988 | else if (classic
| 0 | ||||||||||||||||||||||||
| 989 | titleLabel->setIndent(info.childMarginLeft); never executed: titleLabel->setIndent(info.childMarginLeft); | 0 | ||||||||||||||||||||||||
| 990 | else | - | ||||||||||||||||||||||||
| 991 | titleLabel->setIndent(info.topLevelMarginLeft); never executed: titleLabel->setIndent(info.topLevelMarginLeft); | 0 | ||||||||||||||||||||||||
| 992 | if (modern
| 0 | ||||||||||||||||||||||||
| 993 | if (!placeholderWidget1
| 0 | ||||||||||||||||||||||||
| 994 | placeholderWidget1 = new QWidget(antiFlickerWidget); | - | ||||||||||||||||||||||||
| 995 | placeholderWidget1->setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
| 996 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 997 | placeholderWidget1->setFixedHeight(info.topLevelMarginLeft + 2); | - | ||||||||||||||||||||||||
| 998 | mainLayout->addWidget(placeholderWidget1, row++, pageColumn); | - | ||||||||||||||||||||||||
| 999 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1000 | mainLayout->addWidget(titleLabel, row++, pageColumn); | - | ||||||||||||||||||||||||
| 1001 | if (modern
| 0 | ||||||||||||||||||||||||
| 1002 | if (!placeholderWidget2
| 0 | ||||||||||||||||||||||||
| 1003 | placeholderWidget2 = new QWidget(antiFlickerWidget); | - | ||||||||||||||||||||||||
| 1004 | placeholderWidget2->setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
| 1005 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1006 | placeholderWidget2->setFixedHeight(5); | - | ||||||||||||||||||||||||
| 1007 | mainLayout->addWidget(placeholderWidget2, row++, pageColumn); | - | ||||||||||||||||||||||||
| 1008 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1009 | if (mac
| 0 | ||||||||||||||||||||||||
| 1010 | mainLayout->setRowMinimumHeight(row++, 7); never executed: mainLayout->setRowMinimumHeight(row++, 7); | 0 | ||||||||||||||||||||||||
| 1011 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1012 | if (placeholderWidget1
| 0 | ||||||||||||||||||||||||
| 1013 | placeholderWidget1->setVisible(info.title && modern); never executed: placeholderWidget1->setVisible(info.title && modern); | 0 | ||||||||||||||||||||||||
| 1014 | if (placeholderWidget2
| 0 | ||||||||||||||||||||||||
| 1015 | placeholderWidget2->setVisible(info.title && modern); never executed: placeholderWidget2->setVisible(info.title && modern); | 0 | ||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||
| 1017 | if (info.subTitle
| 0 | ||||||||||||||||||||||||
| 1018 | if (!subTitleLabel
| 0 | ||||||||||||||||||||||||
| 1019 | subTitleLabel = new QLabel(pageFrame); | - | ||||||||||||||||||||||||
| 1020 | subTitleLabel->setWordWrap(true); | - | ||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||
| 1022 | subTitleLabel->setContentsMargins(info.childMarginLeft , 0, | - | ||||||||||||||||||||||||
| 1023 | info.childMarginRight , 0); | - | ||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||
| 1025 | pageVBoxLayout->insertWidget(1, subTitleLabel); | - | ||||||||||||||||||||||||
| 1026 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1027 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1028 | - | |||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||
| 1030 | changeSpacerSize(pageVBoxLayout, 0, 0, info.subTitle ? info.childMarginLeft : 0); | - | ||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||
| 1032 | int hMargin = mac
| 0 | ||||||||||||||||||||||||
| 1033 | int vMargin = hMargin; | - | ||||||||||||||||||||||||
| 1034 | - | |||||||||||||||||||||||||
| 1035 | pageFrame->setFrameStyle(mac ? (QFrame::Box | QFrame::Raised) : QFrame::NoFrame); | - | ||||||||||||||||||||||||
| 1036 | pageFrame->setLineWidth(0); | - | ||||||||||||||||||||||||
| 1037 | pageFrame->setMidLineWidth(hMargin); | - | ||||||||||||||||||||||||
| 1038 | - | |||||||||||||||||||||||||
| 1039 | if (info.header
| 0 | ||||||||||||||||||||||||
| 1040 | if (modern
| 0 | ||||||||||||||||||||||||
| 1041 | hMargin = info.topLevelMarginLeft; | - | ||||||||||||||||||||||||
| 1042 | vMargin = deltaMarginBottom; | - | ||||||||||||||||||||||||
| 1043 | } never executed: else if (classicend of block
| 0 | ||||||||||||||||||||||||
| 1044 | hMargin = deltaMarginLeft + ClassicHMargin; | - | ||||||||||||||||||||||||
| 1045 | vMargin = 0; | - | ||||||||||||||||||||||||
| 1046 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1047 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||
| 1049 | if (aero
| 0 | ||||||||||||||||||||||||
| 1050 | int leftMargin = 18; | - | ||||||||||||||||||||||||
| 1051 | int topMargin = vMargin; | - | ||||||||||||||||||||||||
| 1052 | int rightMargin = hMargin; | - | ||||||||||||||||||||||||
| 1053 | int bottomMargin = vMargin; | - | ||||||||||||||||||||||||
| 1054 | pageFrame->setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin); | - | ||||||||||||||||||||||||
| 1055 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1056 | pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin); | - | ||||||||||||||||||||||||
| 1057 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1058 | - | |||||||||||||||||||||||||
| 1059 | if ((info.watermark
| 0 | ||||||||||||||||||||||||
| 1060 | watermarkLabel = new QWatermarkLabel(antiFlickerWidget, sideWidget); | - | ||||||||||||||||||||||||
| 1061 | watermarkLabel->setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
| 1062 | watermarkLabel->setMinimumHeight(1); | - | ||||||||||||||||||||||||
| 1063 | watermarkLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); | - | ||||||||||||||||||||||||
| 1064 | watermarkLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop); | - | ||||||||||||||||||||||||
| 1065 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1066 | - | |||||||||||||||||||||||||
| 1067 | - | |||||||||||||||||||||||||
| 1068 | const bool wasSemiTransparent = | - | ||||||||||||||||||||||||
| 1069 | pageFrame->palette().brush(QPalette::Window).color().alpha() < 255
| 0 | ||||||||||||||||||||||||
| 1070 | || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255
| 0 | ||||||||||||||||||||||||
| 1071 | if (mac
| 0 | ||||||||||||||||||||||||
| 1072 | if (!wasSemiTransparent
| 0 | ||||||||||||||||||||||||
| 1073 | QPalette pal = pageFrame->palette(); | - | ||||||||||||||||||||||||
| 1074 | pal.setBrush(QPalette::Window, QColor(255, 255, 255, 153)); | - | ||||||||||||||||||||||||
| 1075 | - | |||||||||||||||||||||||||
| 1076 | - | |||||||||||||||||||||||||
| 1077 | pal.setBrush(QPalette::Base, QColor(255, 255, 255, 153)); | - | ||||||||||||||||||||||||
| 1078 | pageFrame->setPalette(pal); | - | ||||||||||||||||||||||||
| 1079 | pageFrame->setAutoFillBackground(true); | - | ||||||||||||||||||||||||
| 1080 | antiFlickerWidget->setAutoFillBackground(false); | - | ||||||||||||||||||||||||
| 1081 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1082 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1083 | if (wasSemiTransparent
| 0 | ||||||||||||||||||||||||
| 1084 | pageFrame->setPalette(QPalette()); never executed: pageFrame->setPalette(QPalette()); | 0 | ||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||
| 1086 | bool baseBackground = (modern
| 0 | ||||||||||||||||||||||||
| 1087 | pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window); | - | ||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||
| 1089 | if (titleLabel
| 0 | ||||||||||||||||||||||||
| 1090 | titleLabel->setAutoFillBackground(baseBackground); never executed: titleLabel->setAutoFillBackground(baseBackground); | 0 | ||||||||||||||||||||||||
| 1091 | pageFrame->setAutoFillBackground(baseBackground); | - | ||||||||||||||||||||||||
| 1092 | if (watermarkLabel
| 0 | ||||||||||||||||||||||||
| 1093 | watermarkLabel->setAutoFillBackground(baseBackground); never executed: watermarkLabel->setAutoFillBackground(baseBackground); | 0 | ||||||||||||||||||||||||
| 1094 | if (placeholderWidget1
| 0 | ||||||||||||||||||||||||
| 1095 | placeholderWidget1->setAutoFillBackground(baseBackground); never executed: placeholderWidget1->setAutoFillBackground(baseBackground); | 0 | ||||||||||||||||||||||||
| 1096 | if (placeholderWidget2
| 0 | ||||||||||||||||||||||||
| 1097 | placeholderWidget2->setAutoFillBackground(baseBackground); never executed: placeholderWidget2->setAutoFillBackground(baseBackground); | 0 | ||||||||||||||||||||||||
| 1098 | - | |||||||||||||||||||||||||
| 1099 | if (aero
| 0 | ||||||||||||||||||||||||
| 1100 | QPalette pal = pageFrame->palette(); | - | ||||||||||||||||||||||||
| 1101 | pal.setBrush(QPalette::Window, QColor(255, 255, 255)); | - | ||||||||||||||||||||||||
| 1102 | pageFrame->setPalette(pal); | - | ||||||||||||||||||||||||
| 1103 | pageFrame->setAutoFillBackground(true); | - | ||||||||||||||||||||||||
| 1104 | pal = antiFlickerWidget->palette(); | - | ||||||||||||||||||||||||
| 1105 | pal.setBrush(QPalette::Window, QColor(255, 255, 255)); | - | ||||||||||||||||||||||||
| 1106 | antiFlickerWidget->setPalette(pal); | - | ||||||||||||||||||||||||
| 1107 | antiFlickerWidget->setAutoFillBackground(true); | - | ||||||||||||||||||||||||
| 1108 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1109 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1110 | - | |||||||||||||||||||||||||
| 1111 | mainLayout->addWidget(pageFrame, row++, pageColumn); | - | ||||||||||||||||||||||||
| 1112 | - | |||||||||||||||||||||||||
| 1113 | int watermarkEndRow = row; | - | ||||||||||||||||||||||||
| 1114 | if (classic
| 0 | ||||||||||||||||||||||||
| 1115 | mainLayout->setRowMinimumHeight(row++, deltaVSpacing); never executed: mainLayout->setRowMinimumHeight(row++, deltaVSpacing); | 0 | ||||||||||||||||||||||||
| 1116 | - | |||||||||||||||||||||||||
| 1117 | if (aero
| 0 | ||||||||||||||||||||||||
| 1118 | buttonLayout->setContentsMargins(9, 9, 9, 9); | - | ||||||||||||||||||||||||
| 1119 | mainLayout->setContentsMargins(0, 11, 0, 0); | - | ||||||||||||||||||||||||
| 1120 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1121 | - | |||||||||||||||||||||||||
| 1122 | int buttonStartColumn = info.extension
| 0 | ||||||||||||||||||||||||
| 1123 | int buttonNumColumns = info.extension
| 0 | ||||||||||||||||||||||||
| 1124 | - | |||||||||||||||||||||||||
| 1125 | if (classic
| 0 | ||||||||||||||||||||||||
| 1126 | if (!bottomRuler
| 0 | ||||||||||||||||||||||||
| 1127 | bottomRuler = new QWizardRuler(antiFlickerWidget); never executed: bottomRuler = new QWizardRuler(antiFlickerWidget); | 0 | ||||||||||||||||||||||||
| 1128 | mainLayout->addWidget(bottomRuler, row++, buttonStartColumn, 1, buttonNumColumns); | - | ||||||||||||||||||||||||
| 1129 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1130 | - | |||||||||||||||||||||||||
| 1131 | if (classic
| 0 | ||||||||||||||||||||||||
| 1132 | mainLayout->setRowMinimumHeight(row++, deltaVSpacing); never executed: mainLayout->setRowMinimumHeight(row++, deltaVSpacing); | 0 | ||||||||||||||||||||||||
| 1133 | - | |||||||||||||||||||||||||
| 1134 | mainLayout->addLayout(buttonLayout, row++, buttonStartColumn, 1, buttonNumColumns); | - | ||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||
| 1136 | if (info.watermark
| 0 | ||||||||||||||||||||||||
| 1137 | if (info.extension
| 0 | ||||||||||||||||||||||||
| 1138 | watermarkEndRow = row; never executed: watermarkEndRow = row; | 0 | ||||||||||||||||||||||||
| 1139 | mainLayout->addWidget(watermarkLabel, watermarkStartRow, 0, | - | ||||||||||||||||||||||||
| 1140 | watermarkEndRow - watermarkStartRow, 1); | - | ||||||||||||||||||||||||
| 1141 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1142 | - | |||||||||||||||||||||||||
| 1143 | mainLayout->setColumnMinimumWidth(0, mac && !info.watermark ? 181 : 0); | - | ||||||||||||||||||||||||
| 1144 | if (mac
| 0 | ||||||||||||||||||||||||
| 1145 | mainLayout->setColumnMinimumWidth(2, 21); never executed: mainLayout->setColumnMinimumWidth(2, 21); | 0 | ||||||||||||||||||||||||
| 1146 | - | |||||||||||||||||||||||||
| 1147 | if (headerWidget
| 0 | ||||||||||||||||||||||||
| 1148 | headerWidget->setVisible(info.header); never executed: headerWidget->setVisible(info.header); | 0 | ||||||||||||||||||||||||
| 1149 | if (titleLabel
| 0 | ||||||||||||||||||||||||
| 1150 | titleLabel->setVisible(info.title); never executed: titleLabel->setVisible(info.title); | 0 | ||||||||||||||||||||||||
| 1151 | if (subTitleLabel
| 0 | ||||||||||||||||||||||||
| 1152 | subTitleLabel->setVisible(info.subTitle); never executed: subTitleLabel->setVisible(info.subTitle); | 0 | ||||||||||||||||||||||||
| 1153 | if (bottomRuler
| 0 | ||||||||||||||||||||||||
| 1154 | bottomRuler->setVisible(classic || modern); never executed: bottomRuler->setVisible(classic || modern); | 0 | ||||||||||||||||||||||||
| 1155 | if (watermarkLabel
| 0 | ||||||||||||||||||||||||
| 1156 | watermarkLabel->setVisible(info.watermark || info.sideWidget); never executed: watermarkLabel->setVisible(info.watermark || info.sideWidget); | 0 | ||||||||||||||||||||||||
| 1157 | - | |||||||||||||||||||||||||
| 1158 | layoutInfo = info; | - | ||||||||||||||||||||||||
| 1159 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1160 | - | |||||||||||||||||||||||||
| 1161 | void QWizardPrivate::updateLayout() | - | ||||||||||||||||||||||||
| 1162 | { | - | ||||||||||||||||||||||||
| 1163 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1164 | - | |||||||||||||||||||||||||
| 1165 | disableUpdates(); | - | ||||||||||||||||||||||||
| 1166 | - | |||||||||||||||||||||||||
| 1167 | QWizardLayoutInfo info = layoutInfoForCurrentPage(); | - | ||||||||||||||||||||||||
| 1168 | if (layoutInfo != info
| 0 | ||||||||||||||||||||||||
| 1169 | recreateLayout(info); never executed: recreateLayout(info); | 0 | ||||||||||||||||||||||||
| 1170 | QWizardPage *page = q->currentPage(); | - | ||||||||||||||||||||||||
| 1171 | - | |||||||||||||||||||||||||
| 1172 | - | |||||||||||||||||||||||||
| 1173 | - | |||||||||||||||||||||||||
| 1174 | - | |||||||||||||||||||||||||
| 1175 | - | |||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||
| 1177 | if (page
| 0 | ||||||||||||||||||||||||
| 1178 | bool expandPage = !page->layout(); | - | ||||||||||||||||||||||||
| 1179 | if (!expandPage
| 0 | ||||||||||||||||||||||||
| 1180 | const QLayoutItem *pageItem = pageVBoxLayout->itemAt(pageVBoxLayout->indexOf(page)); | - | ||||||||||||||||||||||||
| 1181 | expandPage = pageItem->expandingDirections() & Qt::Vertical; | - | ||||||||||||||||||||||||
| 1182 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1183 | QSpacerItem *bottomSpacer = pageVBoxLayout->itemAt(pageVBoxLayout->count() - 1)->spacerItem(); | - | ||||||||||||||||||||||||
| 1184 | ((!(bottomSpacer)) ? qt_assert("bottomSpacer",__FILE__,1295) : qt_noop()); | - | ||||||||||||||||||||||||
| 1185 | bottomSpacer->changeSize(0, 0, QSizePolicy::Ignored, expandPage ? QSizePolicy::Ignored : QSizePolicy::MinimumExpanding); | - | ||||||||||||||||||||||||
| 1186 | pageVBoxLayout->invalidate(); | - | ||||||||||||||||||||||||
| 1187 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1188 | - | |||||||||||||||||||||||||
| 1189 | if (info.header
| 0 | ||||||||||||||||||||||||
| 1190 | ((!(page)) ? qt_assert("page",__FILE__,1301) : qt_noop()); | - | ||||||||||||||||||||||||
| 1191 | headerWidget->setup(info, page->title(), page->subTitle(), | - | ||||||||||||||||||||||||
| 1192 | page->pixmap(QWizard::LogoPixmap), page->pixmap(QWizard::BannerPixmap), | - | ||||||||||||||||||||||||
| 1193 | titleFmt, subTitleFmt); | - | ||||||||||||||||||||||||
| 1194 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1195 | - | |||||||||||||||||||||||||
| 1196 | if (info.watermark
| 0 | ||||||||||||||||||||||||
| 1197 | QPixmap pix; | - | ||||||||||||||||||||||||
| 1198 | if (info.watermark
| 0 | ||||||||||||||||||||||||
| 1199 | if (page
| 0 | ||||||||||||||||||||||||
| 1200 | pix = page->pixmap(QWizard::WatermarkPixmap); never executed: pix = page->pixmap(QWizard::WatermarkPixmap); | 0 | ||||||||||||||||||||||||
| 1201 | else | - | ||||||||||||||||||||||||
| 1202 | pix = q->pixmap(QWizard::WatermarkPixmap); never executed: pix = q->pixmap(QWizard::WatermarkPixmap); | 0 | ||||||||||||||||||||||||
| 1203 | } | - | ||||||||||||||||||||||||
| 1204 | watermarkLabel->setPixmap(pix); | - | ||||||||||||||||||||||||
| 1205 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1206 | - | |||||||||||||||||||||||||
| 1207 | if (info.title
| 0 | ||||||||||||||||||||||||
| 1208 | ((!(page)) ? qt_assert("page",__FILE__,1319) : qt_noop()); | - | ||||||||||||||||||||||||
| 1209 | titleLabel->setTextFormat(titleFmt); | - | ||||||||||||||||||||||||
| 1210 | titleLabel->setText(page->title()); | - | ||||||||||||||||||||||||
| 1211 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1212 | if (info.subTitle
| 0 | ||||||||||||||||||||||||
| 1213 | ((!(page)) ? qt_assert("page",__FILE__,1324) : qt_noop()); | - | ||||||||||||||||||||||||
| 1214 | subTitleLabel->setTextFormat(subTitleFmt); | - | ||||||||||||||||||||||||
| 1215 | subTitleLabel->setText(page->subTitle()); | - | ||||||||||||||||||||||||
| 1216 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||
| 1218 | enableUpdates(); | - | ||||||||||||||||||||||||
| 1219 | updateMinMaxSizes(info); | - | ||||||||||||||||||||||||
| 1220 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1221 | - | |||||||||||||||||||||||||
| 1222 | void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info) | - | ||||||||||||||||||||||||
| 1223 | { | - | ||||||||||||||||||||||||
| 1224 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||
| 1226 | int extraHeight = 0; | - | ||||||||||||||||||||||||
| 1227 | - | |||||||||||||||||||||||||
| 1228 | - | |||||||||||||||||||||||||
| 1229 | - | |||||||||||||||||||||||||
| 1230 | - | |||||||||||||||||||||||||
| 1231 | QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight); | - | ||||||||||||||||||||||||
| 1232 | QSize maximumSize = mainLayout->totalMaximumSize(); | - | ||||||||||||||||||||||||
| 1233 | if (info.header
| 0 | ||||||||||||||||||||||||
| 1234 | minimumSize.setWidth(headerWidget->maximumWidth()); | - | ||||||||||||||||||||||||
| 1235 | maximumSize.setWidth(headerWidget->maximumWidth()); | - | ||||||||||||||||||||||||
| 1236 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1237 | if (info.watermark
| 0 | ||||||||||||||||||||||||
| 1238 | minimumSize.setHeight(mainLayout->totalSizeHint().height()); | - | ||||||||||||||||||||||||
| 1239 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1240 | if (q->minimumWidth() == minimumWidth
| 0 | ||||||||||||||||||||||||
| 1241 | minimumWidth = minimumSize.width(); | - | ||||||||||||||||||||||||
| 1242 | q->setMinimumWidth(minimumWidth); | - | ||||||||||||||||||||||||
| 1243 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1244 | if (q->minimumHeight() == minimumHeight
| 0 | ||||||||||||||||||||||||
| 1245 | minimumHeight = minimumSize.height(); | - | ||||||||||||||||||||||||
| 1246 | q->setMinimumHeight(minimumHeight); | - | ||||||||||||||||||||||||
| 1247 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1248 | if (q->maximumWidth() == maximumWidth
| 0 | ||||||||||||||||||||||||
| 1249 | maximumWidth = maximumSize.width(); | - | ||||||||||||||||||||||||
| 1250 | q->setMaximumWidth(maximumWidth); | - | ||||||||||||||||||||||||
| 1251 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1252 | if (q->maximumHeight() == maximumHeight
| 0 | ||||||||||||||||||||||||
| 1253 | maximumHeight = maximumSize.height(); | - | ||||||||||||||||||||||||
| 1254 | q->setMaximumHeight(maximumHeight); | - | ||||||||||||||||||||||||
| 1255 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1256 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1257 | - | |||||||||||||||||||||||||
| 1258 | void QWizardPrivate::updateCurrentPage() | - | ||||||||||||||||||||||||
| 1259 | { | - | ||||||||||||||||||||||||
| 1260 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1261 | if (q->currentPage()
| 0 | ||||||||||||||||||||||||
| 1262 | canContinue = (q->nextId() != -1); | - | ||||||||||||||||||||||||
| 1263 | canFinish = q->currentPage()->isFinalPage(); | - | ||||||||||||||||||||||||
| 1264 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1265 | canContinue = false; | - | ||||||||||||||||||||||||
| 1266 | canFinish = false; | - | ||||||||||||||||||||||||
| 1267 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1268 | _q_updateButtonStates(); | - | ||||||||||||||||||||||||
| 1269 | updateButtonTexts(); | - | ||||||||||||||||||||||||
| 1270 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1271 | - | |||||||||||||||||||||||||
| 1272 | static QString object_name_for_button(QWizard::WizardButton which) | - | ||||||||||||||||||||||||
| 1273 | { | - | ||||||||||||||||||||||||
| 1274 | switch (which) { | - | ||||||||||||||||||||||||
| 1275 | case never executed: QWizard::CommitButton:case QWizard::CommitButton:never executed: case QWizard::CommitButton: | 0 | ||||||||||||||||||||||||
| 1276 | return never executed: QLatin1String("qt_wizard_") + QLatin1String("commit");return QLatin1String("qt_wizard_") + QLatin1String("commit");never executed: return QLatin1String("qt_wizard_") + QLatin1String("commit"); | 0 | ||||||||||||||||||||||||
| 1277 | case never executed: QWizard::FinishButton:case QWizard::FinishButton:never executed: case QWizard::FinishButton: | 0 | ||||||||||||||||||||||||
| 1278 | return never executed: QLatin1String("qt_wizard_") + QLatin1String("finish");return QLatin1String("qt_wizard_") + QLatin1String("finish");never executed: return QLatin1String("qt_wizard_") + QLatin1String("finish"); | 0 | ||||||||||||||||||||||||
| 1279 | case never executed: QWizard::CancelButton:case QWizard::CancelButton:never executed: case QWizard::CancelButton: | 0 | ||||||||||||||||||||||||
| 1280 | return never executed: QLatin1String("qt_wizard_") + QLatin1String("cancel");return QLatin1String("qt_wizard_") + QLatin1String("cancel");never executed: return QLatin1String("qt_wizard_") + QLatin1String("cancel"); | 0 | ||||||||||||||||||||||||
| 1281 | case never executed: QWizard::BackButton:case QWizard::BackButton:never executed: case QWizard::BackButton: | 0 | ||||||||||||||||||||||||
| 1282 | case never executed: QWizard::NextButton:case QWizard::NextButton:never executed: case QWizard::NextButton: | 0 | ||||||||||||||||||||||||
| 1283 | case never executed: QWizard::HelpButton:case QWizard::HelpButton:never executed: case QWizard::HelpButton: | 0 | ||||||||||||||||||||||||
| 1284 | case never executed: QWizard::CustomButton1:case QWizard::CustomButton1:never executed: case QWizard::CustomButton1: | 0 | ||||||||||||||||||||||||
| 1285 | case never executed: QWizard::CustomButton2:case QWizard::CustomButton2:never executed: case QWizard::CustomButton2: | 0 | ||||||||||||||||||||||||
| 1286 | case never executed: QWizard::CustomButton3:case QWizard::CustomButton3:never executed: case QWizard::CustomButton3: | 0 | ||||||||||||||||||||||||
| 1287 | - | |||||||||||||||||||||||||
| 1288 | return never executed: QLatin1String("__qt__passive_wizardbutton") + QString::number(which);return QLatin1String("__qt__passive_wizardbutton") + QString::number(which);never executed: return QLatin1String("__qt__passive_wizardbutton") + QString::number(which); | 0 | ||||||||||||||||||||||||
| 1289 | case never executed: QWizard::Stretch:case QWizard::Stretch:never executed: case QWizard::Stretch: | 0 | ||||||||||||||||||||||||
| 1290 | case never executed: QWizard::NoButton:case QWizard::NoButton:never executed: case QWizard::NoButton: | 0 | ||||||||||||||||||||||||
| 1291 | - | |||||||||||||||||||||||||
| 1292 | - | |||||||||||||||||||||||||
| 1293 | ; | - | ||||||||||||||||||||||||
| 1294 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1295 | do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,1406) : qt_noop()); __builtin_unreachable(); } while (0); | - | ||||||||||||||||||||||||
| 1296 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 1297 | } | - | ||||||||||||||||||||||||
| 1298 | - | |||||||||||||||||||||||||
| 1299 | bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const | - | ||||||||||||||||||||||||
| 1300 | { | - | ||||||||||||||||||||||||
| 1301 | const QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1302 | if (uint(which) >= QWizard::NButtons
| 0 | ||||||||||||||||||||||||
| 1303 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1304 | - | |||||||||||||||||||||||||
| 1305 | if (!btns[which]
| 0 | ||||||||||||||||||||||||
| 1306 | QPushButton *pushButton = new QPushButton(antiFlickerWidget); | - | ||||||||||||||||||||||||
| 1307 | QStyle *style = q->style(); | - | ||||||||||||||||||||||||
| 1308 | if (style != QApplication::style()
| 0 | ||||||||||||||||||||||||
| 1309 | pushButton->setStyle(style); never executed: pushButton->setStyle(style); | 0 | ||||||||||||||||||||||||
| 1310 | pushButton->setObjectName(object_name_for_button(which)); | - | ||||||||||||||||||||||||
| 1311 | - | |||||||||||||||||||||||||
| 1312 | - | |||||||||||||||||||||||||
| 1313 | - | |||||||||||||||||||||||||
| 1314 | pushButton->hide(); | - | ||||||||||||||||||||||||
| 1315 | - | |||||||||||||||||||||||||
| 1316 | - | |||||||||||||||||||||||||
| 1317 | - | |||||||||||||||||||||||||
| 1318 | btns[which] = pushButton; | - | ||||||||||||||||||||||||
| 1319 | - | |||||||||||||||||||||||||
| 1320 | if (which < QWizard::NStandardButtons
| 0 | ||||||||||||||||||||||||
| 1321 | pushButton->setText(buttonDefaultText(wizStyle, which, this)); never executed: pushButton->setText(buttonDefaultText(wizStyle, which, this)); | 0 | ||||||||||||||||||||||||
| 1322 | - | |||||||||||||||||||||||||
| 1323 | connectButton(which); | - | ||||||||||||||||||||||||
| 1324 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1325 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1326 | } | - | ||||||||||||||||||||||||
| 1327 | - | |||||||||||||||||||||||||
| 1328 | void QWizardPrivate::connectButton(QWizard::WizardButton which) const | - | ||||||||||||||||||||||||
| 1329 | { | - | ||||||||||||||||||||||||
| 1330 | const QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1331 | if (which < QWizard::NStandardButtons
| 0 | ||||||||||||||||||||||||
| 1332 | QObject::connect(btns[which], qFlagLocation("2""clicked()" "\0" __FILE__ ":" "1443"), q, buttonSlots(which)); | - | ||||||||||||||||||||||||
| 1333 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1334 | QObject::connect(btns[which], qFlagLocation("2""clicked()" "\0" __FILE__ ":" "1445"), q, qFlagLocation("1""_q_emitCustomButtonClicked()" "\0" __FILE__ ":" "1445")); | - | ||||||||||||||||||||||||
| 1335 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1336 | } | - | ||||||||||||||||||||||||
| 1337 | - | |||||||||||||||||||||||||
| 1338 | void QWizardPrivate::updateButtonTexts() | - | ||||||||||||||||||||||||
| 1339 | { | - | ||||||||||||||||||||||||
| 1340 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1341 | for (int i = 0; i < QWizard::NButtons
| 0 | ||||||||||||||||||||||||
| 1342 | if (btns[i]
| 0 | ||||||||||||||||||||||||
| 1343 | if (q->currentPage()
| 0 | ||||||||||||||||||||||||
| 1344 | btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i)); never executed: btns[i]->setText(q->currentPage()->d_func()->buttonCustomTexts.value(i)); | 0 | ||||||||||||||||||||||||
| 1345 | else if (buttonCustomTexts.contains(i)
| 0 | ||||||||||||||||||||||||
| 1346 | btns[i]->setText(buttonCustomTexts.value(i)); never executed: btns[i]->setText(buttonCustomTexts.value(i)); | 0 | ||||||||||||||||||||||||
| 1347 | else if (i < QWizard::NStandardButtons
| 0 | ||||||||||||||||||||||||
| 1348 | btns[i]->setText(buttonDefaultText(wizStyle, i, this)); never executed: btns[i]->setText(buttonDefaultText(wizStyle, i, this)); | 0 | ||||||||||||||||||||||||
| 1349 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1350 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1351 | - | |||||||||||||||||||||||||
| 1352 | - | |||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||
| 1354 | if (btns[QWizard::NextButton]
| 0 | ||||||||||||||||||||||||
| 1355 | btns[QWizard::NextButton]->setShortcut(isVistaThemeEnabled() ? QKeySequence(Qt::ALT | Qt::Key_Right) : QKeySequence()); never executed: btns[QWizard::NextButton]->setShortcut(isVistaThemeEnabled() ? QKeySequence(Qt::ALT | Qt::Key_Right) : QKeySequence()); | 0 | ||||||||||||||||||||||||
| 1356 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1357 | - | |||||||||||||||||||||||||
| 1358 | void QWizardPrivate::updateButtonLayout() | - | ||||||||||||||||||||||||
| 1359 | { | - | ||||||||||||||||||||||||
| 1360 | if (buttonsHaveCustomLayout
| 0 | ||||||||||||||||||||||||
| 1361 | QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array(buttonsCustomLayout.count()); | - | ||||||||||||||||||||||||
| 1362 | for (int i = 0; i < buttonsCustomLayout.count()
| 0 | ||||||||||||||||||||||||
| 1363 | array[i] = buttonsCustomLayout.at(i); never executed: array[i] = buttonsCustomLayout.at(i); | 0 | ||||||||||||||||||||||||
| 1364 | setButtonLayout(array.constData(), array.count()); | - | ||||||||||||||||||||||||
| 1365 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1366 | - | |||||||||||||||||||||||||
| 1367 | - | |||||||||||||||||||||||||
| 1368 | - | |||||||||||||||||||||||||
| 1369 | const int ArraySize = 12; | - | ||||||||||||||||||||||||
| 1370 | QWizard::WizardButton array[ArraySize]; | - | ||||||||||||||||||||||||
| 1371 | memset(array, -1, sizeof(array)); | - | ||||||||||||||||||||||||
| 1372 | ((!(array[0] == QWizard::NoButton)) ? qt_assert("array[0] == QWizard::NoButton",__FILE__,1483) : qt_noop()); | - | ||||||||||||||||||||||||
| 1373 | - | |||||||||||||||||||||||||
| 1374 | if (opts & QWizard::HaveHelpButton
| 0 | ||||||||||||||||||||||||
| 1375 | int i = (
| 0 | ||||||||||||||||||||||||
| 1376 | array[i] = QWizard::HelpButton; | - | ||||||||||||||||||||||||
| 1377 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1378 | array[1] = QWizard::Stretch; | - | ||||||||||||||||||||||||
| 1379 | if (opts & QWizard::HaveCustomButton1
| 0 | ||||||||||||||||||||||||
| 1380 | array[2] = QWizard::CustomButton1; never executed: array[2] = QWizard::CustomButton1; | 0 | ||||||||||||||||||||||||
| 1381 | if (opts & QWizard::HaveCustomButton2
| 0 | ||||||||||||||||||||||||
| 1382 | array[3] = QWizard::CustomButton2; never executed: array[3] = QWizard::CustomButton2; | 0 | ||||||||||||||||||||||||
| 1383 | if (opts & QWizard::HaveCustomButton3
| 0 | ||||||||||||||||||||||||
| 1384 | array[4] = QWizard::CustomButton3; never executed: array[4] = QWizard::CustomButton3; | 0 | ||||||||||||||||||||||||
| 1385 | - | |||||||||||||||||||||||||
| 1386 | if (!(opts & QWizard::NoCancelButton)
| 0 | ||||||||||||||||||||||||
| 1387 | int i = (
| 0 | ||||||||||||||||||||||||
| 1388 | array[i] = QWizard::CancelButton; | - | ||||||||||||||||||||||||
| 1389 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1390 | array[6] = QWizard::BackButton; | - | ||||||||||||||||||||||||
| 1391 | array[7] = QWizard::NextButton; | - | ||||||||||||||||||||||||
| 1392 | array[8] = QWizard::CommitButton; | - | ||||||||||||||||||||||||
| 1393 | array[9] = QWizard::FinishButton; | - | ||||||||||||||||||||||||
| 1394 | - | |||||||||||||||||||||||||
| 1395 | setButtonLayout(array, ArraySize); | - | ||||||||||||||||||||||||
| 1396 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1397 | } | - | ||||||||||||||||||||||||
| 1398 | - | |||||||||||||||||||||||||
| 1399 | void QWizardPrivate::setButtonLayout(const QWizard::WizardButton *array, int size) | - | ||||||||||||||||||||||||
| 1400 | { | - | ||||||||||||||||||||||||
| 1401 | QWidget *prev = pageFrame; | - | ||||||||||||||||||||||||
| 1402 | - | |||||||||||||||||||||||||
| 1403 | for (int i = buttonLayout->count() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 1404 | QLayoutItem *item = buttonLayout->takeAt(i); | - | ||||||||||||||||||||||||
| 1405 | if (QWidget *widget = item->widget()
| 0 | ||||||||||||||||||||||||
| 1406 | widget->hide(); never executed: widget->hide(); | 0 | ||||||||||||||||||||||||
| 1407 | delete item; | - | ||||||||||||||||||||||||
| 1408 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1409 | - | |||||||||||||||||||||||||
| 1410 | for (int i = 0; i < size
| 0 | ||||||||||||||||||||||||
| 1411 | QWizard::WizardButton which = array[i]; | - | ||||||||||||||||||||||||
| 1412 | if (which == QWizard::Stretch
| 0 | ||||||||||||||||||||||||
| 1413 | buttonLayout->addStretch(1); | - | ||||||||||||||||||||||||
| 1414 | } never executed: else if (which != QWizard::NoButtonend of block
| 0 | ||||||||||||||||||||||||
| 1415 | ensureButton(which); | - | ||||||||||||||||||||||||
| 1416 | buttonLayout->addWidget(btns[which]); | - | ||||||||||||||||||||||||
| 1417 | - | |||||||||||||||||||||||||
| 1418 | - | |||||||||||||||||||||||||
| 1419 | if (which != QWizard::BackButton
| 0 | ||||||||||||||||||||||||
| 1420 | && which != QWizard::CommitButton
| 0 | ||||||||||||||||||||||||
| 1421 | btns[which]->show(); never executed: btns[which]->show(); | 0 | ||||||||||||||||||||||||
| 1422 | - | |||||||||||||||||||||||||
| 1423 | if (prev
| 0 | ||||||||||||||||||||||||
| 1424 | QWidget::setTabOrder(prev, btns[which]); never executed: QWidget::setTabOrder(prev, btns[which]); | 0 | ||||||||||||||||||||||||
| 1425 | prev = btns[which]; | - | ||||||||||||||||||||||||
| 1426 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1427 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1428 | - | |||||||||||||||||||||||||
| 1429 | _q_updateButtonStates(); | - | ||||||||||||||||||||||||
| 1430 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1431 | - | |||||||||||||||||||||||||
| 1432 | bool QWizardPrivate::buttonLayoutContains(QWizard::WizardButton which) | - | ||||||||||||||||||||||||
| 1433 | { | - | ||||||||||||||||||||||||
| 1434 | return never executed: !buttonsHaveCustomLayoutreturn !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
never executed: return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which); | 0 | ||||||||||||||||||||||||
| 1435 | } | - | ||||||||||||||||||||||||
| 1436 | - | |||||||||||||||||||||||||
| 1437 | void QWizardPrivate::updatePixmap(QWizard::WizardPixmap which) | - | ||||||||||||||||||||||||
| 1438 | { | - | ||||||||||||||||||||||||
| 1439 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1440 | if (which == QWizard::BackgroundPixmap
| 0 | ||||||||||||||||||||||||
| 1441 | if (wizStyle == QWizard::MacStyle
| 0 | ||||||||||||||||||||||||
| 1442 | q->update(); | - | ||||||||||||||||||||||||
| 1443 | q->updateGeometry(); | - | ||||||||||||||||||||||||
| 1444 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1445 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1446 | updateLayout(); | - | ||||||||||||||||||||||||
| 1447 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1448 | } | - | ||||||||||||||||||||||||
| 1449 | bool QWizardPrivate::isVistaThemeEnabled() const | - | ||||||||||||||||||||||||
| 1450 | { | - | ||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||
| 1452 | - | |||||||||||||||||||||||||
| 1453 | - | |||||||||||||||||||||||||
| 1454 | - | |||||||||||||||||||||||||
| 1455 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1456 | - | |||||||||||||||||||||||||
| 1457 | } | - | ||||||||||||||||||||||||
| 1458 | - | |||||||||||||||||||||||||
| 1459 | void QWizardPrivate::disableUpdates() | - | ||||||||||||||||||||||||
| 1460 | { | - | ||||||||||||||||||||||||
| 1461 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1462 | if (disableUpdatesCount++ == 0
| 0 | ||||||||||||||||||||||||
| 1463 | q->setUpdatesEnabled(false); | - | ||||||||||||||||||||||||
| 1464 | antiFlickerWidget->hide(); | - | ||||||||||||||||||||||||
| 1465 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1466 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1467 | - | |||||||||||||||||||||||||
| 1468 | void QWizardPrivate::enableUpdates() | - | ||||||||||||||||||||||||
| 1469 | { | - | ||||||||||||||||||||||||
| 1470 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1471 | if (--
| 0 | ||||||||||||||||||||||||
| 1472 | antiFlickerWidget->show(); | - | ||||||||||||||||||||||||
| 1473 | q->setUpdatesEnabled(true); | - | ||||||||||||||||||||||||
| 1474 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1475 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1476 | - | |||||||||||||||||||||||||
| 1477 | void QWizardPrivate::_q_emitCustomButtonClicked() | - | ||||||||||||||||||||||||
| 1478 | { | - | ||||||||||||||||||||||||
| 1479 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1480 | QObject *button = q->sender(); | - | ||||||||||||||||||||||||
| 1481 | for (int i = QWizard::NStandardButtons; i < QWizard::NButtons
| 0 | ||||||||||||||||||||||||
| 1482 | if (btns[i] == button
| 0 | ||||||||||||||||||||||||
| 1483 | q->customButtonClicked(QWizard::WizardButton(i)); | - | ||||||||||||||||||||||||
| 1484 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1485 | } | - | ||||||||||||||||||||||||
| 1486 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1487 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1488 | - | |||||||||||||||||||||||||
| 1489 | void QWizardPrivate::_q_updateButtonStates() | - | ||||||||||||||||||||||||
| 1490 | { | - | ||||||||||||||||||||||||
| 1491 | QWizard * const q = q_func(); | - | ||||||||||||||||||||||||
| 1492 | - | |||||||||||||||||||||||||
| 1493 | disableUpdates(); | - | ||||||||||||||||||||||||
| 1494 | - | |||||||||||||||||||||||||
| 1495 | const QWizardPage *page = q->currentPage(); | - | ||||||||||||||||||||||||
| 1496 | bool complete = page
| 0 | ||||||||||||||||||||||||
| 1497 | - | |||||||||||||||||||||||||
| 1498 | btn.back->setEnabled(history.count() > 1 | - | ||||||||||||||||||||||||
| 1499 | && !q->page(history.at(history.count() - 2))->isCommitPage() | - | ||||||||||||||||||||||||
| 1500 | && (!canFinish || !(opts & QWizard::DisabledBackButtonOnLastPage))); | - | ||||||||||||||||||||||||
| 1501 | btn.next->setEnabled(canContinue && complete); | - | ||||||||||||||||||||||||
| 1502 | btn.commit->setEnabled(canContinue && complete); | - | ||||||||||||||||||||||||
| 1503 | btn.finish->setEnabled(canFinish && complete); | - | ||||||||||||||||||||||||
| 1504 | - | |||||||||||||||||||||||||
| 1505 | const bool backButtonVisible = buttonLayoutContains(QWizard::BackButton)
| 0 | ||||||||||||||||||||||||
| 1506 | && (history.count() > 1
| 0 | ||||||||||||||||||||||||
| 1507 | && (canContinue
| 0 | ||||||||||||||||||||||||
| 1508 | bool commitPage = page
| 0 | ||||||||||||||||||||||||
| 1509 | btn.back->setVisible(backButtonVisible); | - | ||||||||||||||||||||||||
| 1510 | btn.next->setVisible(buttonLayoutContains(QWizard::NextButton) && !commitPage | - | ||||||||||||||||||||||||
| 1511 | && (canContinue || (opts & QWizard::HaveNextButtonOnLastPage))); | - | ||||||||||||||||||||||||
| 1512 | btn.commit->setVisible(buttonLayoutContains(QWizard::CommitButton) && commitPage | - | ||||||||||||||||||||||||
| 1513 | && canContinue); | - | ||||||||||||||||||||||||
| 1514 | btn.finish->setVisible(buttonLayoutContains(QWizard::FinishButton) | - | ||||||||||||||||||||||||
| 1515 | && (canFinish || (opts & QWizard::HaveFinishButtonOnEarlyPages))); | - | ||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||
| 1517 | if (!(opts & QWizard::NoCancelButton)
| 0 | ||||||||||||||||||||||||
| 1518 | btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton) never executed: btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton) && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage))); | 0 | ||||||||||||||||||||||||
| 1519 | && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage))); never executed: btn.cancel->setVisible(buttonLayoutContains(QWizard::CancelButton) && (canContinue || !(opts & QWizard::NoCancelButtonOnLastPage))); | 0 | ||||||||||||||||||||||||
| 1520 | - | |||||||||||||||||||||||||
| 1521 | bool useDefault = !(opts & QWizard::NoDefaultButton); | - | ||||||||||||||||||||||||
| 1522 | if (QPushButton *nextPush = qobject_cast<QPushButton *>(btn.next)
| 0 | ||||||||||||||||||||||||
| 1523 | nextPush->setDefault(canContinue && useDefault && !commitPage); never executed: nextPush->setDefault(canContinue && useDefault && !commitPage); | 0 | ||||||||||||||||||||||||
| 1524 | if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit)
| 0 | ||||||||||||||||||||||||
| 1525 | commitPush->setDefault(canContinue && useDefault && commitPage); never executed: commitPush->setDefault(canContinue && useDefault && commitPage); | 0 | ||||||||||||||||||||||||
| 1526 | if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish)
| 0 | ||||||||||||||||||||||||
| 1527 | finishPush->setDefault(!canContinue && useDefault); never executed: finishPush->setDefault(!canContinue && useDefault); | 0 | ||||||||||||||||||||||||
| 1528 | enableUpdates(); | - | ||||||||||||||||||||||||
| 1529 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1530 | - | |||||||||||||||||||||||||
| 1531 | void QWizardPrivate::_q_handleFieldObjectDestroyed(QObject *object) | - | ||||||||||||||||||||||||
| 1532 | { | - | ||||||||||||||||||||||||
| 1533 | int destroyed_index = -1; | - | ||||||||||||||||||||||||
| 1534 | QVector<QWizardField>::iterator it = fields.begin(); | - | ||||||||||||||||||||||||
| 1535 | while (it != fields.end()
| 0 | ||||||||||||||||||||||||
| 1536 | const QWizardField &field = *it; | - | ||||||||||||||||||||||||
| 1537 | if (field.object == object
| 0 | ||||||||||||||||||||||||
| 1538 | destroyed_index = fieldIndexMap.value(field.name, -1); | - | ||||||||||||||||||||||||
| 1539 | fieldIndexMap.remove(field.name); | - | ||||||||||||||||||||||||
| 1540 | it = fields.erase(it); | - | ||||||||||||||||||||||||
| 1541 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1542 | ++it; | - | ||||||||||||||||||||||||
| 1543 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1544 | } | - | ||||||||||||||||||||||||
| 1545 | if (destroyed_index != -1
| 0 | ||||||||||||||||||||||||
| 1546 | QMap<QString, int>::iterator it2 = fieldIndexMap.begin(); | - | ||||||||||||||||||||||||
| 1547 | while (it2 != fieldIndexMap.end()
| 0 | ||||||||||||||||||||||||
| 1548 | int index = it2.value(); | - | ||||||||||||||||||||||||
| 1549 | if (index > destroyed_index
| 0 | ||||||||||||||||||||||||
| 1550 | QString field_name = it2.key(); | - | ||||||||||||||||||||||||
| 1551 | fieldIndexMap.insert(field_name, index-1); | - | ||||||||||||||||||||||||
| 1552 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1553 | ++it2; | - | ||||||||||||||||||||||||
| 1554 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1555 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1556 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||
| 1558 | void QWizardPrivate::setStyle(QStyle *style) | - | ||||||||||||||||||||||||
| 1559 | { | - | ||||||||||||||||||||||||
| 1560 | for (int i = 0; i < QWizard::NButtons
| 0 | ||||||||||||||||||||||||
| 1561 | if (btns[i]
| 0 | ||||||||||||||||||||||||
| 1562 | btns[i]->setStyle(style); never executed: btns[i]->setStyle(style); | 0 | ||||||||||||||||||||||||
| 1563 | const PageMap::const_iterator pcend = pageMap.constEnd(); | - | ||||||||||||||||||||||||
| 1564 | for (PageMap::const_iterator it = pageMap.constBegin(); it != pcend
| 0 | ||||||||||||||||||||||||
| 1565 | it.value()->setStyle(style); never executed: it.value()->setStyle(style); | 0 | ||||||||||||||||||||||||
| 1566 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1567 | QWizard::QWizard(QWidget *parent, Qt::WindowFlags flags) | - | ||||||||||||||||||||||||
| 1568 | : QDialog(*new QWizardPrivate, parent, flags) | - | ||||||||||||||||||||||||
| 1569 | { | - | ||||||||||||||||||||||||
| 1570 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1571 | d->init(); | - | ||||||||||||||||||||||||
| 1572 | - | |||||||||||||||||||||||||
| 1573 | - | |||||||||||||||||||||||||
| 1574 | - | |||||||||||||||||||||||||
| 1575 | - | |||||||||||||||||||||||||
| 1576 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1577 | - | |||||||||||||||||||||||||
| 1578 | - | |||||||||||||||||||||||||
| 1579 | - | |||||||||||||||||||||||||
| 1580 | - | |||||||||||||||||||||||||
| 1581 | QWizard::~QWizard() | - | ||||||||||||||||||||||||
| 1582 | { | - | ||||||||||||||||||||||||
| 1583 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1584 | delete d->buttonLayout; | - | ||||||||||||||||||||||||
| 1585 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1586 | int QWizard::addPage(QWizardPage *page) | - | ||||||||||||||||||||||||
| 1587 | { | - | ||||||||||||||||||||||||
| 1588 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1589 | int theid = 0; | - | ||||||||||||||||||||||||
| 1590 | if (!d->pageMap.isEmpty()
| 0 | ||||||||||||||||||||||||
| 1591 | theid = (d->pageMap.constEnd() - 1).key() + 1; never executed: theid = (d->pageMap.constEnd() - 1).key() + 1; | 0 | ||||||||||||||||||||||||
| 1592 | setPage(theid, page); | - | ||||||||||||||||||||||||
| 1593 | return never executed: theid;return theid;never executed: return theid; | 0 | ||||||||||||||||||||||||
| 1594 | } | - | ||||||||||||||||||||||||
| 1595 | void QWizard::setPage(int theid, QWizardPage *page) | - | ||||||||||||||||||||||||
| 1596 | { | - | ||||||||||||||||||||||||
| 1597 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1598 | - | |||||||||||||||||||||||||
| 1599 | if (!page
| 0 | ||||||||||||||||||||||||
| 1600 | QMessageLogger(__FILE__, 2260, __PRETTY_FUNCTION__).warning("QWizard::setPage: Cannot insert null page"); | - | ||||||||||||||||||||||||
| 1601 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1602 | } | - | ||||||||||||||||||||||||
| 1603 | - | |||||||||||||||||||||||||
| 1604 | if (theid == -1
| 0 | ||||||||||||||||||||||||
| 1605 | QMessageLogger(__FILE__, 2265, __PRETTY_FUNCTION__).warning("QWizard::setPage: Cannot insert page with ID -1"); | - | ||||||||||||||||||||||||
| 1606 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1607 | } | - | ||||||||||||||||||||||||
| 1608 | - | |||||||||||||||||||||||||
| 1609 | if (d->pageMap.contains(theid)
| 0 | ||||||||||||||||||||||||
| 1610 | QMessageLogger(__FILE__, 2270, __PRETTY_FUNCTION__).warning("QWizard::setPage: Page with duplicate ID %d ignored", theid); | - | ||||||||||||||||||||||||
| 1611 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1612 | } | - | ||||||||||||||||||||||||
| 1613 | - | |||||||||||||||||||||||||
| 1614 | page->setParent(d->pageFrame); | - | ||||||||||||||||||||||||
| 1615 | - | |||||||||||||||||||||||||
| 1616 | QVector<QWizardField> &pendingFields = page->d_func()->pendingFields; | - | ||||||||||||||||||||||||
| 1617 | for (int i = 0; i < pendingFields.count()
| 0 | ||||||||||||||||||||||||
| 1618 | d->addField(pendingFields.at(i)); never executed: d->addField(pendingFields.at(i)); | 0 | ||||||||||||||||||||||||
| 1619 | pendingFields.clear(); | - | ||||||||||||||||||||||||
| 1620 | - | |||||||||||||||||||||||||
| 1621 | connect(page, qFlagLocation("2""completeChanged()" "\0" __FILE__ ":" "2281"), this, qFlagLocation("1""_q_updateButtonStates()" "\0" __FILE__ ":" "2281")); | - | ||||||||||||||||||||||||
| 1622 | - | |||||||||||||||||||||||||
| 1623 | d->pageMap.insert(theid, page); | - | ||||||||||||||||||||||||
| 1624 | page->d_func()->wizard = this; | - | ||||||||||||||||||||||||
| 1625 | - | |||||||||||||||||||||||||
| 1626 | int n = d->pageVBoxLayout->count(); | - | ||||||||||||||||||||||||
| 1627 | - | |||||||||||||||||||||||||
| 1628 | - | |||||||||||||||||||||||||
| 1629 | bool pageVBoxLayoutEnabled = d->pageVBoxLayout->isEnabled(); | - | ||||||||||||||||||||||||
| 1630 | d->pageVBoxLayout->setEnabled(false); | - | ||||||||||||||||||||||||
| 1631 | - | |||||||||||||||||||||||||
| 1632 | d->pageVBoxLayout->insertWidget(n - 1, page); | - | ||||||||||||||||||||||||
| 1633 | - | |||||||||||||||||||||||||
| 1634 | - | |||||||||||||||||||||||||
| 1635 | page->hide(); | - | ||||||||||||||||||||||||
| 1636 | d->pageVBoxLayout->setEnabled(pageVBoxLayoutEnabled); | - | ||||||||||||||||||||||||
| 1637 | - | |||||||||||||||||||||||||
| 1638 | if (!d->startSetByUser
| 0 | ||||||||||||||||||||||||
| 1639 | d->start = theid; never executed: d->start = theid; | 0 | ||||||||||||||||||||||||
| 1640 | pageAdded(theid); | - | ||||||||||||||||||||||||
| 1641 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1642 | void QWizard::removePage(int id) | - | ||||||||||||||||||||||||
| 1643 | { | - | ||||||||||||||||||||||||
| 1644 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1645 | - | |||||||||||||||||||||||||
| 1646 | QWizardPage *removedPage = 0; | - | ||||||||||||||||||||||||
| 1647 | - | |||||||||||||||||||||||||
| 1648 | - | |||||||||||||||||||||||||
| 1649 | if (d->pageMap.count() > 0
| 0 | ||||||||||||||||||||||||
| 1650 | if (d->start == id
| 0 | ||||||||||||||||||||||||
| 1651 | const int firstId = d->pageMap.constBegin().key(); | - | ||||||||||||||||||||||||
| 1652 | if (firstId == id
| 0 | ||||||||||||||||||||||||
| 1653 | if (d->pageMap.count() > 1
| 0 | ||||||||||||||||||||||||
| 1654 | d->start = (++d->pageMap.constBegin()).key(); never executed: d->start = (++d->pageMap.constBegin()).key(); | 0 | ||||||||||||||||||||||||
| 1655 | else | - | ||||||||||||||||||||||||
| 1656 | d->start = -1; never executed: d->start = -1; | 0 | ||||||||||||||||||||||||
| 1657 | } else { | - | ||||||||||||||||||||||||
| 1658 | d->start = firstId; | - | ||||||||||||||||||||||||
| 1659 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1660 | d->startSetByUser = false; | - | ||||||||||||||||||||||||
| 1661 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1662 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1663 | - | |||||||||||||||||||||||||
| 1664 | if (d->pageMap.contains(id)
| 0 | ||||||||||||||||||||||||
| 1665 | pageRemoved(id); never executed: pageRemoved(id); | 0 | ||||||||||||||||||||||||
| 1666 | - | |||||||||||||||||||||||||
| 1667 | if (!d->history.contains(id)
| 0 | ||||||||||||||||||||||||
| 1668 | - | |||||||||||||||||||||||||
| 1669 | removedPage = d->pageMap.take(id); | - | ||||||||||||||||||||||||
| 1670 | d->updateCurrentPage(); | - | ||||||||||||||||||||||||
| 1671 | } never executed: else if (id != d->currentend of block
| 0 | ||||||||||||||||||||||||
| 1672 | - | |||||||||||||||||||||||||
| 1673 | removedPage = d->pageMap.take(id); | - | ||||||||||||||||||||||||
| 1674 | d->history.removeOne(id); | - | ||||||||||||||||||||||||
| 1675 | d->_q_updateButtonStates(); | - | ||||||||||||||||||||||||
| 1676 | } never executed: else if (d->history.count() == 1end of block
| 0 | ||||||||||||||||||||||||
| 1677 | - | |||||||||||||||||||||||||
| 1678 | d->reset(); | - | ||||||||||||||||||||||||
| 1679 | removedPage = d->pageMap.take(id); | - | ||||||||||||||||||||||||
| 1680 | if (d->pageMap.isEmpty()
| 0 | ||||||||||||||||||||||||
| 1681 | d->updateCurrentPage(); never executed: d->updateCurrentPage(); | 0 | ||||||||||||||||||||||||
| 1682 | else | - | ||||||||||||||||||||||||
| 1683 | restart(); never executed: restart(); | 0 | ||||||||||||||||||||||||
| 1684 | } else { | - | ||||||||||||||||||||||||
| 1685 | - | |||||||||||||||||||||||||
| 1686 | back(); | - | ||||||||||||||||||||||||
| 1687 | removedPage = d->pageMap.take(id); | - | ||||||||||||||||||||||||
| 1688 | d->updateCurrentPage(); | - | ||||||||||||||||||||||||
| 1689 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1690 | - | |||||||||||||||||||||||||
| 1691 | if (removedPage
| 0 | ||||||||||||||||||||||||
| 1692 | if (d->initialized.contains(id)
| 0 | ||||||||||||||||||||||||
| 1693 | cleanupPage(id); | - | ||||||||||||||||||||||||
| 1694 | d->initialized.remove(id); | - | ||||||||||||||||||||||||
| 1695 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1696 | - | |||||||||||||||||||||||||
| 1697 | d->pageVBoxLayout->removeWidget(removedPage); | - | ||||||||||||||||||||||||
| 1698 | - | |||||||||||||||||||||||||
| 1699 | for (int i = d->fields.count() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 1700 | if (d->fields.at(i).page == removedPage
| 0 | ||||||||||||||||||||||||
| 1701 | removedPage->d_func()->pendingFields += d->fields.at(i); | - | ||||||||||||||||||||||||
| 1702 | d->removeFieldAt(i); | - | ||||||||||||||||||||||||
| 1703 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1704 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1705 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1706 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1707 | QWizardPage *QWizard::page(int theid) const | - | ||||||||||||||||||||||||
| 1708 | { | - | ||||||||||||||||||||||||
| 1709 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1710 | return never executed: d->pageMap.value(theid);return d->pageMap.value(theid);never executed: return d->pageMap.value(theid); | 0 | ||||||||||||||||||||||||
| 1711 | } | - | ||||||||||||||||||||||||
| 1712 | bool QWizard::hasVisitedPage(int theid) const | - | ||||||||||||||||||||||||
| 1713 | { | - | ||||||||||||||||||||||||
| 1714 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1715 | return never executed: d->history.contains(theid);return d->history.contains(theid);never executed: return d->history.contains(theid); | 0 | ||||||||||||||||||||||||
| 1716 | } | - | ||||||||||||||||||||||||
| 1717 | QList<int> QWizard::visitedPages() const | - | ||||||||||||||||||||||||
| 1718 | { | - | ||||||||||||||||||||||||
| 1719 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1720 | return never executed: d->history;return d->history;never executed: return d->history; | 0 | ||||||||||||||||||||||||
| 1721 | } | - | ||||||||||||||||||||||||
| 1722 | - | |||||||||||||||||||||||||
| 1723 | - | |||||||||||||||||||||||||
| 1724 | - | |||||||||||||||||||||||||
| 1725 | - | |||||||||||||||||||||||||
| 1726 | - | |||||||||||||||||||||||||
| 1727 | QList<int> QWizard::pageIds() const | - | ||||||||||||||||||||||||
| 1728 | { | - | ||||||||||||||||||||||||
| 1729 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1730 | return never executed: d->pageMap.keys();return d->pageMap.keys();never executed: return d->pageMap.keys(); | 0 | ||||||||||||||||||||||||
| 1731 | } | - | ||||||||||||||||||||||||
| 1732 | void QWizard::setStartId(int theid) | - | ||||||||||||||||||||||||
| 1733 | { | - | ||||||||||||||||||||||||
| 1734 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1735 | int newStart = theid; | - | ||||||||||||||||||||||||
| 1736 | if (theid == -1
| 0 | ||||||||||||||||||||||||
| 1737 | newStart = d->pageMap.count()
never executed: newStart = d->pageMap.count() ? d->pageMap.constBegin().key() : -1; | 0 | ||||||||||||||||||||||||
| 1738 | - | |||||||||||||||||||||||||
| 1739 | if (d->start == newStart
| 0 | ||||||||||||||||||||||||
| 1740 | d->startSetByUser = theid != -1; | - | ||||||||||||||||||||||||
| 1741 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1742 | } | - | ||||||||||||||||||||||||
| 1743 | - | |||||||||||||||||||||||||
| 1744 | if (!d->pageMap.contains(newStart)
| 0 | ||||||||||||||||||||||||
| 1745 | QMessageLogger(__FILE__, 2454, __PRETTY_FUNCTION__).warning("QWizard::setStartId: Invalid page ID %d", newStart); | - | ||||||||||||||||||||||||
| 1746 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1747 | } | - | ||||||||||||||||||||||||
| 1748 | d->start = newStart; | - | ||||||||||||||||||||||||
| 1749 | d->startSetByUser = theid != -1; | - | ||||||||||||||||||||||||
| 1750 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1751 | - | |||||||||||||||||||||||||
| 1752 | int QWizard::startId() const | - | ||||||||||||||||||||||||
| 1753 | { | - | ||||||||||||||||||||||||
| 1754 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1755 | return never executed: d->start;return d->start;never executed: return d->start; | 0 | ||||||||||||||||||||||||
| 1756 | } | - | ||||||||||||||||||||||||
| 1757 | QWizardPage *QWizard::currentPage() const | - | ||||||||||||||||||||||||
| 1758 | { | - | ||||||||||||||||||||||||
| 1759 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1760 | return never executed: page(d->current);return page(d->current);never executed: return page(d->current); | 0 | ||||||||||||||||||||||||
| 1761 | } | - | ||||||||||||||||||||||||
| 1762 | int QWizard::currentId() const | - | ||||||||||||||||||||||||
| 1763 | { | - | ||||||||||||||||||||||||
| 1764 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1765 | return never executed: d->current;return d->current;never executed: return d->current; | 0 | ||||||||||||||||||||||||
| 1766 | } | - | ||||||||||||||||||||||||
| 1767 | void QWizard::setField(const QString &name, const QVariant &value) | - | ||||||||||||||||||||||||
| 1768 | { | - | ||||||||||||||||||||||||
| 1769 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1770 | - | |||||||||||||||||||||||||
| 1771 | int index = d->fieldIndexMap.value(name, -1); | - | ||||||||||||||||||||||||
| 1772 | if (index != -1
| 0 | ||||||||||||||||||||||||
| 1773 | const QWizardField &field = d->fields.at(index); | - | ||||||||||||||||||||||||
| 1774 | if (!field.object->setProperty(field.property, value)
| 0 | ||||||||||||||||||||||||
| 1775 | QMessageLogger(__FILE__, 2514, __PRETTY_FUNCTION__).warning("QWizard::setField: Couldn't write to property '%s'", never executed: QMessageLogger(__FILE__, 2514, __PRETTY_FUNCTION__).warning("QWizard::setField: Couldn't write to property '%s'", field.property.constData()); | 0 | ||||||||||||||||||||||||
| 1776 | field.property.constData()); never executed: QMessageLogger(__FILE__, 2514, __PRETTY_FUNCTION__).warning("QWizard::setField: Couldn't write to property '%s'", field.property.constData()); | 0 | ||||||||||||||||||||||||
| 1777 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1778 | } | - | ||||||||||||||||||||||||
| 1779 | - | |||||||||||||||||||||||||
| 1780 | QMessageLogger(__FILE__, 2519, __PRETTY_FUNCTION__).warning("QWizard::setField: No such field '%s'", QString(name).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||
| 1781 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1782 | QVariant QWizard::field(const QString &name) const | - | ||||||||||||||||||||||||
| 1783 | { | - | ||||||||||||||||||||||||
| 1784 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1785 | - | |||||||||||||||||||||||||
| 1786 | int index = d->fieldIndexMap.value(name, -1); | - | ||||||||||||||||||||||||
| 1787 | if (index != -1
| 0 | ||||||||||||||||||||||||
| 1788 | const QWizardField &field = d->fields.at(index); | - | ||||||||||||||||||||||||
| 1789 | return never executed: field.object->property(field.property);return field.object->property(field.property);never executed: return field.object->property(field.property); | 0 | ||||||||||||||||||||||||
| 1790 | } | - | ||||||||||||||||||||||||
| 1791 | - | |||||||||||||||||||||||||
| 1792 | QMessageLogger(__FILE__, 2539, __PRETTY_FUNCTION__).warning("QWizard::field: No such field '%s'", QString(name).toLocal8Bit().constData()); | - | ||||||||||||||||||||||||
| 1793 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||||||||||||||
| 1794 | } | - | ||||||||||||||||||||||||
| 1795 | void QWizard::setWizardStyle(WizardStyle style) | - | ||||||||||||||||||||||||
| 1796 | { | - | ||||||||||||||||||||||||
| 1797 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1798 | - | |||||||||||||||||||||||||
| 1799 | const bool styleChange = style != d->wizStyle; | - | ||||||||||||||||||||||||
| 1800 | if (styleChange
| 0 | ||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||
| 1802 | - | |||||||||||||||||||||||||
| 1803 | - | |||||||||||||||||||||||||
| 1804 | ) { | - | ||||||||||||||||||||||||
| 1805 | d->disableUpdates(); | - | ||||||||||||||||||||||||
| 1806 | d->wizStyle = style; | - | ||||||||||||||||||||||||
| 1807 | d->updateButtonTexts(); | - | ||||||||||||||||||||||||
| 1808 | d->updateLayout(); | - | ||||||||||||||||||||||||
| 1809 | updateGeometry(); | - | ||||||||||||||||||||||||
| 1810 | d->enableUpdates(); | - | ||||||||||||||||||||||||
| 1811 | - | |||||||||||||||||||||||||
| 1812 | - | |||||||||||||||||||||||||
| 1813 | - | |||||||||||||||||||||||||
| 1814 | - | |||||||||||||||||||||||||
| 1815 | - | |||||||||||||||||||||||||
| 1816 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1817 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1818 | - | |||||||||||||||||||||||||
| 1819 | QWizard::WizardStyle QWizard::wizardStyle() const | - | ||||||||||||||||||||||||
| 1820 | { | - | ||||||||||||||||||||||||
| 1821 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1822 | return never executed: d->wizStyle;return d->wizStyle;never executed: return d->wizStyle; | 0 | ||||||||||||||||||||||||
| 1823 | } | - | ||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||
| 1825 | - | |||||||||||||||||||||||||
| 1826 | - | |||||||||||||||||||||||||
| 1827 | - | |||||||||||||||||||||||||
| 1828 | - | |||||||||||||||||||||||||
| 1829 | - | |||||||||||||||||||||||||
| 1830 | - | |||||||||||||||||||||||||
| 1831 | void QWizard::setOption(WizardOption option, bool on) | - | ||||||||||||||||||||||||
| 1832 | { | - | ||||||||||||||||||||||||
| 1833 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1834 | if (!(d->opts & option) != !on
| 0 | ||||||||||||||||||||||||
| 1835 | setOptions(d->opts ^ option); never executed: setOptions(d->opts ^ option); | 0 | ||||||||||||||||||||||||
| 1836 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||
| 1838 | - | |||||||||||||||||||||||||
| 1839 | - | |||||||||||||||||||||||||
| 1840 | - | |||||||||||||||||||||||||
| 1841 | - | |||||||||||||||||||||||||
| 1842 | - | |||||||||||||||||||||||||
| 1843 | - | |||||||||||||||||||||||||
| 1844 | bool QWizard::testOption(WizardOption option) const | - | ||||||||||||||||||||||||
| 1845 | { | - | ||||||||||||||||||||||||
| 1846 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1847 | return never executed: (d->opts & option) != 0;return (d->opts & option) != 0;never executed: return (d->opts & option) != 0; | 0 | ||||||||||||||||||||||||
| 1848 | } | - | ||||||||||||||||||||||||
| 1849 | void QWizard::setOptions(WizardOptions options) | - | ||||||||||||||||||||||||
| 1850 | { | - | ||||||||||||||||||||||||
| 1851 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1852 | - | |||||||||||||||||||||||||
| 1853 | WizardOptions changed = (options ^ d->opts); | - | ||||||||||||||||||||||||
| 1854 | if (!changed
| 0 | ||||||||||||||||||||||||
| 1855 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1856 | - | |||||||||||||||||||||||||
| 1857 | d->disableUpdates(); | - | ||||||||||||||||||||||||
| 1858 | - | |||||||||||||||||||||||||
| 1859 | d->opts = options; | - | ||||||||||||||||||||||||
| 1860 | if ((
| 0 | ||||||||||||||||||||||||
| 1861 | d->cleanupPagesNotInHistory(); never executed: d->cleanupPagesNotInHistory(); | 0 | ||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||
| 1863 | if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
| 0 | ||||||||||||||||||||||||
| 1864 | | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
| 0 | ||||||||||||||||||||||||
| 1865 | | HaveCustomButton3)
| 0 | ||||||||||||||||||||||||
| 1866 | d->updateButtonLayout(); | - | ||||||||||||||||||||||||
| 1867 | } never executed: else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPageend of block
| 0 | ||||||||||||||||||||||||
| 1868 | | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
| 0 | ||||||||||||||||||||||||
| 1869 | | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)
| 0 | ||||||||||||||||||||||||
| 1870 | d->_q_updateButtonStates(); | - | ||||||||||||||||||||||||
| 1871 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1872 | - | |||||||||||||||||||||||||
| 1873 | d->enableUpdates(); | - | ||||||||||||||||||||||||
| 1874 | d->updateLayout(); | - | ||||||||||||||||||||||||
| 1875 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1876 | - | |||||||||||||||||||||||||
| 1877 | QWizard::WizardOptions QWizard::options() const | - | ||||||||||||||||||||||||
| 1878 | { | - | ||||||||||||||||||||||||
| 1879 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1880 | return never executed: d->opts;return d->opts;never executed: return d->opts; | 0 | ||||||||||||||||||||||||
| 1881 | } | - | ||||||||||||||||||||||||
| 1882 | void QWizard::setButtonText(WizardButton which, const QString &text) | - | ||||||||||||||||||||||||
| 1883 | { | - | ||||||||||||||||||||||||
| 1884 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1885 | - | |||||||||||||||||||||||||
| 1886 | if (!d->ensureButton(which)
| 0 | ||||||||||||||||||||||||
| 1887 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1888 | - | |||||||||||||||||||||||||
| 1889 | d->buttonCustomTexts.insert(which, text); | - | ||||||||||||||||||||||||
| 1890 | - | |||||||||||||||||||||||||
| 1891 | if (!currentPage()
| 0 | ||||||||||||||||||||||||
| 1892 | d->btns[which]->setText(text); never executed: d->btns[which]->setText(text); | 0 | ||||||||||||||||||||||||
| 1893 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1894 | QString QWizard::buttonText(WizardButton which) const | - | ||||||||||||||||||||||||
| 1895 | { | - | ||||||||||||||||||||||||
| 1896 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1897 | - | |||||||||||||||||||||||||
| 1898 | if (!d->ensureButton(which)
| 0 | ||||||||||||||||||||||||
| 1899 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 1900 | - | |||||||||||||||||||||||||
| 1901 | if (d->buttonCustomTexts.contains(which)
| 0 | ||||||||||||||||||||||||
| 1902 | return never executed: d->buttonCustomTexts.value(which);return d->buttonCustomTexts.value(which);never executed: return d->buttonCustomTexts.value(which); | 0 | ||||||||||||||||||||||||
| 1903 | - | |||||||||||||||||||||||||
| 1904 | const QString defText = buttonDefaultText(d->wizStyle, which, d); | - | ||||||||||||||||||||||||
| 1905 | if(!defText.isNull()
| 0 | ||||||||||||||||||||||||
| 1906 | return never executed: defText;return defText;never executed: return defText; | 0 | ||||||||||||||||||||||||
| 1907 | - | |||||||||||||||||||||||||
| 1908 | return never executed: d->btns[which]->text();return d->btns[which]->text();never executed: return d->btns[which]->text(); | 0 | ||||||||||||||||||||||||
| 1909 | } | - | ||||||||||||||||||||||||
| 1910 | void QWizard::setButtonLayout(const QList<WizardButton> &layout) | - | ||||||||||||||||||||||||
| 1911 | { | - | ||||||||||||||||||||||||
| 1912 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1913 | - | |||||||||||||||||||||||||
| 1914 | for (int i = 0; i < layout.count()
| 0 | ||||||||||||||||||||||||
| 1915 | WizardButton button1 = layout.at(i); | - | ||||||||||||||||||||||||
| 1916 | - | |||||||||||||||||||||||||
| 1917 | if (button1 == NoButton
| 0 | ||||||||||||||||||||||||
| 1918 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 1919 | if (!d->ensureButton(button1)
| 0 | ||||||||||||||||||||||||
| 1920 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1921 | - | |||||||||||||||||||||||||
| 1922 | - | |||||||||||||||||||||||||
| 1923 | for (int j = 0; j < i
| 0 | ||||||||||||||||||||||||
| 1924 | WizardButton button2 = layout.at(j); | - | ||||||||||||||||||||||||
| 1925 | if (button2 == button1
| 0 | ||||||||||||||||||||||||
| 1926 | QMessageLogger(__FILE__, 2767, __PRETTY_FUNCTION__).warning("QWizard::setButtonLayout: Duplicate button in layout"); | - | ||||||||||||||||||||||||
| 1927 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1928 | } | - | ||||||||||||||||||||||||
| 1929 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1930 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1931 | - | |||||||||||||||||||||||||
| 1932 | d->buttonsHaveCustomLayout = true; | - | ||||||||||||||||||||||||
| 1933 | d->buttonsCustomLayout = layout; | - | ||||||||||||||||||||||||
| 1934 | d->updateButtonLayout(); | - | ||||||||||||||||||||||||
| 1935 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1936 | void QWizard::setButton(WizardButton which, QAbstractButton *button) | - | ||||||||||||||||||||||||
| 1937 | { | - | ||||||||||||||||||||||||
| 1938 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1939 | - | |||||||||||||||||||||||||
| 1940 | if (uint(which) >= NButtons
| 0 | ||||||||||||||||||||||||
| 1941 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1942 | - | |||||||||||||||||||||||||
| 1943 | if (QAbstractButton *oldButton = d->btns[which]
| 0 | ||||||||||||||||||||||||
| 1944 | d->buttonLayout->removeWidget(oldButton); | - | ||||||||||||||||||||||||
| 1945 | delete oldButton; | - | ||||||||||||||||||||||||
| 1946 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1947 | - | |||||||||||||||||||||||||
| 1948 | d->btns[which] = button; | - | ||||||||||||||||||||||||
| 1949 | if (button
| 0 | ||||||||||||||||||||||||
| 1950 | button->setParent(d->antiFlickerWidget); | - | ||||||||||||||||||||||||
| 1951 | d->buttonCustomTexts.insert(which, button->text()); | - | ||||||||||||||||||||||||
| 1952 | d->connectButton(which); | - | ||||||||||||||||||||||||
| 1953 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1954 | d->buttonCustomTexts.remove(which); | - | ||||||||||||||||||||||||
| 1955 | d->ensureButton(which); | - | ||||||||||||||||||||||||
| 1956 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1957 | - | |||||||||||||||||||||||||
| 1958 | d->updateButtonLayout(); | - | ||||||||||||||||||||||||
| 1959 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1960 | - | |||||||||||||||||||||||||
| 1961 | - | |||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||
| 1963 | - | |||||||||||||||||||||||||
| 1964 | - | |||||||||||||||||||||||||
| 1965 | - | |||||||||||||||||||||||||
| 1966 | QAbstractButton *QWizard::button(WizardButton which) const | - | ||||||||||||||||||||||||
| 1967 | { | - | ||||||||||||||||||||||||
| 1968 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1969 | - | |||||||||||||||||||||||||
| 1970 | - | |||||||||||||||||||||||||
| 1971 | - | |||||||||||||||||||||||||
| 1972 | - | |||||||||||||||||||||||||
| 1973 | if (!d->ensureButton(which)
| 0 | ||||||||||||||||||||||||
| 1974 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 1975 | return never executed: d->btns[which];return d->btns[which];never executed: return d->btns[which]; | 0 | ||||||||||||||||||||||||
| 1976 | } | - | ||||||||||||||||||||||||
| 1977 | void QWizard::setTitleFormat(Qt::TextFormat format) | - | ||||||||||||||||||||||||
| 1978 | { | - | ||||||||||||||||||||||||
| 1979 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1980 | d->titleFmt = format; | - | ||||||||||||||||||||||||
| 1981 | d->updateLayout(); | - | ||||||||||||||||||||||||
| 1982 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1983 | - | |||||||||||||||||||||||||
| 1984 | Qt::TextFormat QWizard::titleFormat() const | - | ||||||||||||||||||||||||
| 1985 | { | - | ||||||||||||||||||||||||
| 1986 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1987 | return never executed: d->titleFmt;return d->titleFmt;never executed: return d->titleFmt; | 0 | ||||||||||||||||||||||||
| 1988 | } | - | ||||||||||||||||||||||||
| 1989 | void QWizard::setSubTitleFormat(Qt::TextFormat format) | - | ||||||||||||||||||||||||
| 1990 | { | - | ||||||||||||||||||||||||
| 1991 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1992 | d->subTitleFmt = format; | - | ||||||||||||||||||||||||
| 1993 | d->updateLayout(); | - | ||||||||||||||||||||||||
| 1994 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1995 | - | |||||||||||||||||||||||||
| 1996 | Qt::TextFormat QWizard::subTitleFormat() const | - | ||||||||||||||||||||||||
| 1997 | { | - | ||||||||||||||||||||||||
| 1998 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1999 | return never executed: d->subTitleFmt;return d->subTitleFmt;never executed: return d->subTitleFmt; | 0 | ||||||||||||||||||||||||
| 2000 | } | - | ||||||||||||||||||||||||
| 2001 | void QWizard::setPixmap(WizardPixmap which, const QPixmap &pixmap) | - | ||||||||||||||||||||||||
| 2002 | { | - | ||||||||||||||||||||||||
| 2003 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2004 | ((!(uint(which) < NPixmaps)) ? qt_assert("uint(which) < NPixmaps",__FILE__,2887) : qt_noop()); | - | ||||||||||||||||||||||||
| 2005 | d->defaultPixmaps[which] = pixmap; | - | ||||||||||||||||||||||||
| 2006 | d->updatePixmap(which); | - | ||||||||||||||||||||||||
| 2007 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2008 | QPixmap QWizard::pixmap(WizardPixmap which) const | - | ||||||||||||||||||||||||
| 2009 | { | - | ||||||||||||||||||||||||
| 2010 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2011 | ((!(uint(which) < NPixmaps)) ? qt_assert("uint(which) < NPixmaps",__FILE__,2903) : qt_noop()); | - | ||||||||||||||||||||||||
| 2012 | - | |||||||||||||||||||||||||
| 2013 | - | |||||||||||||||||||||||||
| 2014 | - | |||||||||||||||||||||||||
| 2015 | - | |||||||||||||||||||||||||
| 2016 | return never executed: d->defaultPixmaps[which];return d->defaultPixmaps[which];never executed: return d->defaultPixmaps[which]; | 0 | ||||||||||||||||||||||||
| 2017 | } | - | ||||||||||||||||||||||||
| 2018 | void QWizard::setDefaultProperty(const char *className, const char *property, | - | ||||||||||||||||||||||||
| 2019 | const char *changedSignal) | - | ||||||||||||||||||||||||
| 2020 | { | - | ||||||||||||||||||||||||
| 2021 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2022 | for (int i = d->defaultPropertyTable.count() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 2023 | if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0
| 0 | ||||||||||||||||||||||||
| 2024 | d->defaultPropertyTable.remove(i); | - | ||||||||||||||||||||||||
| 2025 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2026 | } | - | ||||||||||||||||||||||||
| 2027 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2028 | d->defaultPropertyTable.append(QWizardDefaultProperty(className, property, changedSignal)); | - | ||||||||||||||||||||||||
| 2029 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2030 | void QWizard::setSideWidget(QWidget *widget) | - | ||||||||||||||||||||||||
| 2031 | { | - | ||||||||||||||||||||||||
| 2032 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2033 | - | |||||||||||||||||||||||||
| 2034 | d->sideWidget = widget; | - | ||||||||||||||||||||||||
| 2035 | if (d->watermarkLabel
| 0 | ||||||||||||||||||||||||
| 2036 | d->watermarkLabel->setSideWidget(widget); | - | ||||||||||||||||||||||||
| 2037 | d->updateLayout(); | - | ||||||||||||||||||||||||
| 2038 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2039 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2040 | QWidget *QWizard::sideWidget() const | - | ||||||||||||||||||||||||
| 2041 | { | - | ||||||||||||||||||||||||
| 2042 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2043 | - | |||||||||||||||||||||||||
| 2044 | return never executed: d->sideWidget;return d->sideWidget;never executed: return d->sideWidget; | 0 | ||||||||||||||||||||||||
| 2045 | } | - | ||||||||||||||||||||||||
| 2046 | - | |||||||||||||||||||||||||
| 2047 | - | |||||||||||||||||||||||||
| 2048 | - | |||||||||||||||||||||||||
| 2049 | - | |||||||||||||||||||||||||
| 2050 | void QWizard::setVisible(bool visible) | - | ||||||||||||||||||||||||
| 2051 | { | - | ||||||||||||||||||||||||
| 2052 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2053 | if (visible
| 0 | ||||||||||||||||||||||||
| 2054 | if (d->current == -1
| 0 | ||||||||||||||||||||||||
| 2055 | restart(); never executed: restart(); | 0 | ||||||||||||||||||||||||
| 2056 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2057 | QDialog::setVisible(visible); | - | ||||||||||||||||||||||||
| 2058 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2059 | - | |||||||||||||||||||||||||
| 2060 | - | |||||||||||||||||||||||||
| 2061 | - | |||||||||||||||||||||||||
| 2062 | - | |||||||||||||||||||||||||
| 2063 | QSize QWizard::sizeHint() const | - | ||||||||||||||||||||||||
| 2064 | { | - | ||||||||||||||||||||||||
| 2065 | const QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2066 | QSize result = d->mainLayout->totalSizeHint(); | - | ||||||||||||||||||||||||
| 2067 | QSize extra(500, 360); | - | ||||||||||||||||||||||||
| 2068 | if (d->wizStyle == MacStyle
| 0 | ||||||||||||||||||||||||
| 2069 | QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size()); | - | ||||||||||||||||||||||||
| 2070 | extra.setWidth(616); | - | ||||||||||||||||||||||||
| 2071 | if (!pixmap.isNull()
| 0 | ||||||||||||||||||||||||
| 2072 | extra.setHeight(pixmap.height()); | - | ||||||||||||||||||||||||
| 2073 | - | |||||||||||||||||||||||||
| 2074 | - | |||||||||||||||||||||||||
| 2075 | - | |||||||||||||||||||||||||
| 2076 | - | |||||||||||||||||||||||||
| 2077 | - | |||||||||||||||||||||||||
| 2078 | - | |||||||||||||||||||||||||
| 2079 | - | |||||||||||||||||||||||||
| 2080 | if (pixmap.width() >= pixmap.height()
| 0 | ||||||||||||||||||||||||
| 2081 | extra.setWidth(pixmap.width()); never executed: extra.setWidth(pixmap.width()); | 0 | ||||||||||||||||||||||||
| 2082 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2083 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2084 | return never executed: result.expandedTo(extra);return result.expandedTo(extra);never executed: return result.expandedTo(extra); | 0 | ||||||||||||||||||||||||
| 2085 | } | - | ||||||||||||||||||||||||
| 2086 | void QWizard::back() | - | ||||||||||||||||||||||||
| 2087 | { | - | ||||||||||||||||||||||||
| 2088 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2089 | int n = d->history.count() - 2; | - | ||||||||||||||||||||||||
| 2090 | if (n < 0
| 0 | ||||||||||||||||||||||||
| 2091 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2092 | d->switchToPage(d->history.at(n), QWizardPrivate::Backward); | - | ||||||||||||||||||||||||
| 2093 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2094 | void QWizard::next() | - | ||||||||||||||||||||||||
| 2095 | { | - | ||||||||||||||||||||||||
| 2096 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2097 | - | |||||||||||||||||||||||||
| 2098 | if (d->current == -1
| 0 | ||||||||||||||||||||||||
| 2099 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2100 | - | |||||||||||||||||||||||||
| 2101 | if (validateCurrentPage()
| 0 | ||||||||||||||||||||||||
| 2102 | int next = nextId(); | - | ||||||||||||||||||||||||
| 2103 | if (next != -1
| 0 | ||||||||||||||||||||||||
| 2104 | if (d->history.contains(next)
| 0 | ||||||||||||||||||||||||
| 2105 | QMessageLogger(__FILE__, 3144, __PRETTY_FUNCTION__).warning("QWizard::next: Page %d already met", next); | - | ||||||||||||||||||||||||
| 2106 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2107 | } | - | ||||||||||||||||||||||||
| 2108 | if (!d->pageMap.contains(next)
| 0 | ||||||||||||||||||||||||
| 2109 | QMessageLogger(__FILE__, 3148, __PRETTY_FUNCTION__).warning("QWizard::next: No such page %d", next); | - | ||||||||||||||||||||||||
| 2110 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2111 | } | - | ||||||||||||||||||||||||
| 2112 | d->switchToPage(next, QWizardPrivate::Forward); | - | ||||||||||||||||||||||||
| 2113 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2114 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2115 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2116 | - | |||||||||||||||||||||||||
| 2117 | - | |||||||||||||||||||||||||
| 2118 | - | |||||||||||||||||||||||||
| 2119 | - | |||||||||||||||||||||||||
| 2120 | - | |||||||||||||||||||||||||
| 2121 | - | |||||||||||||||||||||||||
| 2122 | - | |||||||||||||||||||||||||
| 2123 | void QWizard::restart() | - | ||||||||||||||||||||||||
| 2124 | { | - | ||||||||||||||||||||||||
| 2125 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2126 | d->disableUpdates(); | - | ||||||||||||||||||||||||
| 2127 | d->reset(); | - | ||||||||||||||||||||||||
| 2128 | d->switchToPage(startId(), QWizardPrivate::Forward); | - | ||||||||||||||||||||||||
| 2129 | d->enableUpdates(); | - | ||||||||||||||||||||||||
| 2130 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2131 | - | |||||||||||||||||||||||||
| 2132 | - | |||||||||||||||||||||||||
| 2133 | - | |||||||||||||||||||||||||
| 2134 | - | |||||||||||||||||||||||||
| 2135 | bool QWizard::event(QEvent *event) | - | ||||||||||||||||||||||||
| 2136 | { | - | ||||||||||||||||||||||||
| 2137 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2138 | if (event->type() == QEvent::StyleChange
| 0 | ||||||||||||||||||||||||
| 2139 | d->setStyle(style()); | - | ||||||||||||||||||||||||
| 2140 | d->updateLayout(); | - | ||||||||||||||||||||||||
| 2141 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2142 | return never executed: QDialog::event(event);return QDialog::event(event);never executed: return QDialog::event(event); | 0 | ||||||||||||||||||||||||
| 2143 | } | - | ||||||||||||||||||||||||
| 2144 | - | |||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||
| 2146 | - | |||||||||||||||||||||||||
| 2147 | - | |||||||||||||||||||||||||
| 2148 | void QWizard::resizeEvent(QResizeEvent *event) | - | ||||||||||||||||||||||||
| 2149 | { | - | ||||||||||||||||||||||||
| 2150 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2151 | int heightOffset = 0; | - | ||||||||||||||||||||||||
| 2152 | - | |||||||||||||||||||||||||
| 2153 | - | |||||||||||||||||||||||||
| 2154 | - | |||||||||||||||||||||||||
| 2155 | - | |||||||||||||||||||||||||
| 2156 | - | |||||||||||||||||||||||||
| 2157 | - | |||||||||||||||||||||||||
| 2158 | - | |||||||||||||||||||||||||
| 2159 | d->antiFlickerWidget->resize(event->size().width(), event->size().height() - heightOffset); | - | ||||||||||||||||||||||||
| 2160 | - | |||||||||||||||||||||||||
| 2161 | - | |||||||||||||||||||||||||
| 2162 | - | |||||||||||||||||||||||||
| 2163 | - | |||||||||||||||||||||||||
| 2164 | QDialog::resizeEvent(event); | - | ||||||||||||||||||||||||
| 2165 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||
| 2167 | - | |||||||||||||||||||||||||
| 2168 | - | |||||||||||||||||||||||||
| 2169 | - | |||||||||||||||||||||||||
| 2170 | void QWizard::paintEvent(QPaintEvent * event) | - | ||||||||||||||||||||||||
| 2171 | { | - | ||||||||||||||||||||||||
| 2172 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2173 | if (d->wizStyle == MacStyle
| 0 | ||||||||||||||||||||||||
| 2174 | QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap); | - | ||||||||||||||||||||||||
| 2175 | if (backgroundPixmap.isNull()
| 0 | ||||||||||||||||||||||||
| 2176 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2177 | - | |||||||||||||||||||||||||
| 2178 | QPainter painter(this); | - | ||||||||||||||||||||||||
| 2179 | painter.drawPixmap(0, (height() - backgroundPixmap.height()) / 2, backgroundPixmap); | - | ||||||||||||||||||||||||
| 2180 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2181 | (void)event;; | - | ||||||||||||||||||||||||
| 2182 | - | |||||||||||||||||||||||||
| 2183 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2184 | void QWizard::done(int result) | - | ||||||||||||||||||||||||
| 2185 | { | - | ||||||||||||||||||||||||
| 2186 | QWizardPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2187 | - | |||||||||||||||||||||||||
| 2188 | if (result == Rejected
| 0 | ||||||||||||||||||||||||
| 2189 | d->reset(); | - | ||||||||||||||||||||||||
| 2190 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2191 | if (!validateCurrentPage()
| 0 | ||||||||||||||||||||||||
| 2192 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2193 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2194 | QDialog::done(result); | - | ||||||||||||||||||||||||
| 2195 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2196 | void QWizard::initializePage(int theid) | - | ||||||||||||||||||||||||
| 2197 | { | - | ||||||||||||||||||||||||
| 2198 | QWizardPage *page = this->page(theid); | - | ||||||||||||||||||||||||
| 2199 | if (page
| 0 | ||||||||||||||||||||||||
| 2200 | page->initializePage(); never executed: page->initializePage(); | 0 | ||||||||||||||||||||||||
| 2201 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2202 | void QWizard::cleanupPage(int theid) | - | ||||||||||||||||||||||||
| 2203 | { | - | ||||||||||||||||||||||||
| 2204 | QWizardPage *page = this->page(theid); | - | ||||||||||||||||||||||||
| 2205 | if (page
| 0 | ||||||||||||||||||||||||
| 2206 | page->cleanupPage(); never executed: page->cleanupPage(); | 0 | ||||||||||||||||||||||||
| 2207 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2208 | bool QWizard::validateCurrentPage() | - | ||||||||||||||||||||||||
| 2209 | { | - | ||||||||||||||||||||||||
| 2210 | QWizardPage *page = currentPage(); | - | ||||||||||||||||||||||||
| 2211 | if (!page
| 0 | ||||||||||||||||||||||||
| 2212 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2213 | - | |||||||||||||||||||||||||
| 2214 | return never executed: page->validatePage();return page->validatePage();never executed: return page->validatePage(); | 0 | ||||||||||||||||||||||||
| 2215 | } | - | ||||||||||||||||||||||||
| 2216 | int QWizard::nextId() const | - | ||||||||||||||||||||||||
| 2217 | { | - | ||||||||||||||||||||||||
| 2218 | const QWizardPage *page = currentPage(); | - | ||||||||||||||||||||||||
| 2219 | if (!page
| 0 | ||||||||||||||||||||||||
| 2220 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 2221 | - | |||||||||||||||||||||||||
| 2222 | return never executed: page->nextId();return page->nextId();never executed: return page->nextId(); | 0 | ||||||||||||||||||||||||
| 2223 | } | - | ||||||||||||||||||||||||
| 2224 | QWizardPage::QWizardPage(QWidget *parent) | - | ||||||||||||||||||||||||
| 2225 | : QWidget(*new QWizardPagePrivate, parent, 0) | - | ||||||||||||||||||||||||
| 2226 | { | - | ||||||||||||||||||||||||
| 2227 | connect(this, qFlagLocation("2""completeChanged()" "\0" __FILE__ ":" "3472"), this, qFlagLocation("1""_q_updateCachedCompleteState()" "\0" __FILE__ ":" "3472")); | - | ||||||||||||||||||||||||
| 2228 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2229 | - | |||||||||||||||||||||||||
| 2230 | - | |||||||||||||||||||||||||
| 2231 | - | |||||||||||||||||||||||||
| 2232 | - | |||||||||||||||||||||||||
| 2233 | QWizardPage::~QWizardPage() | - | ||||||||||||||||||||||||
| 2234 | { | - | ||||||||||||||||||||||||
| 2235 | } | - | ||||||||||||||||||||||||
| 2236 | void QWizardPage::setTitle(const QString &title) | - | ||||||||||||||||||||||||
| 2237 | { | - | ||||||||||||||||||||||||
| 2238 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2239 | d->title = title; | - | ||||||||||||||||||||||||
| 2240 | if (d->wizard
| 0 | ||||||||||||||||||||||||
| 2241 | d->wizard->d_func()->updateLayout(); never executed: d->wizard->d_func()->updateLayout(); | 0 | ||||||||||||||||||||||||
| 2242 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2243 | - | |||||||||||||||||||||||||
| 2244 | QString QWizardPage::title() const | - | ||||||||||||||||||||||||
| 2245 | { | - | ||||||||||||||||||||||||
| 2246 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2247 | return never executed: d->title;return d->title;never executed: return d->title; | 0 | ||||||||||||||||||||||||
| 2248 | } | - | ||||||||||||||||||||||||
| 2249 | void QWizardPage::setSubTitle(const QString &subTitle) | - | ||||||||||||||||||||||||
| 2250 | { | - | ||||||||||||||||||||||||
| 2251 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2252 | d->subTitle = subTitle; | - | ||||||||||||||||||||||||
| 2253 | if (d->wizard
| 0 | ||||||||||||||||||||||||
| 2254 | d->wizard->d_func()->updateLayout(); never executed: d->wizard->d_func()->updateLayout(); | 0 | ||||||||||||||||||||||||
| 2255 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2256 | - | |||||||||||||||||||||||||
| 2257 | QString QWizardPage::subTitle() const | - | ||||||||||||||||||||||||
| 2258 | { | - | ||||||||||||||||||||||||
| 2259 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2260 | return never executed: d->subTitle;return d->subTitle;never executed: return d->subTitle; | 0 | ||||||||||||||||||||||||
| 2261 | } | - | ||||||||||||||||||||||||
| 2262 | void QWizardPage::setPixmap(QWizard::WizardPixmap which, const QPixmap &pixmap) | - | ||||||||||||||||||||||||
| 2263 | { | - | ||||||||||||||||||||||||
| 2264 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2265 | ((!(uint(which) < QWizard::NPixmaps)) ? qt_assert("uint(which) < QWizard::NPixmaps",__FILE__,3559) : qt_noop()); | - | ||||||||||||||||||||||||
| 2266 | d->pixmaps[which] = pixmap; | - | ||||||||||||||||||||||||
| 2267 | if (d->wizard
| 0 | ||||||||||||||||||||||||
| 2268 | d->wizard->d_func()->updatePixmap(which); never executed: d->wizard->d_func()->updatePixmap(which); | 0 | ||||||||||||||||||||||||
| 2269 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2270 | QPixmap QWizardPage::pixmap(QWizard::WizardPixmap which) const | - | ||||||||||||||||||||||||
| 2271 | { | - | ||||||||||||||||||||||||
| 2272 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2273 | ((!(uint(which) < QWizard::NPixmaps)) ? qt_assert("uint(which) < QWizard::NPixmaps",__FILE__,3577) : qt_noop()); | - | ||||||||||||||||||||||||
| 2274 | - | |||||||||||||||||||||||||
| 2275 | const QPixmap &pixmap = d->pixmaps[which]; | - | ||||||||||||||||||||||||
| 2276 | if (!pixmap.isNull()
| 0 | ||||||||||||||||||||||||
| 2277 | return never executed: pixmap;return pixmap;never executed: return pixmap; | 0 | ||||||||||||||||||||||||
| 2278 | - | |||||||||||||||||||||||||
| 2279 | if (wizard()
| 0 | ||||||||||||||||||||||||
| 2280 | return never executed: wizard()->pixmap(which);return wizard()->pixmap(which);never executed: return wizard()->pixmap(which); | 0 | ||||||||||||||||||||||||
| 2281 | - | |||||||||||||||||||||||||
| 2282 | return never executed: pixmap;return pixmap;never executed: return pixmap; | 0 | ||||||||||||||||||||||||
| 2283 | } | - | ||||||||||||||||||||||||
| 2284 | void QWizardPage::initializePage() | - | ||||||||||||||||||||||||
| 2285 | { | - | ||||||||||||||||||||||||
| 2286 | } | - | ||||||||||||||||||||||||
| 2287 | void QWizardPage::cleanupPage() | - | ||||||||||||||||||||||||
| 2288 | { | - | ||||||||||||||||||||||||
| 2289 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2290 | if (d->wizard
| 0 | ||||||||||||||||||||||||
| 2291 | QVector<QWizardField> &fields = d->wizard->d_func()->fields; | - | ||||||||||||||||||||||||
| 2292 | for (int i = 0; i < fields.count()
| 0 | ||||||||||||||||||||||||
| 2293 | const QWizardField &field = fields.at(i); | - | ||||||||||||||||||||||||
| 2294 | if (field.page == this
| 0 | ||||||||||||||||||||||||
| 2295 | field.object->setProperty(field.property, field.initialValue); never executed: field.object->setProperty(field.property, field.initialValue); | 0 | ||||||||||||||||||||||||
| 2296 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2297 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2298 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2299 | bool QWizardPage::validatePage() | - | ||||||||||||||||||||||||
| 2300 | { | - | ||||||||||||||||||||||||
| 2301 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2302 | } | - | ||||||||||||||||||||||||
| 2303 | bool QWizardPage::isComplete() const | - | ||||||||||||||||||||||||
| 2304 | { | - | ||||||||||||||||||||||||
| 2305 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2306 | - | |||||||||||||||||||||||||
| 2307 | if (!d->wizard
| 0 | ||||||||||||||||||||||||
| 2308 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2309 | - | |||||||||||||||||||||||||
| 2310 | const QVector<QWizardField> &wizardFields = d->wizard->d_func()->fields; | - | ||||||||||||||||||||||||
| 2311 | for (int i = wizardFields.count() - 1; i >= 0
| 0 | ||||||||||||||||||||||||
| 2312 | const QWizardField &field = wizardFields.at(i); | - | ||||||||||||||||||||||||
| 2313 | if (field.page == this
| 0 | ||||||||||||||||||||||||
| 2314 | QVariant value = field.object->property(field.property); | - | ||||||||||||||||||||||||
| 2315 | if (value == field.initialValue
| 0 | ||||||||||||||||||||||||
| 2316 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2317 | - | |||||||||||||||||||||||||
| 2318 | - | |||||||||||||||||||||||||
| 2319 | if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)
| 0 | ||||||||||||||||||||||||
| 2320 | if (!lineEdit->hasAcceptableInput()
| 0 | ||||||||||||||||||||||||
| 2321 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2322 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2323 | - | |||||||||||||||||||||||||
| 2324 | - | |||||||||||||||||||||||||
| 2325 | if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)
| 0 | ||||||||||||||||||||||||
| 2326 | if (!spinBox->hasAcceptableInput()
| 0 | ||||||||||||||||||||||||
| 2327 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2328 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2329 | - | |||||||||||||||||||||||||
| 2330 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2332 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2333 | } | - | ||||||||||||||||||||||||
| 2334 | void QWizardPage::setFinalPage(bool finalPage) | - | ||||||||||||||||||||||||
| 2335 | { | - | ||||||||||||||||||||||||
| 2336 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2337 | d->explicitlyFinal = finalPage; | - | ||||||||||||||||||||||||
| 2338 | QWizard *wizard = this->wizard(); | - | ||||||||||||||||||||||||
| 2339 | if (wizard
| 0 | ||||||||||||||||||||||||
| 2340 | wizard->d_func()->updateCurrentPage(); never executed: wizard->d_func()->updateCurrentPage(); | 0 | ||||||||||||||||||||||||
| 2341 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2342 | bool QWizardPage::isFinalPage() const | - | ||||||||||||||||||||||||
| 2343 | { | - | ||||||||||||||||||||||||
| 2344 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2345 | if (d->explicitlyFinal
| 0 | ||||||||||||||||||||||||
| 2346 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2347 | - | |||||||||||||||||||||||||
| 2348 | QWizard *wizard = this->wizard(); | - | ||||||||||||||||||||||||
| 2349 | if (wizard
| 0 | ||||||||||||||||||||||||
| 2350 | - | |||||||||||||||||||||||||
| 2351 | return never executed: wizard->nextId() == -1;return wizard->nextId() == -1;never executed: return wizard->nextId() == -1; | 0 | ||||||||||||||||||||||||
| 2352 | } else { | - | ||||||||||||||||||||||||
| 2353 | return never executed: nextId() == -1;return nextId() == -1;never executed: return nextId() == -1; | 0 | ||||||||||||||||||||||||
| 2354 | } | - | ||||||||||||||||||||||||
| 2355 | } | - | ||||||||||||||||||||||||
| 2356 | void QWizardPage::setCommitPage(bool commitPage) | - | ||||||||||||||||||||||||
| 2357 | { | - | ||||||||||||||||||||||||
| 2358 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2359 | d->commit = commitPage; | - | ||||||||||||||||||||||||
| 2360 | QWizard *wizard = this->wizard(); | - | ||||||||||||||||||||||||
| 2361 | if (wizard
| 0 | ||||||||||||||||||||||||
| 2362 | wizard->d_func()->updateCurrentPage(); never executed: wizard->d_func()->updateCurrentPage(); | 0 | ||||||||||||||||||||||||
| 2363 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2364 | - | |||||||||||||||||||||||||
| 2365 | - | |||||||||||||||||||||||||
| 2366 | - | |||||||||||||||||||||||||
| 2367 | - | |||||||||||||||||||||||||
| 2368 | - | |||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||
| 2370 | bool QWizardPage::isCommitPage() const | - | ||||||||||||||||||||||||
| 2371 | { | - | ||||||||||||||||||||||||
| 2372 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2373 | return never executed: d->commit;return d->commit;never executed: return d->commit; | 0 | ||||||||||||||||||||||||
| 2374 | } | - | ||||||||||||||||||||||||
| 2375 | void QWizardPage::setButtonText(QWizard::WizardButton which, const QString &text) | - | ||||||||||||||||||||||||
| 2376 | { | - | ||||||||||||||||||||||||
| 2377 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2378 | d->buttonCustomTexts.insert(which, text); | - | ||||||||||||||||||||||||
| 2379 | if (wizard()
| 0 | ||||||||||||||||||||||||
| 2380 | wizard()->d_func()->btns[which]->setText(text); never executed: wizard()->d_func()->btns[which]->setText(text); | 0 | ||||||||||||||||||||||||
| 2381 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2382 | QString QWizardPage::buttonText(QWizard::WizardButton which) const | - | ||||||||||||||||||||||||
| 2383 | { | - | ||||||||||||||||||||||||
| 2384 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2385 | - | |||||||||||||||||||||||||
| 2386 | if (d->buttonCustomTexts.contains(which)
| 0 | ||||||||||||||||||||||||
| 2387 | return never executed: d->buttonCustomTexts.value(which);return d->buttonCustomTexts.value(which);never executed: return d->buttonCustomTexts.value(which); | 0 | ||||||||||||||||||||||||
| 2388 | - | |||||||||||||||||||||||||
| 2389 | if (wizard()
| 0 | ||||||||||||||||||||||||
| 2390 | return never executed: wizard()->buttonText(which);return wizard()->buttonText(which);never executed: return wizard()->buttonText(which); | 0 | ||||||||||||||||||||||||
| 2391 | - | |||||||||||||||||||||||||
| 2392 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 2393 | } | - | ||||||||||||||||||||||||
| 2394 | int QWizardPage::nextId() const | - | ||||||||||||||||||||||||
| 2395 | { | - | ||||||||||||||||||||||||
| 2396 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2397 | - | |||||||||||||||||||||||||
| 2398 | if (!d->wizard
| 0 | ||||||||||||||||||||||||
| 2399 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 2400 | - | |||||||||||||||||||||||||
| 2401 | bool foundCurrentPage = false; | - | ||||||||||||||||||||||||
| 2402 | - | |||||||||||||||||||||||||
| 2403 | const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap; | - | ||||||||||||||||||||||||
| 2404 | QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin(); | - | ||||||||||||||||||||||||
| 2405 | QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd(); | - | ||||||||||||||||||||||||
| 2406 | - | |||||||||||||||||||||||||
| 2407 | for (; i != end
| 0 | ||||||||||||||||||||||||
| 2408 | if (i.value() == this
| 0 | ||||||||||||||||||||||||
| 2409 | foundCurrentPage = true; | - | ||||||||||||||||||||||||
| 2410 | } never executed: else if (foundCurrentPageend of block
| 0 | ||||||||||||||||||||||||
| 2411 | return never executed: i.key();return i.key();never executed: return i.key(); | 0 | ||||||||||||||||||||||||
| 2412 | } | - | ||||||||||||||||||||||||
| 2413 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2414 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 2415 | } | - | ||||||||||||||||||||||||
| 2416 | void QWizardPage::setField(const QString &name, const QVariant &value) | - | ||||||||||||||||||||||||
| 2417 | { | - | ||||||||||||||||||||||||
| 2418 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2419 | if (!d->wizard
| 0 | ||||||||||||||||||||||||
| 2420 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2421 | d->wizard->setField(name, value); | - | ||||||||||||||||||||||||
| 2422 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2423 | QVariant QWizardPage::field(const QString &name) const | - | ||||||||||||||||||||||||
| 2424 | { | - | ||||||||||||||||||||||||
| 2425 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2426 | if (!d->wizard
| 0 | ||||||||||||||||||||||||
| 2427 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||||||||||||||
| 2428 | return never executed: d->wizard->field(name);return d->wizard->field(name);never executed: return d->wizard->field(name); | 0 | ||||||||||||||||||||||||
| 2429 | } | - | ||||||||||||||||||||||||
| 2430 | void QWizardPage::registerField(const QString &name, QWidget *widget, const char *property, | - | ||||||||||||||||||||||||
| 2431 | const char *changedSignal) | - | ||||||||||||||||||||||||
| 2432 | { | - | ||||||||||||||||||||||||
| 2433 | QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2434 | QWizardField field(this, name, widget, property, changedSignal); | - | ||||||||||||||||||||||||
| 2435 | if (d->wizard
| 0 | ||||||||||||||||||||||||
| 2436 | d->wizard->d_func()->addField(field); | - | ||||||||||||||||||||||||
| 2437 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2438 | d->pendingFields += field; | - | ||||||||||||||||||||||||
| 2439 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2440 | } | - | ||||||||||||||||||||||||
| 2441 | - | |||||||||||||||||||||||||
| 2442 | - | |||||||||||||||||||||||||
| 2443 | - | |||||||||||||||||||||||||
| 2444 | - | |||||||||||||||||||||||||
| 2445 | - | |||||||||||||||||||||||||
| 2446 | - | |||||||||||||||||||||||||
| 2447 | - | |||||||||||||||||||||||||
| 2448 | QWizard *QWizardPage::wizard() const | - | ||||||||||||||||||||||||
| 2449 | { | - | ||||||||||||||||||||||||
| 2450 | const QWizardPagePrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2451 | return never executed: d->wizard;return d->wizard;never executed: return d->wizard; | 0 | ||||||||||||||||||||||||
| 2452 | } | - | ||||||||||||||||||||||||
| 2453 | - | |||||||||||||||||||||||||
| 2454 | - | |||||||||||||||||||||||||
| 2455 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |