qwizard.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/dialogs/qwizard.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7const int GapBetweenLogoAndRightEdge = 5;-
8const int ModernHeaderTopMargin = 2;-
9const int ClassicHMargin = 4;-
10const int MacButtonTopMargin = 13;-
11const int MacLayoutLeftMargin = 20;-
12-
13const int MacLayoutRightMargin = 20;-
14const int MacLayoutBottomMargin = 17;-
15-
16static void changeSpacerSize(QLayout *layout, int index, int width, int height)-
17{-
18 QSpacerItem *spacer = layout->itemAt(index)->spacerItem();-
19 if (!spacer
!spacerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
20 return;
never executed: return;
0
21 spacer->changeSize(width, height);-
22}
never executed: end of block
0
23-
24static QWidget *iWantTheFocus(QWidget *ancestor)-
25{-
26 const int MaxIterations = 100;-
27-
28 QWidget *candidate = ancestor;-
29 for (int i = 0; i < MaxIterations
i < MaxIterationsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
30 candidate = candidate->nextInFocusChain();-
31 if (!candidate
!candidateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
32 break;
never executed: break;
0
33-
34 if (candidate->focusPolicy() & Qt::TabFocus
candidate->foc...& Qt::TabFocusDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
35 if (candidate != ancestor
candidate != ancestorDescription
TRUEnever evaluated
FALSEnever evaluated
&& ancestor->isAncestorOf(candidate)
ancestor->isAn...rOf(candidate)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
36 return
never executed: return candidate;
candidate;
never executed: return candidate;
0
37 }
never executed: end of block
0
38 }
never executed: end of block
0
39 return
never executed: return 0;
0;
never executed: return 0;
0
40}-
41-
42static bool objectInheritsXAndXIsCloserThanY(const QObject *object, const QByteArray &classX,-
43 const QByteArray &classY)-
44{-
45 const QMetaObject *metaObject = object->metaObject();-
46 while (metaObject
metaObjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
47 if (metaObject->className() == classX
metaObject->cl...me() == classXDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
48 return
never executed: return true;
true;
never executed: return true;
0
49 if (metaObject->className() == classY
metaObject->cl...me() == classYDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
50 return
never executed: return false;
false;
never executed: return false;
0
51 metaObject = metaObject->superClass();-
52 }
never executed: end of block
0
53 return
never executed: return false;
false;
never executed: return false;
0
54}-
55-
56const 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};-
69const size_t NFallbackDefaultProperties = sizeof fallbackProperties / sizeof *fallbackProperties;-
70-
71static const char *changed_signal(int which)-
72{-
73-
74-
75-
76-
77-
78 switch (which) {-
79 case
never executed: case 0:
0:
never executed: case 0:
return
never executed: return qFlagLocation("2""toggled(bool)" "\0" __FILE__ ":" "154");
qFlagLocation("2""toggled(bool)" "\0" __FILE__ ":" "154");
never executed: return qFlagLocation("2""toggled(bool)" "\0" __FILE__ ":" "154");
0
80 case
never executed: case 1:
1:
never executed: case 1:
return
never executed: return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "155");
qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "155");
never executed: return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "155");
0
81 case
never executed: case 2:
2:
never executed: case 2:
return
never executed: return qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "156");
qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "156");
never executed: return qFlagLocation("2""currentIndexChanged(int)" "\0" __FILE__ ":" "156");
0
82 case
never executed: case 3:
3:
never executed: case 3:
return
never executed: return qFlagLocation("2""dateTimeChanged(QDateTime)" "\0" __FILE__ ":" "157");
qFlagLocation("2""dateTimeChanged(QDateTime)" "\0" __FILE__ ":" "157");
never executed: return qFlagLocation("2""dateTimeChanged(QDateTime)" "\0" __FILE__ ":" "157");
0
83 case
never executed: case 4:
4:
never executed: case 4:
return
never executed: return qFlagLocation("2""textChanged(QString)" "\0" __FILE__ ":" "158");
qFlagLocation("2""textChanged(QString)" "\0" __FILE__ ":" "158");
never executed: return qFlagLocation("2""textChanged(QString)" "\0" __FILE__ ":" "158");
0
84 case
never executed: case 5:
5:
never executed: case 5:
return
never executed: return qFlagLocation("2""currentRowChanged(int)" "\0" __FILE__ ":" "159");
qFlagLocation("2""currentRowChanged(int)" "\0" __FILE__ ":" "159");
never executed: return qFlagLocation("2""currentRowChanged(int)" "\0" __FILE__ ":" "159");
0
85 case
never executed: case 6:
6:
never executed: case 6:
return
never executed: return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "160");
qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "160");
never executed: return qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "160");
0
86 };-
87 static_assert(bool(7 == NFallbackDefaultProperties), "7 == NFallbackDefaultProperties");-
88 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,163) : qt_noop()); __builtin_unreachable(); } while (0);-
89 return
never executed: return 0;
0;
never executed: return 0;
0
90}-
91-
92class QWizardDefaultProperty-
93{-
94public:-
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};-
104template<> 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-
106class QWizardField-
107{-
108public:-
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};-
124template<> 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-
126QWizardField::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('*'))
name.endsWith(...tin1Char('*'))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
132 name.chop(1);-
133 mandatory = true;-
134 }
never executed: end of block
0
135}
never executed: end of block
0
136-
137void QWizardField::resolve(const QVector<QWizardDefaultProperty> &defaultPropertyTable)-
138{-
139 if (property.isEmpty()
property.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
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-
144void QWizardField::findProperty(const QWizardDefaultProperty *properties, int propertyCount)-
145{-
146 QByteArray className;-
147-
148 for (int i = 0; i < propertyCount
i < propertyCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
149 if (objectInheritsXAndXIsCloserThanY(object, properties[i].className, className)
objectInherits...me, className)Description
TRUEnever evaluated
FALSEnever evaluated
) {
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-
157class QWizardLayoutInfo-
158{-
159public:-
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: return !operator==(other);
!operator==(other);
never executed: return !operator==(other);
}
0
188};-
189-
190bool QWizardLayoutInfo::operator==(const QWizardLayoutInfo &other)-
191{-
192 return
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;
topLevelMarginLeft == other.topLevelMarginLeft
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-
212class QWizardHeader : public QWidget-
213{-
214public:-
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-
225protected:-
226 void paintEvent(QPaintEvent *event) override;-
227-
228-
229-
230-
231private:-
232 QLabel *titleLabel;-
233 QLabel *subTitleLabel;-
234 QLabel *logoLabel;-
235 QGridLayout *layout;-
236 QPixmap bannerPixmap;-
237};-
238-
239QWizardHeader::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
273void 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
modernDescription
TRUEnever evaluated
FALSEnever evaluated
? info.topLevelMarginLeft + info.topLevelMarginRight : 0;
0
289 int minColumnWidth1 = modern
modernDescription
TRUEnever evaluated
FALSEnever evaluated
? info.topLevelMarginLeft + info.topLevelMarginRight + 1
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
modernDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
304 bannerPixmap = banner;-
305 }
never executed: end of block
else {
0
306 bannerPixmap = QPixmap();-
307 }
never executed: end of block
0
308-
309 if (bannerPixmap.isNull()
bannerPixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
310-
311-
312-
313 int candidateSubTitleWidth = qMin(512, 2 * QApplication::desktop()->width() / 3);-
314 int delta = candidateSubTitleWidth >> 1;-
315 while (delta > 0
delta > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
316 if (subTitleLabel->heightForWidth(candidateSubTitleWidth - delta)
subTitleLabel-...SubTitleHeightDescription
TRUEnever evaluated
FALSEnever evaluated
0
317 <= desiredSubTitleHeight
subTitleLabel-...SubTitleHeightDescription
TRUEnever evaluated
FALSEnever evaluated
)
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: end of block
else {
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-
334void 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-
350class QWizardRuler : public QWizardHeader-
351{-
352public:-
353 inline QWizardRuler(QWidget *parent = 0)-
354 : QWizardHeader(Ruler, parent) {}
never executed: end of block
0
355};-
356-
357class QWatermarkLabel : public QLabel-
358{-
359public:-
360 QWatermarkLabel(QWidget *parent, QWidget *sideWidget) : QLabel(parent), m_sideWidget(sideWidget) {-
361 m_layout = new QVBoxLayout(this);-
362 if (m_sideWidget
m_sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
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()
!pixmap()Description
TRUEnever evaluated
FALSEnever evaluated
&& !pixmap()->isNull()
!pixmap()->isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
368 return
never executed: return pixmap()->size();
pixmap()->size();
never executed: return pixmap()->size();
0
369 return
never executed: return QFrame::minimumSizeHint();
QFrame::minimumSizeHint();
never executed: return QFrame::minimumSizeHint();
0
370 }-
371-
372 void setSideWidget(QWidget *widget) {-
373 if (m_sideWidget == widget
m_sideWidget == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
374 return;
never executed: return;
0
375 if (m_sideWidget
m_sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
m_sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
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: return m_sideWidget;
m_sideWidget;
never executed: return m_sideWidget;
0
385 }-
386private:-
387 QVBoxLayout *m_layout;-
388 QWidget *m_sideWidget;-
389};-
390-
391class 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-
395public:-
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-
416bool QWizardPagePrivate::cachedIsComplete() const-
417{-
418 const QWizardPage * const q = q_func();-
419 if (completeState == Tri_Unknown
completeState == Tri_UnknownDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
420 completeState = q->isComplete()
q->isComplete()Description
TRUEnever evaluated
FALSEnever evaluated
? Tri_True : Tri_False;
never executed: completeState = q->isComplete() ? Tri_True : Tri_False;
0
421 return
never executed: return completeState == Tri_True;
completeState == Tri_True;
never executed: return completeState == Tri_True;
0
422}-
423-
424void QWizardPagePrivate::_q_maybeEmitCompleteChanged()-
425{-
426 QWizardPage * const q = q_func();-
427 TriState newState = q->isComplete()
q->isComplete()Description
TRUEnever evaluated
FALSEnever evaluated
? Tri_True : Tri_False;
0
428 if (newState != completeState
newState != completeStateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
429 q->completeChanged();
never executed: q->completeChanged();
0
430}
never executed: end of block
0
431-
432void QWizardPagePrivate::_q_updateCachedCompleteState()-
433{-
434 QWizardPage * const q = q_func();-
435 completeState = q->isComplete()
q->isComplete()Description
TRUEnever evaluated
FALSEnever evaluated
? Tri_True : Tri_False;
0
436}
never executed: end of block
0
437-
438class QWizardAntiFlickerWidget : public QWidget-
439{-
440public:-
441 QWizardAntiFlickerWidget(QWizard *wizard, QWizardPrivate *)-
442 : QWidget(wizard)-
443 {}
never executed: end of block
0
444-
445};-
446-
447class 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-
451public:-
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-
590static 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: case QWizard::BackButton:
QWizard::BackButton:
never executed: case QWizard::BackButton:
0
598 return
never executed: return macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back");
macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back");
never executed: return macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back");
0
599 case
never executed: case QWizard::NextButton:
QWizard::NextButton:
never executed: case QWizard::NextButton:
0
600 if (macStyle
macStyleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
601 return
never executed: return QWizard::tr("Continue");
QWizard::tr("Continue");
never executed: return QWizard::tr("Continue");
0
602 else-
603 return
never executed: return wizardPrivate->isVistaThemeEnabled() ? QWizard::tr("&Next") : QWizard::tr("&Next >");
wizardPrivate->isVistaThemeEnabled()
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: case QWizard::CommitButton:
QWizard::CommitButton:
never executed: case QWizard::CommitButton:
0
606 return
never executed: return QWizard::tr("Commit");
QWizard::tr("Commit");
never executed: return QWizard::tr("Commit");
0
607 case
never executed: case QWizard::FinishButton:
QWizard::FinishButton:
never executed: case QWizard::FinishButton:
0
608 return
never executed: return macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish");
macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish");
never executed: return macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish");
0
609 case
never executed: case QWizard::CancelButton:
QWizard::CancelButton:
never executed: case QWizard::CancelButton:
0
610 return
never executed: return QWizard::tr("Cancel");
QWizard::tr("Cancel");
never executed: return QWizard::tr("Cancel");
0
611 case
never executed: case QWizard::HelpButton:
QWizard::HelpButton:
never executed: case QWizard::HelpButton:
0
612 return
never executed: return macStyle ? QWizard::tr("Help") : QWizard::tr("&Help");
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: return QString();
QString();
never executed: return QString();
0
615 }-
616}-
617-
618void 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
wizStyle == QWizard::MacStyleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
625 opts = (QWizard::NoDefaultButton | QWizard::NoCancelButton);-
626 }
never executed: end of block
else if (wizStyle == QWizard::ModernStyle
wizStyle == QW...d::ModernStyleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
i < NFallbackDefaultPropertiesDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
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-
662void QWizardPrivate::reset()-
663{-
664 QWizard * const q = q_func();-
665 if (current != -1
current != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
666 q->currentPage()->hide();-
667 cleanupPagesNotInHistory();-
668 for (int i = history.count() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i)
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-
678void 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
i != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
687 if (!history.contains(*i)
!history.contains(*i)Description
TRUEnever evaluated
FALSEnever evaluated
) {
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-
694void QWizardPrivate::addField(const QWizardField &field)-
695{-
696 QWizard * const q = q_func();-
697-
698 QWizardField myField = field;-
699 myField.resolve(defaultPropertyTable);-
700-
701 if (__builtin_expect(!!(fieldIndexMap.contains(myField.name)), false)
__builtin_expe...name)), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
702 QMessageLogger(__FILE__, 809, __PRETTY_FUNCTION__).warning("QWizardPage::addField: Duplicate field '%ls'", static_cast<const wchar_t*>(static_cast<const void*>(QString(myField.name).utf16())));-
703 return;
never executed: return;
0
704 }-
705-
706 fieldIndexMap.insert(myField.name, fields.count());-
707 fields += myField;-
708 if (myField.mandatory
myField.mandatoryDescription
TRUEnever evaluated
FALSEnever evaluated
&& !myField.changedSignal.isEmpty()
!myField.chang...gnal.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
709 QObject::connect(myField.object, myField.changedSignal,
never executed: QObject::connect(myField.object, myField.changedSignal, myField.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "817"));
0
710 myField.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "817"));
never executed: QObject::connect(myField.object, myField.changedSignal, myField.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "817"));
0
711 QObject::connect(-
712 myField.object, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "819"), q,-
713 qFlagLocation("1""_q_handleFieldObjectDestroyed(QObject*)" "\0" __FILE__ ":" "820"));-
714}
never executed: end of block
0
715-
716void 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
field.mandatoryDescription
TRUEnever evaluated
FALSEnever evaluated
&& !field.changedSignal.isEmpty()
!field.changedSignal.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
723 QObject::disconnect(field.object, field.changedSignal,
never executed: QObject::disconnect(field.object, field.changedSignal, field.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "831"));
0
724 field.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "831"));
never executed: QObject::disconnect(field.object, field.changedSignal, field.page, qFlagLocation("1""_q_maybeEmitCompleteChanged()" "\0" __FILE__ ":" "831"));
0
725 QObject::disconnect(-
726 field.object, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "833"), q,-
727 qFlagLocation("1""_q_handleFieldObjectDestroyed(QObject*)" "\0" __FILE__ ":" "834"));-
728 fields.remove(index);-
729}
never executed: end of block
0
730-
731void 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()
QWizardPage *o...>currentPage()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
739 oldPage->hide();-
740-
741 if (direction == Backward
direction == BackwardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
742 if (!(opts & QWizard::IndependentPages)
!(opts & QWiza...ependentPages)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
743 q->cleanupPage(oldId);-
744 initialized.remove(oldId);-
745 }
never executed: end of block
0
746 ((!(history.constLast() == oldId)) ? qt_assert("history.constLast() == oldId",__FILE__,853) : qt_noop());-
747 history.removeLast();-
748 ((!(history.constLast() == newId)) ? qt_assert("history.constLast() == newId",__FILE__,855) : 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
newPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
756 if (direction == Forward
direction == ForwardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
757 if (!initialized.contains(current)
!initialized.contains(current)Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
newPageDescription
TRUEnever evaluated
FALSEnever evaluated
&& newPage->isFinalPage()
newPage->isFinalPage()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
768-
769 _q_updateButtonStates();-
770 updateButtonTexts();-
771-
772 const QWizard::WizardButton nextOrCommit =-
773 newPage
newPageDescription
TRUEnever evaluated
FALSEnever evaluated
&& newPage->isCommitPage()
newPage->isCommitPage()Description
TRUEnever evaluated
FALSEnever evaluated
? QWizard::CommitButton : QWizard::NextButton;
0
774 QAbstractButton *nextOrFinishButton =-
775 btns[canContinue ? nextOrCommit : QWizard::FinishButton];-
776 QWidget *candidate = 0;-
777 if ((
(opts & QWizar...DefaultButton)Description
TRUEnever evaluated
FALSEnever evaluated
opts & QWizard::NoDefaultButton)
(opts & QWizar...DefaultButton)Description
TRUEnever evaluated
FALSEnever evaluated
&& nextOrFinishButton->isEnabled()
nextOrFinishBu...n->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
778 candidate = nextOrFinishButton;-
779 }
never executed: end of block
else if (newPage
newPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
780 candidate = iWantTheFocus(newPage);-
781 }
never executed: end of block
0
782 if (!candidate
!candidateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
783 candidate = nextOrFinishButton;
never executed: candidate = nextOrFinishButton;
0
784 candidate->setFocus();-
785-
786 if (wizStyle == QWizard::MacStyle
wizStyle == QWizard::MacStyleDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
796static const char * buttonSlots(QWizard::WizardButton which)-
797{-
798 switch (which) {-
799 case
never executed: case QWizard::BackButton:
QWizard::BackButton:
never executed: case QWizard::BackButton:
0
800 return
never executed: return qFlagLocation("1""back()" "\0" __FILE__ ":" "917");
qFlagLocation("1""back()" "\0" __FILE__ ":" "917");
never executed: return qFlagLocation("1""back()" "\0" __FILE__ ":" "917");
0
801 case
never executed: case QWizard::NextButton:
QWizard::NextButton:
never executed: case QWizard::NextButton:
0
802 case
never executed: case QWizard::CommitButton:
QWizard::CommitButton:
never executed: case QWizard::CommitButton:
0
803 return
never executed: return qFlagLocation("1""next()" "\0" __FILE__ ":" "920");
qFlagLocation("1""next()" "\0" __FILE__ ":" "920");
never executed: return qFlagLocation("1""next()" "\0" __FILE__ ":" "920");
0
804 case
never executed: case QWizard::FinishButton:
QWizard::FinishButton:
never executed: case QWizard::FinishButton:
0
805 return
never executed: return qFlagLocation("1""accept()" "\0" __FILE__ ":" "922");
qFlagLocation("1""accept()" "\0" __FILE__ ":" "922");
never executed: return qFlagLocation("1""accept()" "\0" __FILE__ ":" "922");
0
806 case
never executed: case QWizard::CancelButton:
QWizard::CancelButton:
never executed: case QWizard::CancelButton:
0
807 return
never executed: return qFlagLocation("1""reject()" "\0" __FILE__ ":" "924");
qFlagLocation("1""reject()" "\0" __FILE__ ":" "924");
never executed: return qFlagLocation("1""reject()" "\0" __FILE__ ":" "924");
0
808 case
never executed: case QWizard::HelpButton:
QWizard::HelpButton:
never executed: case QWizard::HelpButton:
0
809 return
never executed: return qFlagLocation("2""helpRequested()" "\0" __FILE__ ":" "926");
qFlagLocation("2""helpRequested()" "\0" __FILE__ ":" "926");
never executed: return qFlagLocation("2""helpRequested()" "\0" __FILE__ ":" "926");
0
810 case
never executed: case QWizard::CustomButton1:
QWizard::CustomButton1:
never executed: case QWizard::CustomButton1:
0
811 case
never executed: case QWizard::CustomButton2:
QWizard::CustomButton2:
never executed: case QWizard::CustomButton2:
0
812 case
never executed: case QWizard::CustomButton3:
QWizard::CustomButton3:
never executed: case QWizard::CustomButton3:
0
813 case
never executed: case QWizard::Stretch:
QWizard::Stretch:
never executed: case QWizard::Stretch:
0
814 case
never executed: case QWizard::NoButton:
QWizard::NoButton:
never executed: case QWizard::NoButton:
0
815 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,932) : qt_noop()); __builtin_unreachable(); } while (0);-
816 }
never executed: end of block
;
0
817 return
never executed: return 0;
0;
never executed: return 0;
0
818};-
819-
820QWizardLayoutInfo 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 = (
(layoutHorizon...Spacing == -1)Description
TRUEnever evaluated
FALSEnever evaluated
layoutHorizontalSpacing == -1)
(layoutHorizon...Spacing == -1)Description
TRUEnever evaluated
FALSEnever evaluated
0
837 ? style->layoutSpacing(QSizePolicy::DefaultType, QSizePolicy::DefaultType, Qt::Horizontal)-
838 : layoutHorizontalSpacing;-
839 info.vspacing = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing);-
840 info.buttonSpacing = (
(layoutHorizon...Spacing == -1)Description
TRUEnever evaluated
FALSEnever evaluated
layoutHorizontalSpacing == -1)
(layoutHorizon...Spacing == -1)Description
TRUEnever evaluated
FALSEnever evaluated
0
841 ? style->layoutSpacing(QSizePolicy::PushButton, QSizePolicy::PushButton, Qt::Horizontal)-
842 : layoutHorizontalSpacing;-
843-
844 if (wizStyle == QWizard::MacStyle
wizStyle == QWizard::MacStyleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
845 info.buttonSpacing = 12;
never executed: info.buttonSpacing = 12;
0
846-
847 info.wizStyle = wizStyle;-
848 if (info.wizStyle == QWizard::AeroStyle
info.wizStyle ...ard::AeroStyleDescription
TRUEnever evaluated
FALSEnever evaluated
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()
QWizardPage *p...>currentPage()Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
info.wizStyle ...::ClassicStyleDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.wizStyle == QWizard::ModernStyle
info.wizStyle ...d::ModernStyleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
868 && !(opts & QWizard::IgnoreSubTitles)
!(opts & QWiza...noreSubTitles)Description
TRUEnever evaluated
FALSEnever evaluated
&& !subTitleText.isEmpty()
!subTitleText.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
869 info.sideWidget = sideWidget;-
870 info.watermark = (
(info.wizStyle...ard::MacStyle)Description
TRUEnever evaluated
FALSEnever evaluated
info.wizStyle != QWizard::MacStyle)
(info.wizStyle...ard::MacStyle)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(info.wizStyle...rd::AeroStyle)Description
TRUEnever evaluated
FALSEnever evaluated
info.wizStyle != QWizard::AeroStyle)
(info.wizStyle...rd::AeroStyle)Description
TRUEnever evaluated
FALSEnever evaluated
0
871 && !watermarkPixmap.isNull()
!watermarkPixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
872 info.title = !info.header
!info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
&& !titleText.isEmpty()
!titleText.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
873 info.subTitle = !(opts & QWizard::IgnoreSubTitles)
!(opts & QWiza...noreSubTitles)Description
TRUEnever evaluated
FALSEnever evaluated
&& !info.header
!info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
&& !subTitleText.isEmpty()
!subTitleText.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
874 info.extension = (info.watermark
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.sideWidget
info.sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) && (
(opts & QWizar...termarkPixmap)Description
TRUEnever evaluated
FALSEnever evaluated
opts & QWizard::ExtendedWatermarkPixmap)
(opts & QWizar...termarkPixmap)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
875-
876 return
never executed: return info;
info;
never executed: return info;
0
877}-
878-
879void 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
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
887 QLayoutItem *item = mainLayout->takeAt(i);-
888 if (item->layout()
item->layout()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
889 item->layout()->setParent(0);-
890 }
never executed: end of block
else {
0
891 delete item;-
892 }
never executed: end of block
0
893 }-
894 for (int i = mainLayout->columnCount() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i)
0
895 mainLayout->setColumnMinimumWidth(i, 0);
never executed: mainLayout->setColumnMinimumWidth(i, 0);
0
896 for (int i = mainLayout->rowCount() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i)
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
macDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
916 numColumns = 3;-
917 }
never executed: end of block
else if (info.watermark
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.sideWidget
info.sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
918 numColumns = 2;-
919 }
never executed: end of block
else {
0
920 numColumns = 1;-
921 }
never executed: end of block
0
922 int pageColumn = qMin(1, numColumns - 1);-
923-
924 if (mac
macDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
925 mainLayout->setMargin(0);-
926 mainLayout->setSpacing(0);-
927 buttonLayout->setContentsMargins(MacLayoutLeftMargin, MacButtonTopMargin, MacLayoutRightMargin, MacLayoutBottomMargin);-
928 pageVBoxLayout->setMargin(7);-
929 }
never executed: end of block
else {
0
930 if (modern
modernDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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: end of block
else {
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
info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
949 if (!headerWidget
!headerWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
headerWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
955 headerWidget->setVisible(info.header);
never executed: headerWidget->setVisible(info.header);
0
956-
957 int watermarkStartRow = row;-
958-
959 if (mac
macDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
960 mainLayout->setRowMinimumHeight(row++, 10);
never executed: mainLayout->setRowMinimumHeight(row++, 10);
0
961-
962 if (info.title
info.titleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
963 if (!titleLabel
!titleLabelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
aeroDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
aeroDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
985 titleLabel->setIndent(aeroTitleIndent);
never executed: titleLabel->setIndent(aeroTitleIndent);
0
986 else if (mac
macDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
987 titleLabel->setIndent(2);
never executed: titleLabel->setIndent(2);
0
988 else if (classic
classicDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
modernDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
993 if (!placeholderWidget1
!placeholderWidget1Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
modernDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1002 if (!placeholderWidget2
!placeholderWidget2Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
macDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1010 mainLayout->setRowMinimumHeight(row++, 7);
never executed: mainLayout->setRowMinimumHeight(row++, 7);
0
1011 }
never executed: end of block
0
1012 if (placeholderWidget1
placeholderWidget1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1013 placeholderWidget1->setVisible(info.title && modern);
never executed: placeholderWidget1->setVisible(info.title && modern);
0
1014 if (placeholderWidget2
placeholderWidget2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1015 placeholderWidget2->setVisible(info.title && modern);
never executed: placeholderWidget2->setVisible(info.title && modern);
0
1016-
1017 if (info.subTitle
info.subTitleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1018 if (!subTitleLabel
!subTitleLabelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
macDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
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
info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1040 if (modern
modernDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1041 hMargin = info.topLevelMarginLeft;-
1042 vMargin = deltaMarginBottom;-
1043 }
never executed: end of block
else if (classic
classicDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
aeroDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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: end of block
else {
0
1056 pageFrame->setContentsMargins(hMargin, vMargin, hMargin, vMargin);-
1057 }
never executed: end of block
0
1058-
1059 if ((info.watermark
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.sideWidget
info.sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) && !watermarkLabel
!watermarkLabelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
pageFrame->pal....alpha() < 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1070 || pageFrame->palette().brush(QPalette::Base).color().alpha() < 255
pageFrame->pal....alpha() < 255Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1071 if (mac
macDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1072 if (!wasSemiTransparent
!wasSemiTransparentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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: end of block
else {
0
1083 if (wasSemiTransparent
wasSemiTransparentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1084 pageFrame->setPalette(QPalette());
never executed: pageFrame->setPalette(QPalette());
0
1085-
1086 bool baseBackground = (modern
modernDescription
TRUEnever evaluated
FALSEnever evaluated
&& !info.header
!info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1087 pageFrame->setBackgroundRole(baseBackground ? QPalette::Base : QPalette::Window);-
1088-
1089 if (titleLabel
titleLabelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1090 titleLabel->setAutoFillBackground(baseBackground);
never executed: titleLabel->setAutoFillBackground(baseBackground);
0
1091 pageFrame->setAutoFillBackground(baseBackground);-
1092 if (watermarkLabel
watermarkLabelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1093 watermarkLabel->setAutoFillBackground(baseBackground);
never executed: watermarkLabel->setAutoFillBackground(baseBackground);
0
1094 if (placeholderWidget1
placeholderWidget1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1095 placeholderWidget1->setAutoFillBackground(baseBackground);
never executed: placeholderWidget1->setAutoFillBackground(baseBackground);
0
1096 if (placeholderWidget2
placeholderWidget2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1097 placeholderWidget2->setAutoFillBackground(baseBackground);
never executed: placeholderWidget2->setAutoFillBackground(baseBackground);
0
1098-
1099 if (aero
aeroDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
classicDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1115 mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
never executed: mainLayout->setRowMinimumHeight(row++, deltaVSpacing);
0
1116-
1117 if (aero
aeroDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
info.extensionDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
1123 int buttonNumColumns = info.extension
info.extensionDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : numColumns;
0
1124-
1125 if (classic
classicDescription
TRUEnever evaluated
FALSEnever evaluated
|| modern
modernDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1126 if (!bottomRuler
!bottomRulerDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
classicDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.sideWidget
info.sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1137 if (info.extension
info.extensionDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
macDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1145 mainLayout->setColumnMinimumWidth(2, 21);
never executed: mainLayout->setColumnMinimumWidth(2, 21);
0
1146-
1147 if (headerWidget
headerWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1148 headerWidget->setVisible(info.header);
never executed: headerWidget->setVisible(info.header);
0
1149 if (titleLabel
titleLabelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1150 titleLabel->setVisible(info.title);
never executed: titleLabel->setVisible(info.title);
0
1151 if (subTitleLabel
subTitleLabelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1152 subTitleLabel->setVisible(info.subTitle);
never executed: subTitleLabel->setVisible(info.subTitle);
0
1153 if (bottomRuler
bottomRulerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1154 bottomRuler->setVisible(classic || modern);
never executed: bottomRuler->setVisible(classic || modern);
0
1155 if (watermarkLabel
watermarkLabelDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
1161void QWizardPrivate::updateLayout()-
1162{-
1163 QWizard * const q = q_func();-
1164-
1165 disableUpdates();-
1166-
1167 QWizardLayoutInfo info = layoutInfoForCurrentPage();-
1168 if (layoutInfo != info
layoutInfo != infoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1169 recreateLayout(info);
never executed: recreateLayout(info);
0
1170 QWizardPage *page = q->currentPage();-
1171-
1172-
1173-
1174-
1175-
1176-
1177 if (page
pageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1178 bool expandPage = !page->layout();-
1179 if (!expandPage
!expandPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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__,1301) : 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
info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1190 ((!(page)) ? qt_assert("page",__FILE__,1307) : 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
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.sideWidget
info.sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1197 QPixmap pix;-
1198 if (info.watermark
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1199 if (page
pageDescription
TRUEnever evaluated
FALSEnever evaluated
)
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
info.titleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1208 ((!(page)) ? qt_assert("page",__FILE__,1325) : qt_noop());-
1209 titleLabel->setTextFormat(titleFmt);-
1210 titleLabel->setText(page->title());-
1211 }
never executed: end of block
0
1212 if (info.subTitle
info.subTitleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1213 ((!(page)) ? qt_assert("page",__FILE__,1330) : 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-
1222void 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
info.headerDescription
TRUEnever evaluated
FALSEnever evaluated
&& headerWidget->maximumWidth() != ((1<<24)-1)
headerWidget->...!= ((1<<24)-1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1234 minimumSize.setWidth(headerWidget->maximumWidth());-
1235 maximumSize.setWidth(headerWidget->maximumWidth());-
1236 }
never executed: end of block
0
1237 if (info.watermark
info.watermarkDescription
TRUEnever evaluated
FALSEnever evaluated
&& !info.sideWidget
!info.sideWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1238 minimumSize.setHeight(mainLayout->totalSizeHint().height());-
1239 }
never executed: end of block
0
1240 if (q->minimumWidth() == minimumWidth
q->minimumWidt...= minimumWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1241 minimumWidth = minimumSize.width();-
1242 q->setMinimumWidth(minimumWidth);-
1243 }
never executed: end of block
0
1244 if (q->minimumHeight() == minimumHeight
q->minimumHeig... minimumHeightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1245 minimumHeight = minimumSize.height();-
1246 q->setMinimumHeight(minimumHeight);-
1247 }
never executed: end of block
0
1248 if (q->maximumWidth() == maximumWidth
q->maximumWidt...= maximumWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1249 maximumWidth = maximumSize.width();-
1250 q->setMaximumWidth(maximumWidth);-
1251 }
never executed: end of block
0
1252 if (q->maximumHeight() == maximumHeight
q->maximumHeig... maximumHeightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1253 maximumHeight = maximumSize.height();-
1254 q->setMaximumHeight(maximumHeight);-
1255 }
never executed: end of block
0
1256}
never executed: end of block
0
1257-
1258void QWizardPrivate::updateCurrentPage()-
1259{-
1260 QWizard * const q = q_func();-
1261 if (q->currentPage()
q->currentPage()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1262 canContinue = (q->nextId() != -1);-
1263 canFinish = q->currentPage()->isFinalPage();-
1264 }
never executed: end of block
else {
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-
1272static QString object_name_for_button(QWizard::WizardButton which)-
1273{-
1274 switch (which) {-
1275 case
never executed: case QWizard::CommitButton:
QWizard::CommitButton:
never executed: case QWizard::CommitButton:
0
1276 return
never executed: return QLatin1String("qt_wizard_") + QLatin1String("commit");
QLatin1String("qt_wizard_") + QLatin1String("commit");
never executed: return QLatin1String("qt_wizard_") + QLatin1String("commit");
0
1277 case
never executed: case QWizard::FinishButton:
QWizard::FinishButton:
never executed: case QWizard::FinishButton:
0
1278 return
never executed: return QLatin1String("qt_wizard_") + QLatin1String("finish");
QLatin1String("qt_wizard_") + QLatin1String("finish");
never executed: return QLatin1String("qt_wizard_") + QLatin1String("finish");
0
1279 case
never executed: case QWizard::CancelButton:
QWizard::CancelButton:
never executed: case QWizard::CancelButton:
0
1280 return
never executed: return QLatin1String("qt_wizard_") + QLatin1String("cancel");
QLatin1String("qt_wizard_") + QLatin1String("cancel");
never executed: return QLatin1String("qt_wizard_") + QLatin1String("cancel");
0
1281 case
never executed: case QWizard::BackButton:
QWizard::BackButton:
never executed: case QWizard::BackButton:
0
1282 case
never executed: case QWizard::NextButton:
QWizard::NextButton:
never executed: case QWizard::NextButton:
0
1283 case
never executed: case QWizard::HelpButton:
QWizard::HelpButton:
never executed: case QWizard::HelpButton:
0
1284 case
never executed: case QWizard::CustomButton1:
QWizard::CustomButton1:
never executed: case QWizard::CustomButton1:
0
1285 case
never executed: case QWizard::CustomButton2:
QWizard::CustomButton2:
never executed: case QWizard::CustomButton2:
0
1286 case
never executed: case QWizard::CustomButton3:
QWizard::CustomButton3:
never executed: case QWizard::CustomButton3:
0
1287-
1288 return
never executed: return QLatin1String("__qt__passive_wizardbutton") + QString::number(which);
QLatin1String("__qt__passive_wizardbutton") + QString::number(which);
never executed: return QLatin1String("__qt__passive_wizardbutton") + QString::number(which);
0
1289 case
never executed: case QWizard::Stretch:
QWizard::Stretch:
never executed: case QWizard::Stretch:
0
1290 case
never executed: case QWizard::NoButton:
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__,1412) : qt_noop()); __builtin_unreachable(); } while (0);-
1296 return
never executed: return QString();
QString();
never executed: return QString();
0
1297}-
1298-
1299bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const-
1300{-
1301 const QWizard * const q = q_func();-
1302 if (uint(which) >= QWizard::NButtons
uint(which) >=...zard::NButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1303 return
never executed: return false;
false;
never executed: return false;
0
1304-
1305 if (!btns[which]
!btns[which]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1306 QPushButton *pushButton = new QPushButton(antiFlickerWidget);-
1307 QStyle *style = q->style();-
1308 if (style != QApplication::style()
style != QApplication::style()Description
TRUEnever evaluated
FALSEnever evaluated
)
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
which < QWizar...tandardButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
)
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: return true;
true;
never executed: return true;
0
1326}-
1327-
1328void QWizardPrivate::connectButton(QWizard::WizardButton which) const-
1329{-
1330 const QWizard * const q = q_func();-
1331 if (which < QWizard::NStandardButtons
which < QWizar...tandardButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1332 QObject::connect(btns[which], qFlagLocation("2""clicked()" "\0" __FILE__ ":" "1449"), q, buttonSlots(which));-
1333 }
never executed: end of block
else {
0
1334 QObject::connect(btns[which], qFlagLocation("2""clicked()" "\0" __FILE__ ":" "1451"), q, qFlagLocation("1""_q_emitCustomButtonClicked()" "\0" __FILE__ ":" "1451"));-
1335 }
never executed: end of block
0
1336}-
1337-
1338void QWizardPrivate::updateButtonTexts()-
1339{-
1340 QWizard * const q = q_func();-
1341 for (int i = 0; i < QWizard::NButtons
i < QWizard::NButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1342 if (btns[i]
btns[i]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1343 if (q->currentPage()
q->currentPage()Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(q->currentPag...s.contains(i))Description
TRUEnever evaluated
FALSEnever evaluated
q->currentPage()->d_func()->buttonCustomTexts.contains(i))
(q->currentPag...s.contains(i))Description
TRUEnever evaluated
FALSEnever evaluated
)
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)
buttonCustomTexts.contains(i)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1346 btns[i]->setText(buttonCustomTexts.value(i));
never executed: btns[i]->setText(buttonCustomTexts.value(i));
0
1347 else if (i < QWizard::NStandardButtons
i < QWizard::NStandardButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
)
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]
btns[QWizard::NextButton]Description
TRUEnever evaluated
FALSEnever evaluated
)
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-
1358void QWizardPrivate::updateButtonLayout()-
1359{-
1360 if (buttonsHaveCustomLayout
buttonsHaveCustomLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1361 QVarLengthArray<QWizard::WizardButton, QWizard::NButtons> array(buttonsCustomLayout.count());-
1362 for (int i = 0; i < buttonsCustomLayout.count()
i < buttonsCus...Layout.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1363 array[i] = buttonsCustomLayout.at(i);
never executed: array[i] = buttonsCustomLayout.at(i);
0
1364 setButtonLayout(array.constData(), array.count());-
1365 }
never executed: end of block
else {
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__,1489) : qt_noop());-
1373-
1374 if (opts & QWizard::HaveHelpButton
opts & QWizard::HaveHelpButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1375 int i = (
(opts & QWizar...ButtonOnRight)Description
TRUEnever evaluated
FALSEnever evaluated
opts & QWizard::HelpButtonOnRight)
(opts & QWizar...ButtonOnRight)Description
TRUEnever evaluated
FALSEnever evaluated
? 11 : 0;
0
1376 array[i] = QWizard::HelpButton;-
1377 }
never executed: end of block
0
1378 array[1] = QWizard::Stretch;-
1379 if (opts & QWizard::HaveCustomButton1
opts & QWizard...eCustomButton1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1380 array[2] = QWizard::CustomButton1;
never executed: array[2] = QWizard::CustomButton1;
0
1381 if (opts & QWizard::HaveCustomButton2
opts & QWizard...eCustomButton2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1382 array[3] = QWizard::CustomButton2;
never executed: array[3] = QWizard::CustomButton2;
0
1383 if (opts & QWizard::HaveCustomButton3
opts & QWizard...eCustomButton3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1384 array[4] = QWizard::CustomButton3;
never executed: array[4] = QWizard::CustomButton3;
0
1385-
1386 if (!(opts & QWizard::NoCancelButton)
!(opts & QWiza...oCancelButton)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1387 int i = (
(opts & QWizar...lButtonOnLeft)Description
TRUEnever evaluated
FALSEnever evaluated
opts & QWizard::CancelButtonOnLeft)
(opts & QWizar...lButtonOnLeft)Description
TRUEnever evaluated
FALSEnever evaluated
? 5 : 10;
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-
1399void QWizardPrivate::setButtonLayout(const QWizard::WizardButton *array, int size)-
1400{-
1401 QWidget *prev = pageFrame;-
1402-
1403 for (int i = buttonLayout->count() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
1404 QLayoutItem *item = buttonLayout->takeAt(i);-
1405 if (QWidget *widget = item->widget()
QWidget *widge...item->widget()Description
TRUEnever evaluated
FALSEnever evaluated
)
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
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1411 QWizard::WizardButton which = array[i];-
1412 if (which == QWizard::Stretch
which == QWizard::StretchDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1413 buttonLayout->addStretch(1);-
1414 }
never executed: end of block
else if (which != QWizard::NoButton
which != QWizard::NoButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1415 ensureButton(which);-
1416 buttonLayout->addWidget(btns[which]);-
1417-
1418-
1419 if (which != QWizard::BackButton
which != QWizard::BackButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& which != QWizard::NextButton
which != QWizard::NextButtonDescription
TRUEnever evaluated
FALSEnever evaluated
0
1420 && which != QWizard::CommitButton
which != QWizard::CommitButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& which != QWizard::FinishButton
which != QWizard::FinishButtonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1421 btns[which]->show();
never executed: btns[which]->show();
0
1422-
1423 if (prev
prevDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
1432bool QWizardPrivate::buttonLayoutContains(QWizard::WizardButton which)-
1433{-
1434 return
never executed: return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
!buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
never executed: return !buttonsHaveCustomLayout || buttonsCustomLayout.contains(which);
0
1435}-
1436-
1437void QWizardPrivate::updatePixmap(QWizard::WizardPixmap which)-
1438{-
1439 QWizard * const q = q_func();-
1440 if (which == QWizard::BackgroundPixmap
which == QWiza...ckgroundPixmapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1441 if (wizStyle == QWizard::MacStyle
wizStyle == QWizard::MacStyleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1442 q->update();-
1443 q->updateGeometry();-
1444 }
never executed: end of block
0
1445 }
never executed: end of block
else {
0
1446 updateLayout();-
1447 }
never executed: end of block
0
1448}-
1449bool QWizardPrivate::isVistaThemeEnabled() const-
1450{-
1451-
1452-
1453-
1454-
1455 return
never executed: return false;
false;
never executed: return false;
0
1456-
1457}-
1458-
1459void QWizardPrivate::disableUpdates()-
1460{-
1461 QWizard * const q = q_func();-
1462 if (disableUpdatesCount++ == 0
disableUpdatesCount++ == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1463 q->setUpdatesEnabled(false);-
1464 antiFlickerWidget->hide();-
1465 }
never executed: end of block
0
1466}
never executed: end of block
0
1467-
1468void QWizardPrivate::enableUpdates()-
1469{-
1470 QWizard * const q = q_func();-
1471 if (--
--disableUpdatesCount == 0Description
TRUEnever evaluated
FALSEnever evaluated
disableUpdatesCount == 0
--disableUpdatesCount == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1472 antiFlickerWidget->show();-
1473 q->setUpdatesEnabled(true);-
1474 }
never executed: end of block
0
1475}
never executed: end of block
0
1476-
1477void QWizardPrivate::_q_emitCustomButtonClicked()-
1478{-
1479 QWizard * const q = q_func();-
1480 QObject *button = q->sender();-
1481 for (int i = QWizard::NStandardButtons; i < QWizard::NButtons
i < QWizard::NButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1482 if (btns[i] == button
btns[i] == buttonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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-
1489void QWizardPrivate::_q_updateButtonStates()-
1490{-
1491 QWizard * const q = q_func();-
1492-
1493 disableUpdates();-
1494-
1495 const QWizardPage *page = q->currentPage();-
1496 bool complete = page
pageDescription
TRUEnever evaluated
FALSEnever evaluated
&& page->isComplete()
page->isComplete()Description
TRUEnever evaluated
FALSEnever evaluated
;
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)
buttonLayoutCo...d::BackButton)Description
TRUEnever evaluated
FALSEnever evaluated
0
1506 && (history.count() > 1
history.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
|| !(opts & QWizard::NoBackButtonOnStartPage)
!(opts & QWiza...onOnStartPage)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1507 && (canContinue
canContinueDescription
TRUEnever evaluated
FALSEnever evaluated
|| !(opts & QWizard::NoBackButtonOnLastPage)
!(opts & QWiza...tonOnLastPage)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1508 bool commitPage = page
pageDescription
TRUEnever evaluated
FALSEnever evaluated
&& page->isCommitPage()
page->isCommitPage()Description
TRUEnever evaluated
FALSEnever evaluated
;
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)
!(opts & QWiza...oCancelButton)Description
TRUEnever evaluated
FALSEnever evaluated
)
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)
QPushButton *n...n *>(btn.next)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1523 nextPush->setDefault(canContinue && useDefault && !commitPage);
never executed: nextPush->setDefault(canContinue && useDefault && !commitPage);
0
1524 if (QPushButton *commitPush = qobject_cast<QPushButton *>(btn.commit)
QPushButton *c...*>(btn.commit)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1525 commitPush->setDefault(canContinue && useDefault && commitPage);
never executed: commitPush->setDefault(canContinue && useDefault && commitPage);
0
1526 if (QPushButton *finishPush = qobject_cast<QPushButton *>(btn.finish)
QPushButton *f...*>(btn.finish)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1527 finishPush->setDefault(!canContinue && useDefault);
never executed: finishPush->setDefault(!canContinue && useDefault);
0
1528 enableUpdates();-
1529}
never executed: end of block
0
1530-
1531void QWizardPrivate::_q_handleFieldObjectDestroyed(QObject *object)-
1532{-
1533 int destroyed_index = -1;-
1534 QVector<QWizardField>::iterator it = fields.begin();-
1535 while (it != fields.end()
it != fields.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1536 const QWizardField &field = *it;-
1537 if (field.object == object
field.object == objectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1538 destroyed_index = fieldIndexMap.value(field.name, -1);-
1539 fieldIndexMap.remove(field.name);-
1540 it = fields.erase(it);-
1541 }
never executed: end of block
else {
0
1542 ++it;-
1543 }
never executed: end of block
0
1544 }-
1545 if (destroyed_index != -1
destroyed_index != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1546 QMap<QString, int>::iterator it2 = fieldIndexMap.begin();-
1547 while (it2 != fieldIndexMap.end()
it2 != fieldIndexMap.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1548 int index = it2.value();-
1549 if (index > destroyed_index
index > destroyed_indexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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-
1558void QWizardPrivate::setStyle(QStyle *style)-
1559{-
1560 for (int i = 0; i < QWizard::NButtons
i < QWizard::NButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
1561 if (btns[i]
btns[i]Description
TRUEnever evaluated
FALSEnever evaluated
)
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
it != pcendDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
1565 it.value()->setStyle(style);
never executed: it.value()->setStyle(style);
0
1566}
never executed: end of block
0
1567QWizard::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-
1581QWizard::~QWizard()-
1582{-
1583 QWizardPrivate * const d = d_func();-
1584 delete d->buttonLayout;-
1585}
never executed: end of block
0
1586int QWizard::addPage(QWizardPage *page)-
1587{-
1588 QWizardPrivate * const d = d_func();-
1589 int theid = 0;-
1590 if (!d->pageMap.isEmpty()
!d->pageMap.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
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: return theid;
theid;
never executed: return theid;
0
1594}-
1595void QWizard::setPage(int theid, QWizardPage *page)-
1596{-
1597 QWizardPrivate * const d = d_func();-
1598-
1599 if (__builtin_expect(!!(!page), false)
__builtin_expe...!page), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1600 QMessageLogger(__FILE__, 2266, __PRETTY_FUNCTION__).warning("QWizard::setPage: Cannot insert null page");-
1601 return;
never executed: return;
0
1602 }-
1603-
1604 if (__builtin_expect(!!(theid == -1), false)
__builtin_expe...== -1), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1605 QMessageLogger(__FILE__, 2271, __PRETTY_FUNCTION__).warning("QWizard::setPage: Cannot insert page with ID -1");-
1606 return;
never executed: return;
0
1607 }-
1608-
1609 if (__builtin_expect(!!(d->pageMap.contains(theid)), false)
__builtin_expe...heid)), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1610 QMessageLogger(__FILE__, 2276, __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()
i < pendingFields.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
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__ ":" "2287"), this, qFlagLocation("1""_q_updateButtonStates()" "\0" __FILE__ ":" "2287"));-
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
!d->startSetByUserDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->pageMap.constBegin().key() == theid
d->pageMap.con...key() == theidDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1639 d->start = theid;
never executed: d->start = theid;
0
1640 pageAdded(theid);-
1641}
never executed: end of block
0
1642void QWizard::removePage(int id)-
1643{-
1644 QWizardPrivate * const d = d_func();-
1645-
1646 QWizardPage *removedPage = 0;-
1647-
1648-
1649 if (d->pageMap.count() > 0
d->pageMap.count() > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1650 if (d->start == id
d->start == idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1651 const int firstId = d->pageMap.constBegin().key();-
1652 if (firstId == id
firstId == idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1653 if (d->pageMap.count() > 1
d->pageMap.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
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)
d->pageMap.contains(id)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1665 pageRemoved(id);
never executed: pageRemoved(id);
0
1666-
1667 if (!d->history.contains(id)
!d->history.contains(id)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1668-
1669 removedPage = d->pageMap.take(id);-
1670 d->updateCurrentPage();-
1671 }
never executed: end of block
else if (id != d->current
id != d->currentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1672-
1673 removedPage = d->pageMap.take(id);-
1674 d->history.removeOne(id);-
1675 d->_q_updateButtonStates();-
1676 }
never executed: end of block
else if (d->history.count() == 1
d->history.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1677-
1678 d->reset();-
1679 removedPage = d->pageMap.take(id);-
1680 if (d->pageMap.isEmpty()
d->pageMap.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
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
removedPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1692 if (d->initialized.contains(id)
d->initialized.contains(id)Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
1700 if (d->fields.at(i).page == removedPage
d->fields.at(i...== removedPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
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
1707QWizardPage *QWizard::page(int theid) const-
1708{-
1709 const QWizardPrivate * const d = d_func();-
1710 return
never executed: return d->pageMap.value(theid);
d->pageMap.value(theid);
never executed: return d->pageMap.value(theid);
0
1711}-
1712bool QWizard::hasVisitedPage(int theid) const-
1713{-
1714 const QWizardPrivate * const d = d_func();-
1715 return
never executed: return d->history.contains(theid);
d->history.contains(theid);
never executed: return d->history.contains(theid);
0
1716}-
1717QList<int> QWizard::visitedPages() const-
1718{-
1719 const QWizardPrivate * const d = d_func();-
1720 return
never executed: return d->history;
d->history;
never executed: return d->history;
0
1721}-
1722-
1723-
1724-
1725-
1726-
1727QList<int> QWizard::pageIds() const-
1728{-
1729 const QWizardPrivate * const d = d_func();-
1730 return
never executed: return d->pageMap.keys();
d->pageMap.keys();
never executed: return d->pageMap.keys();
0
1731}-
1732void QWizard::setStartId(int theid)-
1733{-
1734 QWizardPrivate * const d = d_func();-
1735 int newStart = theid;-
1736 if (theid == -1
theid == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1737 newStart = d->pageMap.count()
d->pageMap.count()Description
TRUEnever evaluated
FALSEnever evaluated
? d->pageMap.constBegin().key() : -1;
never executed: newStart = d->pageMap.count() ? d->pageMap.constBegin().key() : -1;
0
1738-
1739 if (d->start == newStart
d->start == newStartDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1740 d->startSetByUser = theid != -1;-
1741 return;
never executed: return;
0
1742 }-
1743-
1744 if (__builtin_expect(!!(!d->pageMap.contains(newStart)), false)
__builtin_expe...tart)), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1745 QMessageLogger(__FILE__, 2460, __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-
1752int QWizard::startId() const-
1753{-
1754 const QWizardPrivate * const d = d_func();-
1755 return
never executed: return d->start;
d->start;
never executed: return d->start;
0
1756}-
1757QWizardPage *QWizard::currentPage() const-
1758{-
1759 const QWizardPrivate * const d = d_func();-
1760 return
never executed: return page(d->current);
page(d->current);
never executed: return page(d->current);
0
1761}-
1762int QWizard::currentId() const-
1763{-
1764 const QWizardPrivate * const d = d_func();-
1765 return
never executed: return d->current;
d->current;
never executed: return d->current;
0
1766}-
1767void 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 (__builtin_expect(!!(index == -1), false)
__builtin_expe...== -1), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1773 QMessageLogger(__FILE__, 2518, __PRETTY_FUNCTION__).warning("QWizard::setField: No such field '%ls'", static_cast<const wchar_t*>(static_cast<const void*>(QString(name).utf16())));-
1774 return;
never executed: return;
0
1775 }-
1776-
1777 const QWizardField &field = d->fields.at(index);-
1778 if (__builtin_expect(!!(!field.object->setProperty(field.property, value)), false)
__builtin_expe...alue)), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1779 QMessageLogger(__FILE__, 2524, __PRETTY_FUNCTION__).warning("QWizard::setField: Couldn't write to property '%s'",
never executed: QMessageLogger(__FILE__, 2524, __PRETTY_FUNCTION__).warning("QWizard::setField: Couldn't write to property '%s'", field.property.constData());
0
1780 field.property.constData());
never executed: QMessageLogger(__FILE__, 2524, __PRETTY_FUNCTION__).warning("QWizard::setField: Couldn't write to property '%s'", field.property.constData());
0
1781}
never executed: end of block
0
1782QVariant 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 (__builtin_expect(!!(index == -1), false)
__builtin_expe...== -1), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1788 QMessageLogger(__FILE__, 2541, __PRETTY_FUNCTION__).warning("QWizard::field: No such field '%ls'", static_cast<const wchar_t*>(static_cast<const void*>(QString(name).utf16())));-
1789 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
1790 }-
1791-
1792 const QWizardField &field = d->fields.at(index);-
1793 return
never executed: return field.object->property(field.property);
field.object->property(field.property);
never executed: return field.object->property(field.property);
0
1794}-
1795void QWizard::setWizardStyle(WizardStyle style)-
1796{-
1797 QWizardPrivate * const d = d_func();-
1798-
1799 const bool styleChange = style != d->wizStyle;-
1800 if (styleChange
styleChangeDescription
TRUEnever evaluated
FALSEnever evaluated
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-
1819QWizard::WizardStyle QWizard::wizardStyle() const-
1820{-
1821 const QWizardPrivate * const d = d_func();-
1822 return
never executed: return d->wizStyle;
d->wizStyle;
never executed: return d->wizStyle;
0
1823}-
1824-
1825-
1826-
1827-
1828-
1829-
1830-
1831void QWizard::setOption(WizardOption option, bool on)-
1832{-
1833 QWizardPrivate * const d = d_func();-
1834 if (!(d->opts & option) != !on
!(d->opts & option) != !onDescription
TRUEnever evaluated
FALSEnever evaluated
)
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-
1844bool QWizard::testOption(WizardOption option) const-
1845{-
1846 const QWizardPrivate * const d = d_func();-
1847 return
never executed: return (d->opts & option) != 0;
(d->opts & option) != 0;
never executed: return (d->opts & option) != 0;
0
1848}-
1849void QWizard::setOptions(WizardOptions options)-
1850{-
1851 QWizardPrivate * const d = d_func();-
1852-
1853 WizardOptions changed = (options ^ d->opts);-
1854 if (!changed
!changedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1855 return;
never executed: return;
0
1856-
1857 d->disableUpdates();-
1858-
1859 d->opts = options;-
1860 if ((
(changed & IndependentPages)Description
TRUEnever evaluated
FALSEnever evaluated
changed & IndependentPages)
(changed & IndependentPages)Description
TRUEnever evaluated
FALSEnever evaluated
&& !(d->opts & IndependentPages)
!(d->opts & IndependentPages)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1861 d->cleanupPagesNotInHistory();
never executed: d->cleanupPagesNotInHistory();
0
1862-
1863 if (changed & (NoDefaultButton | HaveHelpButton | HelpButtonOnRight | NoCancelButton
changed & (NoD...CustomButton3)Description
TRUEnever evaluated
FALSEnever evaluated
0
1864 | CancelButtonOnLeft | HaveCustomButton1 | HaveCustomButton2
changed & (NoD...CustomButton3)Description
TRUEnever evaluated
FALSEnever evaluated
0
1865 | HaveCustomButton3)
changed & (NoD...CustomButton3)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1866 d->updateButtonLayout();-
1867 }
never executed: end of block
else if (changed & (NoBackButtonOnStartPage | NoBackButtonOnLastPage
changed & (NoB...tonOnLastPage)Description
TRUEnever evaluated
FALSEnever evaluated
0
1868 | HaveNextButtonOnLastPage | HaveFinishButtonOnEarlyPages
changed & (NoB...tonOnLastPage)Description
TRUEnever evaluated
FALSEnever evaluated
0
1869 | DisabledBackButtonOnLastPage | NoCancelButtonOnLastPage)
changed & (NoB...tonOnLastPage)Description
TRUEnever evaluated
FALSEnever evaluated
) {
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-
1877QWizard::WizardOptions QWizard::options() const-
1878{-
1879 const QWizardPrivate * const d = d_func();-
1880 return
never executed: return d->opts;
d->opts;
never executed: return d->opts;
0
1881}-
1882void QWizard::setButtonText(WizardButton which, const QString &text)-
1883{-
1884 QWizardPrivate * const d = d_func();-
1885-
1886 if (!d->ensureButton(which)
!d->ensureButton(which)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1887 return;
never executed: return;
0
1888-
1889 d->buttonCustomTexts.insert(which, text);-
1890-
1891 if (!currentPage()
!currentPage()Description
TRUEnever evaluated
FALSEnever evaluated
|| !currentPage()->d_func()->buttonCustomTexts.contains(which)
!currentPage()...ontains(which)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1892 d->btns[which]->setText(text);
never executed: d->btns[which]->setText(text);
0
1893}
never executed: end of block
0
1894QString QWizard::buttonText(WizardButton which) const-
1895{-
1896 const QWizardPrivate * const d = d_func();-
1897-
1898 if (!d->ensureButton(which)
!d->ensureButton(which)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1899 return
never executed: return QString();
QString();
never executed: return QString();
0
1900-
1901 if (d->buttonCustomTexts.contains(which)
d->buttonCusto...ontains(which)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1902 return
never executed: return d->buttonCustomTexts.value(which);
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()
!defText.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1906 return
never executed: return defText;
defText;
never executed: return defText;
0
1907-
1908 return
never executed: return d->btns[which]->text();
d->btns[which]->text();
never executed: return d->btns[which]->text();
0
1909}-
1910void QWizard::setButtonLayout(const QList<WizardButton> &layout)-
1911{-
1912 QWizardPrivate * const d = d_func();-
1913-
1914 for (int i = 0; i < layout.count()
i < layout.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1915 WizardButton button1 = layout.at(i);-
1916-
1917 if (button1 == NoButton
button1 == NoButtonDescription
TRUEnever evaluated
FALSEnever evaluated
|| button1 == Stretch
button1 == StretchDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1918 continue;
never executed: continue;
0
1919 if (!d->ensureButton(button1)
!d->ensureButton(button1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1920 return;
never executed: return;
0
1921-
1922-
1923 for (int j = 0; j < i
j < iDescription
TRUEnever evaluated
FALSEnever evaluated
; ++j) {
0
1924 WizardButton button2 = layout.at(j);-
1925 if (__builtin_expect(!!(button2 == button1), false)
__builtin_expe...tton1), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1926 QMessageLogger(__FILE__, 2773, __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
1936void QWizard::setButton(WizardButton which, QAbstractButton *button)-
1937{-
1938 QWizardPrivate * const d = d_func();-
1939-
1940 if (uint(which) >= NButtons
uint(which) >= NButtonsDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->btns[which] == button
d->btns[which] == buttonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1941 return;
never executed: return;
0
1942-
1943 if (QAbstractButton *oldButton = d->btns[which]
QAbstractButto...d->btns[which]Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
buttonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1950 button->setParent(d->antiFlickerWidget);-
1951 d->buttonCustomTexts.insert(which, button->text());-
1952 d->connectButton(which);-
1953 }
never executed: end of block
else {
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-
1966QAbstractButton *QWizard::button(WizardButton which) const-
1967{-
1968 const QWizardPrivate * const d = d_func();-
1969-
1970-
1971-
1972-
1973 if (!d->ensureButton(which)
!d->ensureButton(which)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1974 return
never executed: return 0;
0;
never executed: return 0;
0
1975 return
never executed: return d->btns[which];
d->btns[which];
never executed: return d->btns[which];
0
1976}-
1977void 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-
1984Qt::TextFormat QWizard::titleFormat() const-
1985{-
1986 const QWizardPrivate * const d = d_func();-
1987 return
never executed: return d->titleFmt;
d->titleFmt;
never executed: return d->titleFmt;
0
1988}-
1989void 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-
1996Qt::TextFormat QWizard::subTitleFormat() const-
1997{-
1998 const QWizardPrivate * const d = d_func();-
1999 return
never executed: return d->subTitleFmt;
d->subTitleFmt;
never executed: return d->subTitleFmt;
0
2000}-
2001void QWizard::setPixmap(WizardPixmap which, const QPixmap &pixmap)-
2002{-
2003 QWizardPrivate * const d = d_func();-
2004 ((!(uint(which) < NPixmaps)) ? qt_assert("uint(which) < NPixmaps",__FILE__,2893) : qt_noop());-
2005 d->defaultPixmaps[which] = pixmap;-
2006 d->updatePixmap(which);-
2007}
never executed: end of block
0
2008QPixmap QWizard::pixmap(WizardPixmap which) const-
2009{-
2010 const QWizardPrivate * const d = d_func();-
2011 ((!(uint(which) < NPixmaps)) ? qt_assert("uint(which) < NPixmaps",__FILE__,2909) : qt_noop());-
2012-
2013-
2014-
2015-
2016 return
never executed: return d->defaultPixmaps[which];
d->defaultPixmaps[which];
never executed: return d->defaultPixmaps[which];
0
2017}-
2018void 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
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
2023 if (qstrcmp(d->defaultPropertyTable.at(i).className, className) == 0
qstrcmp(d->def...lassName) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
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
2030void QWizard::setSideWidget(QWidget *widget)-
2031{-
2032 QWizardPrivate * const d = d_func();-
2033-
2034 d->sideWidget = widget;-
2035 if (d->watermarkLabel
d->watermarkLabelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2036 d->watermarkLabel->setSideWidget(widget);-
2037 d->updateLayout();-
2038 }
never executed: end of block
0
2039}
never executed: end of block
0
2040QWidget *QWizard::sideWidget() const-
2041{-
2042 const QWizardPrivate * const d = d_func();-
2043-
2044 return
never executed: return d->sideWidget;
d->sideWidget;
never executed: return d->sideWidget;
0
2045}-
2046-
2047-
2048-
2049-
2050void QWizard::setVisible(bool visible)-
2051{-
2052 QWizardPrivate * const d = d_func();-
2053 if (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2054 if (d->current == -1
d->current == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
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-
2063QSize 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
d->wizStyle == MacStyleDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->current != -1
d->current != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2069 QSize pixmap(currentPage()->pixmap(BackgroundPixmap).size());-
2070 extra.setWidth(616);-
2071 if (!pixmap.isNull()
!pixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2072 extra.setHeight(pixmap.height());-
2073-
2074-
2075-
2076-
2077-
2078-
2079-
2080 if (pixmap.width() >= pixmap.height()
pixmap.width()...ixmap.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
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: return result.expandedTo(extra);
result.expandedTo(extra);
never executed: return result.expandedTo(extra);
0
2085}-
2086void QWizard::back()-
2087{-
2088 QWizardPrivate * const d = d_func();-
2089 int n = d->history.count() - 2;-
2090 if (n < 0
n < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2091 return;
never executed: return;
0
2092 d->switchToPage(d->history.at(n), QWizardPrivate::Backward);-
2093}
never executed: end of block
0
2094void QWizard::next()-
2095{-
2096 QWizardPrivate * const d = d_func();-
2097-
2098 if (d->current == -1
d->current == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2099 return;
never executed: return;
0
2100-
2101 if (validateCurrentPage()
validateCurrentPage()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2102 int next = nextId();-
2103 if (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2104 if (__builtin_expect(!!(d->history.contains(next)), false)
__builtin_expe...next)), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2105 QMessageLogger(__FILE__, 3150, __PRETTY_FUNCTION__).warning("QWizard::next: Page %d already met", next);-
2106 return;
never executed: return;
0
2107 }-
2108 if (__builtin_expect(!!(!d->pageMap.contains(next)), false)
__builtin_expe...next)), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2109 QMessageLogger(__FILE__, 3154, __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-
2123void 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-
2135bool QWizard::event(QEvent *event)-
2136{-
2137 QWizardPrivate * const d = d_func();-
2138 if (event->type() == QEvent::StyleChange
event->type() ...t::StyleChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2139 d->setStyle(style());-
2140 d->updateLayout();-
2141 }
never executed: end of block
0
2142 return
never executed: return QDialog::event(event);
QDialog::event(event);
never executed: return QDialog::event(event);
0
2143}-
2144-
2145-
2146-
2147-
2148void 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-
2170void QWizard::paintEvent(QPaintEvent * event)-
2171{-
2172 QWizardPrivate * const d = d_func();-
2173 if (d->wizStyle == MacStyle
d->wizStyle == MacStyleDescription
TRUEnever evaluated
FALSEnever evaluated
&& currentPage()
currentPage()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2174 QPixmap backgroundPixmap = currentPage()->pixmap(BackgroundPixmap);-
2175 if (backgroundPixmap.isNull()
backgroundPixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
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
2184void QWizard::done(int result)-
2185{-
2186 QWizardPrivate * const d = d_func();-
2187-
2188 if (result == Rejected
result == RejectedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2189 d->reset();-
2190 }
never executed: end of block
else {
0
2191 if (!validateCurrentPage()
!validateCurrentPage()Description
TRUEnever evaluated
FALSEnever evaluated
)
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
2196void QWizard::initializePage(int theid)-
2197{-
2198 QWizardPage *page = this->page(theid);-
2199 if (page
pageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2200 page->initializePage();
never executed: page->initializePage();
0
2201}
never executed: end of block
0
2202void QWizard::cleanupPage(int theid)-
2203{-
2204 QWizardPage *page = this->page(theid);-
2205 if (page
pageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2206 page->cleanupPage();
never executed: page->cleanupPage();
0
2207}
never executed: end of block
0
2208bool QWizard::validateCurrentPage()-
2209{-
2210 QWizardPage *page = currentPage();-
2211 if (!page
!pageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2212 return
never executed: return true;
true;
never executed: return true;
0
2213-
2214 return
never executed: return page->validatePage();
page->validatePage();
never executed: return page->validatePage();
0
2215}-
2216int QWizard::nextId() const-
2217{-
2218 const QWizardPage *page = currentPage();-
2219 if (!page
!pageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2220 return
never executed: return -1;
-1;
never executed: return -1;
0
2221-
2222 return
never executed: return page->nextId();
page->nextId();
never executed: return page->nextId();
0
2223}-
2224QWizardPage::QWizardPage(QWidget *parent)-
2225 : QWidget(*new QWizardPagePrivate, parent, 0)-
2226{-
2227 connect(this, qFlagLocation("2""completeChanged()" "\0" __FILE__ ":" "3478"), this, qFlagLocation("1""_q_updateCachedCompleteState()" "\0" __FILE__ ":" "3478"));-
2228}
never executed: end of block
0
2229-
2230-
2231-
2232-
2233QWizardPage::~QWizardPage()-
2234{-
2235}-
2236void QWizardPage::setTitle(const QString &title)-
2237{-
2238 QWizardPagePrivate * const d = d_func();-
2239 d->title = title;-
2240 if (d->wizard
d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->wizard->currentPage() == this
d->wizard->cur...Page() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2241 d->wizard->d_func()->updateLayout();
never executed: d->wizard->d_func()->updateLayout();
0
2242}
never executed: end of block
0
2243-
2244QString QWizardPage::title() const-
2245{-
2246 const QWizardPagePrivate * const d = d_func();-
2247 return
never executed: return d->title;
d->title;
never executed: return d->title;
0
2248}-
2249void QWizardPage::setSubTitle(const QString &subTitle)-
2250{-
2251 QWizardPagePrivate * const d = d_func();-
2252 d->subTitle = subTitle;-
2253 if (d->wizard
d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->wizard->currentPage() == this
d->wizard->cur...Page() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2254 d->wizard->d_func()->updateLayout();
never executed: d->wizard->d_func()->updateLayout();
0
2255}
never executed: end of block
0
2256-
2257QString QWizardPage::subTitle() const-
2258{-
2259 const QWizardPagePrivate * const d = d_func();-
2260 return
never executed: return d->subTitle;
d->subTitle;
never executed: return d->subTitle;
0
2261}-
2262void 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__,3565) : qt_noop());-
2266 d->pixmaps[which] = pixmap;-
2267 if (d->wizard
d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->wizard->currentPage() == this
d->wizard->cur...Page() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2268 d->wizard->d_func()->updatePixmap(which);
never executed: d->wizard->d_func()->updatePixmap(which);
0
2269}
never executed: end of block
0
2270QPixmap 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__,3583) : qt_noop());-
2274-
2275 const QPixmap &pixmap = d->pixmaps[which];-
2276 if (!pixmap.isNull()
!pixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2277 return
never executed: return pixmap;
pixmap;
never executed: return pixmap;
0
2278-
2279 if (wizard()
wizard()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2280 return
never executed: return wizard()->pixmap(which);
wizard()->pixmap(which);
never executed: return wizard()->pixmap(which);
0
2281-
2282 return
never executed: return pixmap;
pixmap;
never executed: return pixmap;
0
2283}-
2284void QWizardPage::initializePage()-
2285{-
2286}-
2287void QWizardPage::cleanupPage()-
2288{-
2289 QWizardPagePrivate * const d = d_func();-
2290 if (d->wizard
d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2291 const QVector<QWizardField> &fields = d->wizard->d_func()->fields;-
2292 for (const auto &field : fields) {-
2293 if (field.page == this
field.page == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2294 field.object->setProperty(field.property, field.initialValue);
never executed: field.object->setProperty(field.property, field.initialValue);
0
2295 }
never executed: end of block
0
2296 }
never executed: end of block
0
2297}
never executed: end of block
0
2298bool QWizardPage::validatePage()-
2299{-
2300 return
never executed: return true;
true;
never executed: return true;
0
2301}-
2302bool QWizardPage::isComplete() const-
2303{-
2304 const QWizardPagePrivate * const d = d_func();-
2305-
2306 if (!d->wizard
!d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2307 return
never executed: return true;
true;
never executed: return true;
0
2308-
2309 const QVector<QWizardField> &wizardFields = d->wizard->d_func()->fields;-
2310 for (int i = wizardFields.count() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
2311 const QWizardField &field = wizardFields.at(i);-
2312 if (field.page == this
field.page == thisDescription
TRUEnever evaluated
FALSEnever evaluated
&& field.mandatory
field.mandatoryDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2313 QVariant value = field.object->property(field.property);-
2314 if (value == field.initialValue
value == field.initialValueDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2315 return
never executed: return false;
false;
never executed: return false;
0
2316-
2317-
2318 if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)
QLineEdit *lin...(field.object)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2319 if (!lineEdit->hasAcceptableInput()
!lineEdit->has...eptableInput()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2320 return
never executed: return false;
false;
never executed: return false;
0
2321 }
never executed: end of block
0
2322-
2323-
2324 if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)
QAbstractSpinB...(field.object)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2325 if (!spinBox->hasAcceptableInput()
!spinBox->hasAcceptableInput()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2326 return
never executed: return false;
false;
never executed: return false;
0
2327 }
never executed: end of block
0
2328-
2329 }
never executed: end of block
0
2330 }
never executed: end of block
0
2331 return
never executed: return true;
true;
never executed: return true;
0
2332}-
2333void QWizardPage::setFinalPage(bool finalPage)-
2334{-
2335 QWizardPagePrivate * const d = d_func();-
2336 d->explicitlyFinal = finalPage;-
2337 QWizard *wizard = this->wizard();-
2338 if (wizard
wizardDescription
TRUEnever evaluated
FALSEnever evaluated
&& wizard->currentPage() == this
wizard->currentPage() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2339 wizard->d_func()->updateCurrentPage();
never executed: wizard->d_func()->updateCurrentPage();
0
2340}
never executed: end of block
0
2341bool QWizardPage::isFinalPage() const-
2342{-
2343 const QWizardPagePrivate * const d = d_func();-
2344 if (d->explicitlyFinal
d->explicitlyFinalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2345 return
never executed: return true;
true;
never executed: return true;
0
2346-
2347 QWizard *wizard = this->wizard();-
2348 if (wizard
wizardDescription
TRUEnever evaluated
FALSEnever evaluated
&& wizard->currentPage() == this
wizard->currentPage() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2349-
2350 return
never executed: return wizard->nextId() == -1;
wizard->nextId() == -1;
never executed: return wizard->nextId() == -1;
0
2351 } else {-
2352 return
never executed: return nextId() == -1;
nextId() == -1;
never executed: return nextId() == -1;
0
2353 }-
2354}-
2355void QWizardPage::setCommitPage(bool commitPage)-
2356{-
2357 QWizardPagePrivate * const d = d_func();-
2358 d->commit = commitPage;-
2359 QWizard *wizard = this->wizard();-
2360 if (wizard
wizardDescription
TRUEnever evaluated
FALSEnever evaluated
&& wizard->currentPage() == this
wizard->currentPage() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2361 wizard->d_func()->updateCurrentPage();
never executed: wizard->d_func()->updateCurrentPage();
0
2362}
never executed: end of block
0
2363-
2364-
2365-
2366-
2367-
2368-
2369bool QWizardPage::isCommitPage() const-
2370{-
2371 const QWizardPagePrivate * const d = d_func();-
2372 return
never executed: return d->commit;
d->commit;
never executed: return d->commit;
0
2373}-
2374void QWizardPage::setButtonText(QWizard::WizardButton which, const QString &text)-
2375{-
2376 QWizardPagePrivate * const d = d_func();-
2377 d->buttonCustomTexts.insert(which, text);-
2378 if (wizard()
wizard()Description
TRUEnever evaluated
FALSEnever evaluated
&& wizard()->currentPage() == this
wizard()->curr...Page() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
&& wizard()->d_func()->btns[which]
wizard()->d_fu...)->btns[which]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2379 wizard()->d_func()->btns[which]->setText(text);
never executed: wizard()->d_func()->btns[which]->setText(text);
0
2380}
never executed: end of block
0
2381QString QWizardPage::buttonText(QWizard::WizardButton which) const-
2382{-
2383 const QWizardPagePrivate * const d = d_func();-
2384-
2385 if (d->buttonCustomTexts.contains(which)
d->buttonCusto...ontains(which)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2386 return
never executed: return d->buttonCustomTexts.value(which);
d->buttonCustomTexts.value(which);
never executed: return d->buttonCustomTexts.value(which);
0
2387-
2388 if (wizard()
wizard()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2389 return
never executed: return wizard()->buttonText(which);
wizard()->buttonText(which);
never executed: return wizard()->buttonText(which);
0
2390-
2391 return
never executed: return QString();
QString();
never executed: return QString();
0
2392}-
2393int QWizardPage::nextId() const-
2394{-
2395 const QWizardPagePrivate * const d = d_func();-
2396-
2397 if (!d->wizard
!d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2398 return
never executed: return -1;
-1;
never executed: return -1;
0
2399-
2400 bool foundCurrentPage = false;-
2401-
2402 const QWizardPrivate::PageMap &pageMap = d->wizard->d_func()->pageMap;-
2403 QWizardPrivate::PageMap::const_iterator i = pageMap.constBegin();-
2404 QWizardPrivate::PageMap::const_iterator end = pageMap.constEnd();-
2405-
2406 for (; i != end
i != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2407 if (i.value() == this
i.value() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2408 foundCurrentPage = true;-
2409 }
never executed: end of block
else if (foundCurrentPage
foundCurrentPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2410 return
never executed: return i.key();
i.key();
never executed: return i.key();
0
2411 }-
2412 }
never executed: end of block
0
2413 return
never executed: return -1;
-1;
never executed: return -1;
0
2414}-
2415void QWizardPage::setField(const QString &name, const QVariant &value)-
2416{-
2417 QWizardPagePrivate * const d = d_func();-
2418 if (!d->wizard
!d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2419 return;
never executed: return;
0
2420 d->wizard->setField(name, value);-
2421}
never executed: end of block
0
2422QVariant QWizardPage::field(const QString &name) const-
2423{-
2424 const QWizardPagePrivate * const d = d_func();-
2425 if (!d->wizard
!d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2426 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
2427 return
never executed: return d->wizard->field(name);
d->wizard->field(name);
never executed: return d->wizard->field(name);
0
2428}-
2429void QWizardPage::registerField(const QString &name, QWidget *widget, const char *property,-
2430 const char *changedSignal)-
2431{-
2432 QWizardPagePrivate * const d = d_func();-
2433 QWizardField field(this, name, widget, property, changedSignal);-
2434 if (d->wizard
d->wizardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2435 d->wizard->d_func()->addField(field);-
2436 }
never executed: end of block
else {
0
2437 d->pendingFields += field;-
2438 }
never executed: end of block
0
2439}-
2440-
2441-
2442-
2443-
2444-
2445-
2446-
2447QWizard *QWizardPage::wizard() const-
2448{-
2449 const QWizardPagePrivate * const d = d_func();-
2450 return
never executed: return d->wizard;
d->wizard;
never executed: return d->wizard;
0
2451}-
2452-
2453-
2454-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9