dialogs/qwizard.cpp

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

Generated by Squish Coco Non-Commercial