kernel/qwindow.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -
11 -
12QWindow::QWindow(QScreen *targetScreen) -
13 : QObject(*new QWindowPrivate(), 0) -
14 , QSurface(QSurface::Window) -
15{ -
16 QWindowPrivate * const d = d_func(); -
17 d->screen = targetScreen; -
18 if (!d->screen)
partially evaluated: !d->screen
TRUEFALSE
yes
Evaluation Count:56
no
Evaluation Count:0
0-56
19 d->screen = QGuiApplication::primaryScreen();
executed: d->screen = QGuiApplication::primaryScreen();
Execution Count:56
56
20 -
21 -
22 -
23 qt_noop(); -
24 -
25 connect(d->screen, "2""destroyed(QObject*)", this, "1""screenDestroyed(QObject*)"); -
26 QGuiApplicationPrivate::window_list.prepend(this); -
27}
executed: }
Execution Count:56
56
28QWindow::QWindow(QWindow *parent) -
29 : QObject(*new QWindowPrivate(), parent) -
30 , QSurface(QSurface::Window) -
31{ -
32 QWindowPrivate * const d = d_func(); -
33 d->parentWindow = parent; -
34 if (parent)
evaluated: parent
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:3
3-5
35 d->screen = parent->screen();
executed: d->screen = parent->screen();
Execution Count:5
5
36 if (!d->screen)
evaluated: !d->screen
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
3-5
37 d->screen = QGuiApplication::primaryScreen();
executed: d->screen = QGuiApplication::primaryScreen();
Execution Count:3
3
38 connect(d->screen, "2""destroyed(QObject*)", this, "1""screenDestroyed(QObject*)"); -
39 QGuiApplicationPrivate::window_list.prepend(this); -
40}
executed: }
Execution Count:8
8
41QWindow::QWindow(QWindowPrivate &dd, QWindow *parent) -
42 : QObject(dd, parent) -
43 , QSurface(QSurface::Window) -
44{ -
45 QWindowPrivate * const d = d_func(); -
46 d->parentWindow = parent; -
47 if (parent)
partially evaluated: parent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3470
0-3470
48 d->screen = parent->screen();
never executed: d->screen = parent->screen();
0
49 if (!d->screen)
partially evaluated: !d->screen
TRUEFALSE
yes
Evaluation Count:3470
no
Evaluation Count:0
0-3470
50 d->screen = QGuiApplication::primaryScreen();
executed: d->screen = QGuiApplication::primaryScreen();
Execution Count:3470
3470
51 connect(d->screen, "2""destroyed(QObject*)", this, "1""screenDestroyed(QObject*)"); -
52 QGuiApplicationPrivate::window_list.prepend(this); -
53}
executed: }
Execution Count:3470
3470
54 -
55 -
56 -
57 -
58QWindow::~QWindow() -
59{ -
60 if (QGuiApplicationPrivate::focus_window == this)
evaluated: QGuiApplicationPrivate::focus_window == this
TRUEFALSE
yes
Evaluation Count:1325
yes
Evaluation Count:2201
1325-2201
61 QGuiApplicationPrivate::focus_window = 0;
executed: QGuiApplicationPrivate::focus_window = 0;
Execution Count:1325
1325
62 if (QGuiApplicationPrivate::currentMouseWindow == this)
evaluated: QGuiApplicationPrivate::currentMouseWindow == this
TRUEFALSE
yes
Evaluation Count:942
yes
Evaluation Count:2584
942-2584
63 QGuiApplicationPrivate::currentMouseWindow = 0;
executed: QGuiApplicationPrivate::currentMouseWindow = 0;
Execution Count:942
942
64 QGuiApplicationPrivate::window_list.removeAll(this); -
65 destroy(); -
66}
executed: }
Execution Count:3526
3526
67void QWindow::setSurfaceType(SurfaceType surfaceType) -
68{ -
69 QWindowPrivate * const d = d_func(); -
70 d->surfaceType = surfaceType; -
71}
never executed: }
0
72 -
73 -
74 -
75 -
76 -
77 -
78QWindow::SurfaceType QWindow::surfaceType() const -
79{ -
80 const QWindowPrivate * const d = d_func(); -
81 return d->surfaceType;
executed: return d->surfaceType;
Execution Count:2579
2579
82} -
83void QWindow::setVisible(bool visible) -
84{ -
85 QWindowPrivate * const d = d_func(); -
86 -
87 if (d->visible == visible)
evaluated: d->visible == visible
TRUEFALSE
yes
Evaluation Count:6944
yes
Evaluation Count:5230
5230-6944
88 return;
executed: return;
Execution Count:6944
6944
89 d->visible = visible; -
90 visibleChanged(visible); -
91 -
92 if (!d->platformWindow)
evaluated: !d->platformWindow
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:5177
53-5177
93 create();
executed: create();
Execution Count:53
53
94 -
95 if (visible) {
evaluated: visible
TRUEFALSE
yes
Evaluation Count:2615
yes
Evaluation Count:2615
2615
96 -
97 QCoreApplication::removePostedEvents((static_cast<QGuiApplication *>(QCoreApplication::instance())), QEvent::Quit); -
98 -
99 QShowEvent showEvent; -
100 QGuiApplication::sendEvent(this, &showEvent); -
101 }
executed: }
Execution Count:2615
2615
102 -
103 if (isModal()) {
evaluated: isModal()
TRUEFALSE
yes
Evaluation Count:218
yes
Evaluation Count:5012
218-5012
104 if (visible)
evaluated: visible
TRUEFALSE
yes
Evaluation Count:109
yes
Evaluation Count:109
109
105 QGuiApplicationPrivate::showModalWindow(this);
executed: QGuiApplicationPrivate::showModalWindow(this);
Execution Count:109
109
106 else -
107 QGuiApplicationPrivate::hideModalWindow(this);
executed: QGuiApplicationPrivate::hideModalWindow(this);
Execution Count:109
109
108 } -
109 -
110 -
111 if (visible)
evaluated: visible
TRUEFALSE
yes
Evaluation Count:2615
yes
Evaluation Count:2615
2615
112 d->applyCursor();
executed: d->applyCursor();
Execution Count:2615
2615
113 -
114 d->platformWindow->setVisible(visible); -
115 -
116 if (!visible) {
evaluated: !visible
TRUEFALSE
yes
Evaluation Count:2615
yes
Evaluation Count:2615
2615
117 QHideEvent hideEvent; -
118 QGuiApplication::sendEvent(this, &hideEvent); -
119 }
executed: }
Execution Count:2615
2615
120}
executed: }
Execution Count:5230
5230
121 -
122bool QWindow::isVisible() const -
123{ -
124 const QWindowPrivate * const d = d_func(); -
125 -
126 return d->visible;
executed: return d->visible;
Execution Count:68
68
127} -
128void QWindow::create() -
129{ -
130 QWindowPrivate * const d = d_func(); -
131 if (!d->platformWindow) {
evaluated: !d->platformWindow
TRUEFALSE
yes
Evaluation Count:2711
yes
Evaluation Count:17
17-2711
132 d->platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(this); -
133 QObjectList childObjects = children(); -
134 for (int i = 0; i < childObjects.size(); i ++) {
evaluated: i < childObjects.size()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2711
1-2711
135 QObject *object = childObjects.at(i); -
136 if(object->isWindowType()) {
partially evaluated: object->isWindowType()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
137 QWindow *window = static_cast<QWindow *>(object); -
138 if (window->d_func()->platformWindow)
partially evaluated: window->d_func()->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
139 window->d_func()->platformWindow->setParent(d->platformWindow);
never executed: window->d_func()->platformWindow->setParent(d->platformWindow);
0
140 }
executed: }
Execution Count:1
1
141 }
executed: }
Execution Count:1
1
142 }
executed: }
Execution Count:2711
2711
143}
executed: }
Execution Count:2728
2728
144WId QWindow::winId() const -
145{ -
146 const QWindowPrivate * const d = d_func(); -
147 if(!d->platformWindow)
partially evaluated: !d->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2813
0-2813
148 const_cast<QWindow *>(this)->create();
never executed: const_cast<QWindow *>(this)->create();
0
149 -
150 WId id = d->platformWindow->winId(); -
151 -
152 qt_noop(); -
153 return id;
executed: return id;
Execution Count:2813
2813
154} -
155 -
156 -
157 -
158 -
159 -
160 -
161QWindow *QWindow::parent() const -
162{ -
163 const QWindowPrivate * const d = d_func(); -
164 return d->parentWindow;
executed: return d->parentWindow;
Execution Count:37623
37623
165} -
166void QWindow::setParent(QWindow *parent) -
167{ -
168 QWindowPrivate * const d = d_func(); -
169 -
170 QObject::setParent(parent); -
171 -
172 if (d->platformWindow) {
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:192
36-192
173 if (parent && parent->d_func()->platformWindow) {
evaluated: parent
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:11
partially evaluated: parent->d_func()->platformWindow
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
0-25
174 d->platformWindow->setParent(parent->d_func()->platformWindow); -
175 } else {
executed: }
Execution Count:25
25
176 d->platformWindow->setParent(0); -
177 }
executed: }
Execution Count:11
11
178 } -
179 -
180 d->parentWindow = parent; -
181 -
182 QGuiApplicationPrivate::updateBlockedStatus(this); -
183}
executed: }
Execution Count:228
228
184 -
185 -
186 -
187 -
188bool QWindow::isTopLevel() const -
189{ -
190 const QWindowPrivate * const d = d_func(); -
191 return d->parentWindow == 0;
executed: return d->parentWindow == 0;
Execution Count:2901
2901
192} -
193bool QWindow::isModal() const -
194{ -
195 const QWindowPrivate * const d = d_func(); -
196 return d->modality != Qt::NonModal;
executed: return d->modality != Qt::NonModal;
Execution Count:5230
5230
197} -
198Qt::WindowModality QWindow::modality() const -
199{ -
200 const QWindowPrivate * const d = d_func(); -
201 return d->modality;
executed: return d->modality;
Execution Count:5605
5605
202} -
203 -
204void QWindow::setModality(Qt::WindowModality modality) -
205{ -
206 QWindowPrivate * const d = d_func(); -
207 if (d->modality == modality)
evaluated: d->modality == modality
TRUEFALSE
yes
Evaluation Count:2588
yes
Evaluation Count:144
144-2588
208 return;
executed: return;
Execution Count:2588
2588
209 d->modality = modality; -
210 modalityChanged(modality); -
211}
executed: }
Execution Count:144
144
212void QWindow::setFormat(const QSurfaceFormat &format) -
213{ -
214 QWindowPrivate * const d = d_func(); -
215 d->requestedFormat = format; -
216}
executed: }
Execution Count:14
14
217QSurfaceFormat QWindow::requestedFormat() const -
218{ -
219 const QWindowPrivate * const d = d_func(); -
220 return d->requestedFormat;
executed: return d->requestedFormat;
Execution Count:2579
2579
221} -
222QSurfaceFormat QWindow::format() const -
223{ -
224 const QWindowPrivate * const d = d_func(); -
225 if (d->platformWindow)
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:1
1-9
226 return d->platformWindow->format();
executed: return d->platformWindow->format();
Execution Count:9
9
227 return d->requestedFormat;
executed: return d->requestedFormat;
Execution Count:1
1
228} -
229void QWindow::setFlags(Qt::WindowFlags flags) -
230{ -
231 QWindowPrivate * const d = d_func(); -
232 if (d->platformWindow)
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:2701
34-2701
233 d->platformWindow->setWindowFlags(flags);
executed: d->platformWindow->setWindowFlags(flags);
Execution Count:34
34
234 d->windowFlags = flags; -
235}
executed: }
Execution Count:2735
2735
236 -
237Qt::WindowFlags QWindow::flags() const -
238{ -
239 const QWindowPrivate * const d = d_func(); -
240 return d->windowFlags;
executed: return d->windowFlags;
Execution Count:25935
25935
241} -
242Qt::WindowType QWindow::type() const -
243{ -
244 const QWindowPrivate * const d = d_func(); -
245 return static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
executed: return static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
Execution Count:23394
23394
246} -
247void QWindow::setTitle(const QString &title) -
248{ -
249 QWindowPrivate * const d = d_func(); -
250 d->windowTitle = title; -
251 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:3002
no
Evaluation Count:0
0-3002
252 d->platformWindow->setWindowTitle(title);
executed: d->platformWindow->setWindowTitle(title);
Execution Count:3002
3002
253}
executed: }
Execution Count:3002
3002
254 -
255QString QWindow::title() const -
256{ -
257 const QWindowPrivate * const d = d_func(); -
258 return d->windowTitle;
executed: return d->windowTitle;
Execution Count:2579
2579
259} -
260void QWindow::setFilePath(const QString &filePath) -
261{ -
262 QWindowPrivate * const d = d_func(); -
263 d->windowFilePath = filePath; -
264 if (d->platformWindow)
never evaluated: d->platformWindow
0
265 d->platformWindow->setWindowFilePath(filePath);
never executed: d->platformWindow->setWindowFilePath(filePath);
0
266}
never executed: }
0
267 -
268 -
269 -
270 -
271 -
272 -
273QString QWindow::filePath() const -
274{ -
275 const QWindowPrivate * const d = d_func(); -
276 return d->windowFilePath;
never executed: return d->windowFilePath;
0
277} -
278 -
279 -
280 -
281 -
282 -
283 -
284 -
285void QWindow::setIcon(const QIcon &icon) -
286{ -
287 QWindowPrivate * const d = d_func(); -
288 d->windowIcon = icon; -
289 if (d->platformWindow)
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:2507
yes
Evaluation Count:106
106-2507
290 d->platformWindow->setWindowIcon(icon);
executed: d->platformWindow->setWindowIcon(icon);
Execution Count:2507
2507
291}
executed: }
Execution Count:2613
2613
292 -
293 -
294 -
295 -
296 -
297 -
298QIcon QWindow::icon() const -
299{ -
300 const QWindowPrivate * const d = d_func(); -
301 return d->windowIcon;
never executed: return d->windowIcon;
0
302} -
303 -
304 -
305 -
306 -
307 -
308 -
309void QWindow::raise() -
310{ -
311 QWindowPrivate * const d = d_func(); -
312 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:128
no
Evaluation Count:0
0-128
313 d->platformWindow->raise();
executed: d->platformWindow->raise();
Execution Count:128
128
314}
executed: }
Execution Count:128
128
315 -
316 -
317 -
318 -
319 -
320 -
321void QWindow::lower() -
322{ -
323 QWindowPrivate * const d = d_func(); -
324 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
325 d->platformWindow->lower();
executed: d->platformWindow->lower();
Execution Count:1
1
326}
executed: }
Execution Count:1
1
327void QWindow::setOpacity(qreal level) -
328{ -
329 QWindowPrivate * const d = d_func(); -
330 if (level == d->opacity)
evaluated: level == d->opacity
TRUEFALSE
yes
Evaluation Count:348
yes
Evaluation Count:7
7-348
331 return;
executed: return;
Execution Count:348
348
332 d->opacity = level; -
333 if (d->platformWindow)
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:5
2-5
334 d->platformWindow->setOpacity(level);
executed: d->platformWindow->setOpacity(level);
Execution Count:2
2
335}
executed: }
Execution Count:7
7
336 -
337 -
338 -
339 -
340 -
341 -
342void QWindow::requestActivate() -
343{ -
344 QWindowPrivate * const d = d_func(); -
345 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:386
no
Evaluation Count:0
0-386
346 d->platformWindow->requestActivateWindow();
executed: d->platformWindow->requestActivateWindow();
Execution Count:386
386
347}
executed: }
Execution Count:386
386
348bool QWindow::isExposed() const -
349{ -
350 const QWindowPrivate * const d = d_func(); -
351 return d->exposed;
executed: return d->exposed;
Execution Count:7345
7345
352} -
353bool QWindow::isActive() const -
354{ -
355 const QWindowPrivate * const d = d_func(); -
356 if (!d->platformWindow)
partially evaluated: !d->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:862
0-862
357 return false;
never executed: return false;
0
358 -
359 QWindow *focus = QGuiApplication::focusWindow(); -
360 -
361 -
362 if (!focus)
evaluated: !focus
TRUEFALSE
yes
Evaluation Count:272
yes
Evaluation Count:590
272-590
363 return false;
executed: return false;
Execution Count:272
272
364 -
365 if (focus == this)
evaluated: focus == this
TRUEFALSE
yes
Evaluation Count:552
yes
Evaluation Count:38
38-552
366 return true;
executed: return true;
Execution Count:552
552
367 -
368 if (!parent() && !transientParent()) {
evaluated: !parent()
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:2
evaluated: !transientParent()
TRUEFALSE
yes
Evaluation Count:33
yes
Evaluation Count:3
2-36
369 return isAncestorOf(focus);
executed: return isAncestorOf(focus);
Execution Count:33
33
370 } else { -
371 return (parent() && parent()->isActive()) || (transientParent() && transientParent()->isActive());
executed: return (parent() && parent()->isActive()) || (transientParent() && transientParent()->isActive());
Execution Count:5
5
372 } -
373} -
374void QWindow::reportContentOrientationChange(Qt::ScreenOrientation orientation) -
375{ -
376 QWindowPrivate * const d = d_func(); -
377 if (d->contentOrientation == orientation)
partially evaluated: d->contentOrientation == orientation
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
378 return;
never executed: return;
0
379 if (!d->platformWindow)
partially evaluated: !d->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
380 create();
never executed: create();
0
381 qt_noop(); -
382 d->contentOrientation = orientation; -
383 d->platformWindow->handleContentOrientationChange(orientation); -
384 contentOrientationChanged(orientation); -
385}
executed: }
Execution Count:3
3
386 -
387Qt::ScreenOrientation QWindow::contentOrientation() const -
388{ -
389 const QWindowPrivate * const d = d_func(); -
390 return d->contentOrientation;
executed: return d->contentOrientation;
Execution Count:2
2
391} -
392qreal QWindow::devicePixelRatio() const -
393{ -
394 const QWindowPrivate * const d = d_func(); -
395 if (!d->platformWindow)
never evaluated: !d->platformWindow
0
396 return 1.0;
never executed: return 1.0;
0
397 return d->platformWindow->devicePixelRatio();
never executed: return d->platformWindow->devicePixelRatio();
0
398} -
399void QWindow::setWindowState(Qt::WindowState state) -
400{ -
401 if (state == Qt::WindowActive) {
partially evaluated: state == Qt::WindowActive
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:155
0-155
402 QMessageLogger("kernel/qwindow.cpp", 791, __PRETTY_FUNCTION__).warning() << "QWindow::setWindowState does not accept Qt::WindowActive"; -
403 return;
never executed: return;
0
404 } -
405 -
406 QWindowPrivate * const d = d_func(); -
407 if (d->platformWindow)
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:53
53-102
408 d->platformWindow->setWindowState(state);
executed: d->platformWindow->setWindowState(state);
Execution Count:102
102
409 d->windowState = state; -
410 windowStateChanged(d->windowState); -
411}
executed: }
Execution Count:155
155
412 -
413 -
414 -
415 -
416 -
417 -
418Qt::WindowState QWindow::windowState() const -
419{ -
420 const QWindowPrivate * const d = d_func(); -
421 return d->windowState;
executed: return d->windowState;
Execution Count:13288
13288
422} -
423void QWindow::setTransientParent(QWindow *parent) -
424{ -
425 QWindowPrivate * const d = d_func(); -
426 d->transientParent = parent; -
427 -
428 QGuiApplicationPrivate::updateBlockedStatus(this); -
429}
executed: }
Execution Count:205
205
430 -
431 -
432 -
433 -
434 -
435 -
436QWindow *QWindow::transientParent() const -
437{ -
438 const QWindowPrivate * const d = d_func(); -
439 return d->transientParent.data();
executed: return d->transientParent.data();
Execution Count:882
882
440} -
441bool QWindow::isAncestorOf(const QWindow *child, AncestorMode mode) const -
442{ -
443 if (child->parent() == this || (mode == IncludeTransients && child->transientParent() == this))
evaluated: child->parent() == this
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:32
partially evaluated: mode == IncludeTransients
TRUEFALSE
yes
Evaluation Count:32
no
Evaluation Count:0
evaluated: child->transientParent() == this
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:30
0-32
444 return true;
executed: return true;
Execution Count:3
3
445 -
446 return (child->parent() && isAncestorOf(child->parent(), mode)) 30
447 || (mode == IncludeTransients && child->transientParent() && isAncestorOf(child->transientParent(), mode));
executed: return (child->parent() && isAncestorOf(child->parent(), mode)) || (mode == IncludeTransients && child->transientParent() && isAncestorOf(child->transientParent(), mode));
Execution Count:30
30
448} -
449 -
450 -
451 -
452 -
453 -
454 -
455QSize QWindow::minimumSize() const -
456{ -
457 const QWindowPrivate * const d = d_func(); -
458 return d->minimumSize;
executed: return d->minimumSize;
Execution Count:10851
10851
459} -
460 -
461 -
462 -
463 -
464 -
465 -
466QSize QWindow::maximumSize() const -
467{ -
468 const QWindowPrivate * const d = d_func(); -
469 return d->maximumSize;
executed: return d->maximumSize;
Execution Count:10852
10852
470} -
471 -
472 -
473 -
474 -
475 -
476 -
477QSize QWindow::baseSize() const -
478{ -
479 const QWindowPrivate * const d = d_func(); -
480 return d->baseSize;
executed: return d->baseSize;
Execution Count:8250
8250
481} -
482 -
483 -
484 -
485 -
486 -
487 -
488QSize QWindow::sizeIncrement() const -
489{ -
490 const QWindowPrivate * const d = d_func(); -
491 return d->sizeIncrement;
executed: return d->sizeIncrement;
Execution Count:8250
8250
492} -
493void QWindow::setMinimumSize(const QSize &size) -
494{ -
495 QWindowPrivate * const d = d_func(); -
496 QSize adjustedSize = QSize(qBound(0, size.width(), ((1<<24)-1)), qBound(0, size.height(), ((1<<24)-1))); -
497 if (d->minimumSize == adjustedSize)
partially evaluated: d->minimumSize == adjustedSize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:201
0-201
498 return;
never executed: return;
0
499 QSize oldSize = d->minimumSize; -
500 d->minimumSize = adjustedSize; -
501 if (d->platformWindow && isTopLevel())
partially evaluated: d->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:201
never evaluated: isTopLevel()
0-201
502 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
503 if (d->minimumSize.width() != oldSize.width())
evaluated: d->minimumSize.width() != oldSize.width()
TRUEFALSE
yes
Evaluation Count:199
yes
Evaluation Count:2
2-199
504 minimumWidthChanged(d->minimumSize.width());
executed: minimumWidthChanged(d->minimumSize.width());
Execution Count:199
199
505 if (d->minimumSize.height() != oldSize.height())
evaluated: d->minimumSize.height() != oldSize.height()
TRUEFALSE
yes
Evaluation Count:197
yes
Evaluation Count:4
4-197
506 minimumHeightChanged(d->minimumSize.height());
executed: minimumHeightChanged(d->minimumSize.height());
Execution Count:197
197
507}
executed: }
Execution Count:201
201
508 -
509 -
510 -
511 -
512 -
513void QWindow::setX(int arg) -
514{ -
515 if (x() != arg)
never evaluated: x() != arg
0
516 setGeometry(QRect(arg, y(), width(), height()));
never executed: setGeometry(QRect(arg, y(), width(), height()));
0
517}
never executed: }
0
518 -
519 -
520 -
521 -
522 -
523void QWindow::setY(int arg) -
524{ -
525 if (y() != arg)
never evaluated: y() != arg
0
526 setGeometry(QRect(x(), arg, width(), height()));
never executed: setGeometry(QRect(x(), arg, width(), height()));
0
527}
never executed: }
0
528 -
529 -
530 -
531 -
532 -
533void QWindow::setWidth(int arg) -
534{ -
535 if (width() != arg)
never evaluated: width() != arg
0
536 setGeometry(QRect(x(), y(), arg, height()));
never executed: setGeometry(QRect(x(), y(), arg, height()));
0
537}
never executed: }
0
538 -
539 -
540 -
541 -
542 -
543void QWindow::setHeight(int arg) -
544{ -
545 if (height() != arg)
never evaluated: height() != arg
0
546 setGeometry(QRect(x(), y(), width(), arg));
never executed: setGeometry(QRect(x(), y(), width(), arg));
0
547}
never executed: }
0
548 -
549 -
550 -
551 -
552 -
553void QWindow::setMinimumWidth(int w) -
554{ -
555 setMinimumSize(QSize(w, minimumHeight())); -
556}
executed: }
Execution Count:1
1
557 -
558 -
559 -
560 -
561 -
562void QWindow::setMinimumHeight(int h) -
563{ -
564 setMinimumSize(QSize(minimumWidth(), h)); -
565}
executed: }
Execution Count:1
1
566void QWindow::setMaximumSize(const QSize &size) -
567{ -
568 QWindowPrivate * const d = d_func(); -
569 QSize adjustedSize = QSize(qBound(0, size.width(), ((1<<24)-1)), qBound(0, size.height(), ((1<<24)-1))); -
570 if (d->maximumSize == adjustedSize)
partially evaluated: d->maximumSize == adjustedSize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:193
0-193
571 return;
never executed: return;
0
572 QSize oldSize = d->maximumSize; -
573 d->maximumSize = adjustedSize; -
574 if (d->platformWindow && isTopLevel())
partially evaluated: d->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:193
never evaluated: isTopLevel()
0-193
575 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
576 if (d->maximumSize.width() != oldSize.width())
evaluated: d->maximumSize.width() != oldSize.width()
TRUEFALSE
yes
Evaluation Count:191
yes
Evaluation Count:2
2-191
577 maximumWidthChanged(d->maximumSize.width());
executed: maximumWidthChanged(d->maximumSize.width());
Execution Count:191
191
578 if (d->maximumSize.height() != oldSize.height())
evaluated: d->maximumSize.height() != oldSize.height()
TRUEFALSE
yes
Evaluation Count:191
yes
Evaluation Count:2
2-191
579 maximumHeightChanged(d->maximumSize.height());
executed: maximumHeightChanged(d->maximumSize.height());
Execution Count:191
191
580}
executed: }
Execution Count:193
193
581 -
582 -
583 -
584 -
585 -
586void QWindow::setMaximumWidth(int w) -
587{ -
588 setMaximumSize(QSize(w, maximumHeight())); -
589}
executed: }
Execution Count:1
1
590 -
591 -
592 -
593 -
594 -
595void QWindow::setMaximumHeight(int h) -
596{ -
597 setMaximumSize(QSize(maximumWidth(), h)); -
598}
executed: }
Execution Count:1
1
599void QWindow::setBaseSize(const QSize &size) -
600{ -
601 QWindowPrivate * const d = d_func(); -
602 if (d->baseSize == size)
never evaluated: d->baseSize == size
0
603 return;
never executed: return;
0
604 d->baseSize = size; -
605 if (d->platformWindow && isTopLevel())
never evaluated: d->platformWindow
never evaluated: isTopLevel()
0
606 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
607}
never executed: }
0
608void QWindow::setSizeIncrement(const QSize &size) -
609{ -
610 QWindowPrivate * const d = d_func(); -
611 if (d->sizeIncrement == size)
never evaluated: d->sizeIncrement == size
0
612 return;
never executed: return;
0
613 d->sizeIncrement = size; -
614 if (d->platformWindow && isTopLevel())
never evaluated: d->platformWindow
never evaluated: isTopLevel()
0
615 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
616}
never executed: }
0
617 -
618 -
619 -
620 -
621 -
622 -
623 -
624void QWindow::setGeometry(int posx, int posy, int w, int h) -
625{ -
626 setGeometry(QRect(posx, posy, w, h)); -
627}
executed: }
Execution Count:22
22
628 -
629 -
630 -
631 -
632 -
633 -
634void QWindow::setGeometry(const QRect &rect) -
635{ -
636 QWindowPrivate * const d = d_func(); -
637 if (rect == geometry())
evaluated: rect == geometry()
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:5162
20-5162
638 return;
executed: return;
Execution Count:20
20
639 QRect oldRect = geometry(); -
640 -
641 d->positionPolicy = QWindowPrivate::WindowFrameExclusive; -
642 if (d->platformWindow) {
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:2479
yes
Evaluation Count:2683
2479-2683
643 d->platformWindow->setGeometry(rect); -
644 } else {
executed: }
Execution Count:2479
2479
645 d->geometry = rect; -
646 -
647 if (rect.x() != oldRect.x())
evaluated: rect.x() != oldRect.x()
TRUEFALSE
yes
Evaluation Count:345
yes
Evaluation Count:2338
345-2338
648 xChanged(rect.x());
executed: xChanged(rect.x());
Execution Count:345
345
649 if (rect.y() != oldRect.y())
evaluated: rect.y() != oldRect.y()
TRUEFALSE
yes
Evaluation Count:349
yes
Evaluation Count:2334
349-2334
650 yChanged(rect.y());
executed: yChanged(rect.y());
Execution Count:349
349
651 if (rect.width() != oldRect.width())
evaluated: rect.width() != oldRect.width()
TRUEFALSE
yes
Evaluation Count:2682
yes
Evaluation Count:1
1-2682
652 widthChanged(rect.width());
executed: widthChanged(rect.width());
Execution Count:2682
2682
653 if (rect.height() != oldRect.height())
evaluated: rect.height() != oldRect.height()
TRUEFALSE
yes
Evaluation Count:2682
yes
Evaluation Count:1
1-2682
654 heightChanged(rect.height());
executed: heightChanged(rect.height());
Execution Count:2682
2682
655 }
executed: }
Execution Count:2683
2683
656} -
657 -
658 -
659 -
660 -
661 -
662 -
663QRect QWindow::geometry() const -
664{ -
665 const QWindowPrivate * const d = d_func(); -
666 if (d->platformWindow)
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:56711
yes
Evaluation Count:10672
10672-56711
667 return d->platformWindow->geometry();
executed: return d->platformWindow->geometry();
Execution Count:56711
56711
668 return d->geometry;
executed: return d->geometry;
Execution Count:10672
10672
669} -
670 -
671 -
672 -
673 -
674 -
675 -
676QMargins QWindow::frameMargins() const -
677{ -
678 const QWindowPrivate * const d = d_func(); -
679 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:3029
no
Evaluation Count:0
0-3029
680 return d->platformWindow->frameMargins();
executed: return d->platformWindow->frameMargins();
Execution Count:3029
3029
681 return QMargins();
never executed: return QMargins();
0
682} -
683 -
684 -
685 -
686 -
687 -
688 -
689QRect QWindow::frameGeometry() const -
690{ -
691 const QWindowPrivate * const d = d_func(); -
692 if (d->platformWindow) {
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
693 QMargins m = frameMargins(); -
694 return d->platformWindow->geometry().adjusted(-m.left(), -m.top(), m.right(), m.bottom());
executed: return d->platformWindow->geometry().adjusted(-m.left(), -m.top(), m.right(), m.bottom());
Execution Count:1
1
695 } -
696 return d->geometry;
never executed: return d->geometry;
0
697} -
698QPoint QWindow::framePosition() const -
699{ -
700 const QWindowPrivate * const d = d_func(); -
701 if (d->platformWindow) {
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:9
no
Evaluation Count:0
0-9
702 QMargins margins = frameMargins(); -
703 return d->platformWindow->geometry().topLeft() - QPoint(margins.left(), margins.top());
executed: return d->platformWindow->geometry().topLeft() - QPoint(margins.left(), margins.top());
Execution Count:9
9
704 } -
705 return d->geometry.topLeft();
never executed: return d->geometry.topLeft();
0
706} -
707 -
708 -
709 -
710 -
711 -
712 -
713void QWindow::setFramePosition(const QPoint &point) -
714{ -
715 QWindowPrivate * const d = d_func(); -
716 d->positionPolicy = QWindowPrivate::WindowFrameInclusive; -
717 if (d->platformWindow) {
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
718 d->platformWindow->setGeometry(QRect(point, size())); -
719 } else {
executed: }
Execution Count:1
1
720 d->geometry.moveTopLeft(point); -
721 }
executed: }
Execution Count:1
1
722} -
723 -
724 -
725 -
726 -
727 -
728 -
729void QWindow::setPosition(const QPoint &pt) -
730{ -
731 setGeometry(QRect(pt, size())); -
732}
executed: }
Execution Count:1
1
733 -
734 -
735 -
736 -
737 -
738 -
739void QWindow::setPosition(int posx, int posy) -
740{ -
741 setPosition(QPoint(posx, posy)); -
742}
never executed: }
0
743void QWindow::resize(int w, int h) -
744{ -
745 resize(QSize(w, h)); -
746}
never executed: }
0
747 -
748 -
749 -
750 -
751 -
752 -
753void QWindow::resize(const QSize &newSize) -
754{ -
755 QWindowPrivate * const d = d_func(); -
756 if (d->platformWindow) {
never evaluated: d->platformWindow
0
757 d->platformWindow->setGeometry(QRect(position(), newSize)); -
758 } else {
never executed: }
0
759 d->geometry.setSize(newSize); -
760 }
never executed: }
0
761} -
762 -
763 -
764 -
765 -
766 -
767 -
768void QWindow::destroy() -
769{ -
770 QWindowPrivate * const d = d_func(); -
771 QObjectList childrenWindows = children(); -
772 for (int i = 0; i < childrenWindows.size(); i++) {
evaluated: i < childrenWindows.size()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:7008
3-7008
773 QObject *object = childrenWindows.at(i); -
774 if (object->isWindowType()) {
partially evaluated: object->isWindowType()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
775 QWindow *w = static_cast<QWindow*>(object); -
776 QGuiApplicationPrivate::window_list.removeAll(w); -
777 w->destroy(); -
778 }
executed: }
Execution Count:3
3
779 }
executed: }
Execution Count:3
3
780 setVisible(false); -
781 delete d->platformWindow; -
782 d->resizeEventPending = true; -
783 d->receivedExpose = false; -
784 d->exposed = false; -
785 d->platformWindow = 0; -
786}
executed: }
Execution Count:7008
7008
787 -
788 -
789 -
790 -
791 -
792 -
793QPlatformWindow *QWindow::handle() const -
794{ -
795 const QWindowPrivate * const d = d_func(); -
796 return d->platformWindow;
executed: return d->platformWindow;
Execution Count:504018
504018
797} -
798 -
799 -
800 -
801 -
802 -
803 -
804QPlatformSurface *QWindow::surfaceHandle() const -
805{ -
806 const QWindowPrivate * const d = d_func(); -
807 return d->platformWindow;
never executed: return d->platformWindow;
0
808} -
809bool QWindow::setKeyboardGrabEnabled(bool grab) -
810{ -
811 QWindowPrivate * const d = d_func(); -
812 if (grab && QGuiApplicationPrivate::noGrab)
evaluated: grab
TRUEFALSE
yes
Evaluation Count:113
yes
Evaluation Count:90
partially evaluated: QGuiApplicationPrivate::noGrab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:113
0-113
813 return false;
never executed: return false;
0
814 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:203
no
Evaluation Count:0
0-203
815 return d->platformWindow->setKeyboardGrabEnabled(grab);
executed: return d->platformWindow->setKeyboardGrabEnabled(grab);
Execution Count:203
203
816 return false;
never executed: return false;
0
817} -
818bool QWindow::setMouseGrabEnabled(bool grab) -
819{ -
820 QWindowPrivate * const d = d_func(); -
821 if (grab && QGuiApplicationPrivate::noGrab)
evaluated: grab
TRUEFALSE
yes
Evaluation Count:113
yes
Evaluation Count:92
partially evaluated: QGuiApplicationPrivate::noGrab
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:113
0-113
822 return false;
never executed: return false;
0
823 if (d->platformWindow)
partially evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:205
no
Evaluation Count:0
0-205
824 return d->platformWindow->setMouseGrabEnabled(grab);
executed: return d->platformWindow->setMouseGrabEnabled(grab);
Execution Count:205
205
825 return false;
never executed: return false;
0
826} -
827QScreen *QWindow::screen() const -
828{ -
829 const QWindowPrivate * const d = d_func(); -
830 return d->screen;
executed: return d->screen;
Execution Count:185269
185269
831} -
832void QWindow::setScreen(QScreen *newScreen) -
833{ -
834 QWindowPrivate * const d = d_func(); -
835 if (!newScreen)
evaluated: !newScreen
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:2674
8-2674
836 newScreen = QGuiApplication::primaryScreen();
executed: newScreen = QGuiApplication::primaryScreen();
Execution Count:8
8
837 if (newScreen != screen()) {
evaluated: newScreen != screen()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:2674
8-2674
838 const bool wasCreated = d->platformWindow != 0; -
839 if (wasCreated)
evaluated: wasCreated
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
4
840 destroy();
executed: destroy();
Execution Count:4
4
841 if (d->screen)
partially evaluated: d->screen
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
842 disconnect(d->screen, "2""destroyed(QObject*)", this, "1""screenDestroyed(QObject*)");
executed: disconnect(d->screen, "2""destroyed(QObject*)", this, "1""screenDestroyed(QObject*)");
Execution Count:8
8
843 d->screen = newScreen; -
844 if (newScreen) {
partially evaluated: newScreen
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
845 connect(d->screen, "2""destroyed(QObject*)", this, "1""screenDestroyed(QObject*)"); -
846 if (wasCreated)
never evaluated: wasCreated
0
847 create();
never executed: create();
0
848 }
never executed: }
0
849 screenChanged(newScreen); -
850 }
executed: }
Execution Count:8
8
851}
executed: }
Execution Count:2682
2682
852 -
853void QWindow::screenDestroyed(QObject *object) -
854{ -
855 QWindowPrivate * const d = d_func(); -
856 if (object == static_cast<QObject *>(d->screen)) {
partially evaluated: object == static_cast<QObject *>(d->screen)
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
857 const bool wasVisible = isVisible(); -
858 setScreen(0); -
859 -
860 -
861 -
862 -
863 if (wasVisible && d->platformWindow)
evaluated: wasVisible
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:4
partially evaluated: d->platformWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
864 setVisible(true);
never executed: setVisible(true);
0
865 }
executed: }
Execution Count:8
8
866}
executed: }
Execution Count:8
8
867QAccessibleInterface *QWindow::accessibleRoot() const -
868{ -
869 return 0;
never executed: return 0;
0
870} -
871QObject *QWindow::focusObject() const -
872{ -
873 return const_cast<QWindow *>(this);
executed: return const_cast<QWindow *>(this);
Execution Count:113
113
874} -
875void QWindow::show() -
876{ -
877 if ((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->showIsFullScreen())
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->showIsFullScreen()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:55
0-55
878 showFullScreen();
never executed: showFullScreen();
0
879 else -
880 showNormal();
executed: showNormal();
Execution Count:55
55
881} -
882void QWindow::hide() -
883{ -
884 setVisible(false); -
885}
executed: }
Execution Count:10
10
886void QWindow::showMinimized() -
887{ -
888 setWindowState(Qt::WindowMinimized); -
889 setVisible(true); -
890}
never executed: }
0
891void QWindow::showMaximized() -
892{ -
893 setWindowState(Qt::WindowMaximized); -
894 setVisible(true); -
895}
executed: }
Execution Count:1
1
896void QWindow::showFullScreen() -
897{ -
898 setWindowState(Qt::WindowFullScreen); -
899 setVisible(true); -
900 requestActivate(); -
901}
never executed: }
0
902void QWindow::showNormal() -
903{ -
904 setWindowState(Qt::WindowNoState); -
905 setVisible(true); -
906}
executed: }
Execution Count:55
55
907bool QWindow::close() -
908{ -
909 QWindowPrivate * const d = d_func(); -
910 -
911 -
912 if (parent())
evaluated: parent()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:7
1-7
913 return false;
executed: return false;
Execution Count:1
1
914 -
915 if (QGuiApplicationPrivate::focus_window == this)
evaluated: QGuiApplicationPrivate::focus_window == this
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:6
1-6
916 QGuiApplicationPrivate::focus_window = 0;
executed: QGuiApplicationPrivate::focus_window = 0;
Execution Count:1
1
917 if (QGuiApplicationPrivate::currentMouseWindow == this)
partially evaluated: QGuiApplicationPrivate::currentMouseWindow == this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
918 QGuiApplicationPrivate::currentMouseWindow = 0;
never executed: QGuiApplicationPrivate::currentMouseWindow = 0;
0
919 -
920 QGuiApplicationPrivate::window_list.removeAll(this); -
921 destroy(); -
922 d->maybeQuitOnLastWindowClosed(); -
923 return true;
executed: return true;
Execution Count:7
7
924} -
925void QWindow::exposeEvent(QExposeEvent *ev) -
926{ -
927 ev->ignore(); -
928}
executed: }
Execution Count:92
92
929 -
930 -
931 -
932 -
933void QWindow::moveEvent(QMoveEvent *ev) -
934{ -
935 ev->ignore(); -
936}
executed: }
Execution Count:5
5
937void QWindow::resizeEvent(QResizeEvent *ev) -
938{ -
939 ev->ignore(); -
940}
executed: }
Execution Count:45
45
941void QWindow::showEvent(QShowEvent *ev) -
942{ -
943 ev->ignore(); -
944}
executed: }
Execution Count:2615
2615
945 -
946 -
947 -
948 -
949 -
950 -
951 -
952void QWindow::hideEvent(QHideEvent *ev) -
953{ -
954 ev->ignore(); -
955}
executed: }
Execution Count:2579
2579
956bool QWindow::event(QEvent *ev) -
957{ -
958 switch (ev->type()) { -
959 case QEvent::MouseMove: -
960 mouseMoveEvent(static_cast<QMouseEvent*>(ev)); -
961 break;
executed: break;
Execution Count:8
8
962 -
963 case QEvent::MouseButtonPress: -
964 mousePressEvent(static_cast<QMouseEvent*>(ev)); -
965 break;
executed: break;
Execution Count:57
57
966 -
967 case QEvent::MouseButtonRelease: -
968 mouseReleaseEvent(static_cast<QMouseEvent*>(ev)); -
969 break;
executed: break;
Execution Count:57
57
970 -
971 case QEvent::MouseButtonDblClick: -
972 mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev)); -
973 break;
executed: break;
Execution Count:19
19
974 -
975 case QEvent::TouchBegin: -
976 case QEvent::TouchUpdate: -
977 case QEvent::TouchEnd: -
978 case QEvent::TouchCancel: -
979 touchEvent(static_cast<QTouchEvent *>(ev)); -
980 break;
executed: break;
Execution Count:25
25
981 -
982 case QEvent::Move: -
983 moveEvent(static_cast<QMoveEvent*>(ev)); -
984 break;
executed: break;
Execution Count:5
5
985 -
986 case QEvent::Resize: -
987 resizeEvent(static_cast<QResizeEvent*>(ev)); -
988 break;
executed: break;
Execution Count:46
46
989 -
990 case QEvent::KeyPress: -
991 keyPressEvent(static_cast<QKeyEvent *>(ev)); -
992 break;
executed: break;
Execution Count:7
7
993 -
994 case QEvent::KeyRelease: -
995 keyReleaseEvent(static_cast<QKeyEvent *>(ev)); -
996 break;
executed: break;
Execution Count:7
7
997 -
998 case QEvent::FocusIn: { -
999 focusInEvent(static_cast<QFocusEvent *>(ev)); -
1000 -
1001 QAccessible::State state; -
1002 state.active = true; -
1003 QAccessibleStateChangeEvent event(this, state); -
1004 QAccessible::updateAccessibility(&event); -
1005 -
1006 break; }
executed: break;
Execution Count:48
48
1007 -
1008 case QEvent::FocusOut: { -
1009 focusOutEvent(static_cast<QFocusEvent *>(ev)); -
1010 -
1011 QAccessible::State state; -
1012 state.active = true; -
1013 QAccessibleStateChangeEvent event(this, state); -
1014 QAccessible::updateAccessibility(&event); -
1015 -
1016 break; }
executed: break;
Execution Count:17
17
1017 -
1018 -
1019 case QEvent::Wheel: -
1020 wheelEvent(static_cast<QWheelEvent*>(ev)); -
1021 break;
executed: break;
Execution Count:3
3
1022 -
1023 -
1024 case QEvent::Close: { -
1025 QWindowPrivate * const d = d_func(); -
1026 bool wasVisible = isVisible(); -
1027 destroy(); -
1028 if (wasVisible)
never evaluated: wasVisible
0
1029 d->maybeQuitOnLastWindowClosed();
never executed: d->maybeQuitOnLastWindowClosed();
0
1030 break; }
never executed: break;
0
1031 -
1032 case QEvent::Expose: -
1033 exposeEvent(static_cast<QExposeEvent *>(ev)); -
1034 break;
executed: break;
Execution Count:94
94
1035 -
1036 case QEvent::Show: -
1037 showEvent(static_cast<QShowEvent *>(ev)); -
1038 break;
executed: break;
Execution Count:2615
2615
1039 -
1040 case QEvent::Hide: -
1041 hideEvent(static_cast<QHideEvent *>(ev)); -
1042 break;
executed: break;
Execution Count:2579
2579
1043 -
1044 case QEvent::WindowStateChange: { -
1045 QWindowPrivate * const d = d_func(); -
1046 windowStateChanged(d->windowState); -
1047 break;
executed: break;
Execution Count:48
48
1048 } -
1049 -
1050 -
1051 case QEvent::TabletPress: -
1052 case QEvent::TabletMove: -
1053 case QEvent::TabletRelease: -
1054 tabletEvent(static_cast<QTabletEvent *>(ev)); -
1055 break;
executed: break;
Execution Count:2
2
1056 -
1057 -
1058 default: -
1059 return QObject::event(ev);
executed: return QObject::event(ev);
Execution Count:3893
3893
1060 } -
1061 return true;
executed: return true;
Execution Count:5637
5637
1062} -
1063 -
1064 -
1065 -
1066 -
1067 -
1068 -
1069void QWindow::keyPressEvent(QKeyEvent *ev) -
1070{ -
1071 ev->ignore(); -
1072}
executed: }
Execution Count:6
6
1073 -
1074 -
1075 -
1076 -
1077 -
1078 -
1079void QWindow::keyReleaseEvent(QKeyEvent *ev) -
1080{ -
1081 ev->ignore(); -
1082}
executed: }
Execution Count:6
6
1083void QWindow::focusInEvent(QFocusEvent *ev) -
1084{ -
1085 ev->ignore(); -
1086}
executed: }
Execution Count:48
48
1087void QWindow::focusOutEvent(QFocusEvent *ev) -
1088{ -
1089 ev->ignore(); -
1090}
executed: }
Execution Count:14
14
1091 -
1092 -
1093 -
1094 -
1095 -
1096 -
1097void QWindow::mousePressEvent(QMouseEvent *ev) -
1098{ -
1099 ev->ignore(); -
1100}
executed: }
Execution Count:32
32
1101 -
1102 -
1103 -
1104 -
1105 -
1106 -
1107void QWindow::mouseReleaseEvent(QMouseEvent *ev) -
1108{ -
1109 ev->ignore(); -
1110}
executed: }
Execution Count:32
32
1111 -
1112 -
1113 -
1114 -
1115 -
1116 -
1117void QWindow::mouseDoubleClickEvent(QMouseEvent *ev) -
1118{ -
1119 ev->ignore(); -
1120}
executed: }
Execution Count:12
12
1121 -
1122 -
1123 -
1124 -
1125void QWindow::mouseMoveEvent(QMouseEvent *ev) -
1126{ -
1127 ev->ignore(); -
1128}
never executed: }
0
1129 -
1130 -
1131 -
1132 -
1133 -
1134void QWindow::wheelEvent(QWheelEvent *ev) -
1135{ -
1136 ev->ignore(); -
1137}
executed: }
Execution Count:3
3
1138 -
1139 -
1140 -
1141 -
1142 -
1143void QWindow::touchEvent(QTouchEvent *ev) -
1144{ -
1145 ev->ignore(); -
1146}
never executed: }
0
1147void QWindow::tabletEvent(QTabletEvent *ev) -
1148{ -
1149 ev->ignore(); -
1150}
never executed: }
0
1151bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) -
1152{ -
1153 (void)eventType;; -
1154 (void)message;; -
1155 (void)result;; -
1156 return false;
executed: return false;
Execution Count:1385
1385
1157} -
1158QPoint QWindow::mapToGlobal(const QPoint &pos) const -
1159{ -
1160 const QWindowPrivate * const d = d_func(); -
1161 if (d->platformWindow && d->platformWindow->isEmbedded(0))
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:13824
yes
Evaluation Count:4
partially evaluated: d->platformWindow->isEmbedded(0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13824
0-13824
1162 return d->platformWindow->mapToGlobal(pos);
never executed: return d->platformWindow->mapToGlobal(pos);
0
1163 else -
1164 return pos + d_func()->globalPosition();
executed: return pos + d_func()->globalPosition();
Execution Count:13828
13828
1165} -
1166QPoint QWindow::mapFromGlobal(const QPoint &pos) const -
1167{ -
1168 const QWindowPrivate * const d = d_func(); -
1169 if (d->platformWindow && d->platformWindow->isEmbedded(0))
evaluated: d->platformWindow
TRUEFALSE
yes
Evaluation Count:14679
yes
Evaluation Count:3
partially evaluated: d->platformWindow->isEmbedded(0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:14679
0-14679
1170 return d->platformWindow->mapFromGlobal(pos);
never executed: return d->platformWindow->mapFromGlobal(pos);
0
1171 else -
1172 return pos - d_func()->globalPosition();
executed: return pos - d_func()->globalPosition();
Execution Count:14682
14682
1173} -
1174 -
1175 -
1176__attribute__((visibility("default"))) QWindowPrivate *qt_window_private(QWindow *window) -
1177{ -
1178 return window->d_func();
executed: return window->d_func();
Execution Count:20185
20185
1179} -
1180 -
1181void QWindowPrivate::maybeQuitOnLastWindowClosed() -
1182{ -
1183 QWindow * const q = q_func(); -
1184 -
1185 -
1186 bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent();
partially evaluated: QGuiApplication::quitOnLastWindowClosed()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
partially evaluated: !q->parent()
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1187 -
1188 if (quitOnClose) {
partially evaluated: quitOnClose
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1189 QWindowList list = QGuiApplication::topLevelWindows(); -
1190 bool lastWindowClosed = true; -
1191 for (int i = 0; i < list.size(); ++i) {
evaluated: i < list.size()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:5
4-5
1192 QWindow *w = list.at(i); -
1193 if (!w->isVisible() || w->transientParent())
evaluated: !w->isVisible()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
evaluated: w->transientParent()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
1-3
1194 continue;
executed: continue;
Execution Count:2
2
1195 lastWindowClosed = false; -
1196 break;
executed: break;
Execution Count:2
2
1197 } -
1198 if (lastWindowClosed) {
evaluated: lastWindowClosed
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:2
2-5
1199 QGuiApplicationPrivate::emitLastWindowClosed(); -
1200 QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance())); -
1201 applicationPrivate->maybeQuit(); -
1202 }
executed: }
Execution Count:5
5
1203 }
executed: }
Execution Count:7
7
1204 -
1205}
executed: }
Execution Count:7
7
1206void QWindow::setCursor(const QCursor &cursor) -
1207{ -
1208 QWindowPrivate * const d = d_func(); -
1209 d->cursor = cursor; -
1210 -
1211 if (d->screen->handle()->cursor()) {
partially evaluated: d->screen->handle()->cursor()
TRUEFALSE
yes
Evaluation Count:3775
no
Evaluation Count:0
0-3775
1212 d->applyCursor(); -
1213 QEvent event(QEvent::CursorChange); -
1214 QGuiApplication::sendEvent(this, &event); -
1215 }
executed: }
Execution Count:3775
3775
1216}
executed: }
Execution Count:3775
3775
1217 -
1218 -
1219 -
1220 -
1221void QWindow::unsetCursor() -
1222{ -
1223 setCursor(Qt::ArrowCursor); -
1224}
never executed: }
0
1225 -
1226 -
1227 -
1228 -
1229 -
1230 -
1231QCursor QWindow::cursor() const -
1232{ -
1233 const QWindowPrivate * const d = d_func(); -
1234 return d->cursor;
executed: return d->cursor;
Execution Count:70
70
1235} -
1236 -
1237void QWindowPrivate::applyCursor() -
1238{ -
1239 QWindow * const q = q_func(); -
1240 if (platformWindow) {
partially evaluated: platformWindow
TRUEFALSE
yes
Evaluation Count:6390
no
Evaluation Count:0
0-6390
1241 if (QPlatformCursor *platformCursor = screen->handle()->cursor()) {
partially evaluated: QPlatformCursor *platformCursor = screen->handle()->cursor()
TRUEFALSE
yes
Evaluation Count:6390
no
Evaluation Count:0
0-6390
1242 QCursor *oc = QGuiApplication::overrideCursor(); -
1243 QCursor c = oc ? *oc : cursor;
evaluated: oc
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:6388
2-6388
1244 platformCursor->changeCursor(&c, q); -
1245 }
executed: }
Execution Count:6390
6390
1246 }
executed: }
Execution Count:6390
6390
1247}
executed: }
Execution Count:6390
6390
1248 -
1249 -
1250 -
1251 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial