qwindow.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qwindow.cpp
Switch to Source codePreprocessed file
LineSourceCount
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->connectToScreen(targetScreen ? targetScreen : QGuiApplication::primaryScreen());-
18 d->init();-
19}
never executed: end of block
0
20QWindow::QWindow(QWindow *parent)-
21 : QObject(*new QWindowPrivate(), parent)-
22 , QSurface(QSurface::Window)-
23{-
24 QWindowPrivate * const d = d_func();-
25 d->parentWindow = parent;-
26 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
27 d->connectToScreen(QGuiApplication::primaryScreen());
never executed: d->connectToScreen(QGuiApplication::primaryScreen());
0
28 d->init();-
29}
never executed: end of block
0
30QWindow::QWindow(QWindowPrivate &dd, QWindow *parent)-
31 : QObject(dd, parent)-
32 , QSurface(QSurface::Window)-
33{-
34 QWindowPrivate * const d = d_func();-
35 d->parentWindow = parent;-
36 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
37 d->connectToScreen(QGuiApplication::primaryScreen());
never executed: d->connectToScreen(QGuiApplication::primaryScreen());
0
38 d->init();-
39}
never executed: end of block
0
40-
41-
42-
43-
44QWindow::~QWindow()-
45{-
46 destroy();-
47 QGuiApplicationPrivate::window_list.removeAll(this);-
48 if (!QGuiApplicationPrivate::is_app_closing
!QGuiApplicati...is_app_closingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
49 QGuiApplicationPrivate::instance()->modalWindowList.removeOne(this);
never executed: QGuiApplicationPrivate::instance()->modalWindowList.removeOne(this);
0
50}
never executed: end of block
0
51-
52void QWindowPrivate::init()-
53{-
54 QWindow * const q = q_func();-
55-
56-
57-
58 if (__builtin_expect(!!(!parentWindow && !topLevelScreen), false)
__builtin_expe...creen), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
59 QMessageLogger(__FILE__, 224, __PRETTY_FUNCTION__).fatal("Cannot create window: no screens available");-
60 exit(1);
never executed: exit(1);
0
61 }-
62 QGuiApplicationPrivate::window_list.prepend(q);-
63-
64 requestedFormat = QSurfaceFormat::defaultFormat();-
65}
never executed: end of block
0
66QWindow::Visibility QWindow::visibility() const-
67{-
68 const QWindowPrivate * const d = d_func();-
69 return
never executed: return d->visibility;
d->visibility;
never executed: return d->visibility;
0
70}-
71-
72void QWindow::setVisibility(Visibility v)-
73{-
74 switch (v) {-
75 case
never executed: case Hidden:
Hidden:
never executed: case Hidden:
0
76 hide();-
77 break;
never executed: break;
0
78 case
never executed: case AutomaticVisibility:
AutomaticVisibility:
never executed: case AutomaticVisibility:
0
79 show();-
80 break;
never executed: break;
0
81 case
never executed: case Windowed:
Windowed:
never executed: case Windowed:
0
82 showNormal();-
83 break;
never executed: break;
0
84 case
never executed: case Minimized:
Minimized:
never executed: case Minimized:
0
85 showMinimized();-
86 break;
never executed: break;
0
87 case
never executed: case Maximized:
Maximized:
never executed: case Maximized:
0
88 showMaximized();-
89 break;
never executed: break;
0
90 case
never executed: case FullScreen:
FullScreen:
never executed: case FullScreen:
0
91 showFullScreen();-
92 break;
never executed: break;
0
93 default
never executed: default:
:
never executed: default:
0
94 ((!(false)) ? qt_assert("false",__FILE__,309) : qt_noop());-
95 break;
never executed: break;
0
96 }-
97}-
98-
99void QWindowPrivate::updateVisibility()-
100{-
101 QWindow * const q = q_func();-
102-
103 QWindow::Visibility old = visibility;-
104-
105 if (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
106 switch (windowState) {-
107 case
never executed: case Qt::WindowMinimized:
Qt::WindowMinimized:
never executed: case Qt::WindowMinimized:
0
108 visibility = QWindow::Minimized;-
109 break;
never executed: break;
0
110 case
never executed: case Qt::WindowMaximized:
Qt::WindowMaximized:
never executed: case Qt::WindowMaximized:
0
111 visibility = QWindow::Maximized;-
112 break;
never executed: break;
0
113 case
never executed: case Qt::WindowFullScreen:
Qt::WindowFullScreen:
never executed: case Qt::WindowFullScreen:
0
114 visibility = QWindow::FullScreen;-
115 break;
never executed: break;
0
116 case
never executed: case Qt::WindowNoState:
Qt::WindowNoState:
never executed: case Qt::WindowNoState:
0
117 visibility = QWindow::Windowed;-
118 break;
never executed: break;
0
119 default
never executed: default:
:
never executed: default:
0
120 ((!(false)) ? qt_assert("false",__FILE__,335) : qt_noop());-
121 break;
never executed: break;
0
122 }-
123 } else {-
124 visibility = QWindow::Hidden;-
125 }
never executed: end of block
0
126-
127 if (visibility != old
visibility != oldDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
128 q->visibilityChanged(visibility);
never executed: q->visibilityChanged(visibility);
0
129}
never executed: end of block
0
130-
131inline bool QWindowPrivate::windowRecreationRequired(QScreen *newScreen) const-
132{-
133 const QWindow * const q = q_func();-
134 const QScreen *oldScreen = q->screen();-
135 return
never executed: return oldScreen != newScreen && (platformWindow || !oldScreen) && !(oldScreen && oldScreen->virtualSiblings().contains(newScreen));
oldScreen != newScreen && (platformWindow || !oldScreen)
never executed: return oldScreen != newScreen && (platformWindow || !oldScreen) && !(oldScreen && oldScreen->virtualSiblings().contains(newScreen));
0
136 && !(oldScreen && oldScreen->virtualSiblings().contains(newScreen));
never executed: return oldScreen != newScreen && (platformWindow || !oldScreen) && !(oldScreen && oldScreen->virtualSiblings().contains(newScreen));
0
137}-
138-
139inline void QWindowPrivate::disconnectFromScreen()-
140{-
141 if (topLevelScreen
topLevelScreenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
142 topLevelScreen = 0;
never executed: topLevelScreen = 0;
0
143}
never executed: end of block
0
144-
145void QWindowPrivate::connectToScreen(QScreen *screen)-
146{-
147 disconnectFromScreen();-
148 topLevelScreen = screen;-
149}
never executed: end of block
0
150-
151void QWindowPrivate::emitScreenChangedRecursion(QScreen *newScreen)-
152{-
153 QWindow * const q = q_func();-
154 q->screenChanged(newScreen);-
155 for (QObject *child : q->children()) {-
156 if (child->isWindowType()
child->isWindowType()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
157 static_cast<
never executed: static_cast<QWindow *>(child)->d_func()->emitScreenChangedRecursion(newScreen);
QWindow *>(child)->d_func()->emitScreenChangedRecursion(newScreen);
never executed: static_cast<QWindow *>(child)->d_func()->emitScreenChangedRecursion(newScreen);
0
158 }
never executed: end of block
0
159}
never executed: end of block
0
160-
161void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate)-
162{-
163 QWindow * const q = q_func();-
164 if (parentWindow
parentWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
165 QMessageLogger(__FILE__, 380, __PRETTY_FUNCTION__).warning() << q << '(' << newScreen << "): Attempt to set a screen on a child window.";-
166 return;
never executed: return;
0
167 }-
168 if (newScreen != topLevelScreen
newScreen != topLevelScreenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
169 const bool shouldRecreate = recreate
recreateDescription
TRUEnever evaluated
FALSEnever evaluated
&& windowRecreationRequired(newScreen)
windowRecreati...red(newScreen)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
170 const bool shouldShow = visibilityOnDestroy
visibilityOnDestroyDescription
TRUEnever evaluated
FALSEnever evaluated
&& !topLevelScreen
!topLevelScreenDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
171 if (shouldRecreate
shouldRecreateDescription
TRUEnever evaluated
FALSEnever evaluated
&& platformWindow
platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
172 q->destroy();
never executed: q->destroy();
0
173 connectToScreen(newScreen);-
174 if (shouldShow
shouldShowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
175 q->setVisible(true);
never executed: q->setVisible(true);
0
176 else if (newScreen
newScreenDescription
TRUEnever evaluated
FALSEnever evaluated
&& shouldRecreate
shouldRecreateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
177 create(true);
never executed: create(true);
0
178 emitScreenChangedRecursion(newScreen);-
179 }
never executed: end of block
0
180}
never executed: end of block
0
181-
182void QWindowPrivate::create(bool recursive)-
183{-
184 QWindow * const q = q_func();-
185 if (platformWindow
platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
186 return;
never executed: return;
0
187-
188 if (q->parent()
q->parent()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
189 q->parent()->create();
never executed: q->parent()->create();
0
190-
191 platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q);-
192 ((!(platformWindow || q->type() == Qt::ForeignWindow)) ? qt_assert("platformWindow || q->type() == Qt::ForeignWindow",__FILE__,407) : qt_noop());-
193-
194 if (!platformWindow
!platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
195 QMessageLogger(__FILE__, 410, __PRETTY_FUNCTION__).warning() << "Failed to create platform window for" << q << "with flags" << q->flags();-
196 return;
never executed: return;
0
197 }-
198-
199 QObjectList childObjects = q->children();-
200 for (int i = 0; i < childObjects.size()
i < childObjects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; i ++) {
0
201 QObject *object = childObjects.at(i);-
202 if (!object->isWindowType()
!object->isWindowType()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
203 continue;
never executed: continue;
0
204-
205 QWindow *childWindow = static_cast<QWindow *>(object);-
206 if (recursive
recursiveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
207 childWindow->d_func()->create(recursive);
never executed: childWindow->d_func()->create(recursive);
0
208-
209-
210-
211-
212 if (childWindow->isVisible()
childWindow->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
213 childWindow->setVisible(true);
never executed: childWindow->setVisible(true);
0
214-
215 if (QPlatformWindow *childPlatformWindow = childWindow->d_func()->platformWindow
QPlatformWindo...platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
216 childPlatformWindow->setParent(this->platformWindow);
never executed: childPlatformWindow->setParent(this->platformWindow);
0
217 }
never executed: end of block
0
218-
219 QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);-
220 QGuiApplication::sendEvent(q, &e);-
221}
never executed: end of block
0
222-
223void QWindowPrivate::clearFocusObject()-
224{-
225}-
226-
227-
228-
229-
230QRectF QWindowPrivate::closestAcceptableGeometry(const QRectF &rect) const-
231{-
232 (void)rect;-
233 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
234}-
235void QWindow::setSurfaceType(SurfaceType surfaceType)-
236{-
237 QWindowPrivate * const d = d_func();-
238 d->surfaceType = surfaceType;-
239}
never executed: end of block
0
240-
241-
242-
243-
244-
245-
246QWindow::SurfaceType QWindow::surfaceType() const-
247{-
248 const QWindowPrivate * const d = d_func();-
249 return
never executed: return d->surfaceType;
d->surfaceType;
never executed: return d->surfaceType;
0
250}-
251void QWindow::setVisible(bool visible)-
252{-
253 QWindowPrivate * const d = d_func();-
254-
255 if (d->visible != visible
d->visible != visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
256 d->visible = visible;-
257 visibleChanged(visible);-
258 d->updateVisibility();-
259 }
never executed: end of block
else if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
260-
261 return;
never executed: return;
0
262 }-
263-
264 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
265-
266-
267 if (parent()
parent()Description
TRUEnever evaluated
FALSEnever evaluated
&& !parent()->handle()
!parent()->handle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
268 return;
never executed: return;
0
269 else-
270 create();
never executed: create();
0
271 }-
272-
273 if (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
274-
275 QCoreApplication::removePostedEvents((static_cast<QGuiApplication *>(QCoreApplication::instance())), QEvent::Quit);-
276-
277 if (type() == Qt::Window
type() == Qt::WindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
278 QGuiApplicationPrivate *app_priv = QGuiApplicationPrivate::instance();-
279 QString &firstWindowTitle = app_priv->firstWindowTitle;-
280 if (!firstWindowTitle.isEmpty()
!firstWindowTitle.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
281 setTitle(firstWindowTitle);-
282 firstWindowTitle = QString();-
283 }
never executed: end of block
0
284 if (!app_priv->forcedWindowIcon.isNull()
!app_priv->for...wIcon.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
285 setIcon(app_priv->forcedWindowIcon);
never executed: setIcon(app_priv->forcedWindowIcon);
0
286-
287-
288 static bool geometryApplied = false;-
289 if (!geometryApplied
!geometryAppliedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
290 geometryApplied = true;-
291 QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(this);-
292 }
never executed: end of block
0
293 }
never executed: end of block
0
294-
295 QShowEvent showEvent;-
296 QGuiApplication::sendEvent(this, &showEvent);-
297 }
never executed: end of block
0
298-
299 if (isModal()
isModal()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
300 if (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
301 QGuiApplicationPrivate::showModalWindow(this);
never executed: QGuiApplicationPrivate::showModalWindow(this);
0
302 else-
303 QGuiApplicationPrivate::hideModalWindow(this);
never executed: QGuiApplicationPrivate::hideModalWindow(this);
0
304 }-
305-
306-
307 if (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
&& (d->hasCursor
d->hasCursorDescription
TRUEnever evaluated
FALSEnever evaluated
|| QGuiApplication::overrideCursor()
QGuiApplicatio...errideCursor()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
308 d->applyCursor();
never executed: d->applyCursor();
0
309-
310-
311 d->platformWindow->setVisible(visible);-
312-
313 if (!visible
!visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
314 QHideEvent hideEvent;-
315 QGuiApplication::sendEvent(this, &hideEvent);-
316 }
never executed: end of block
0
317}
never executed: end of block
0
318-
319bool QWindow::isVisible() const-
320{-
321 const QWindowPrivate * const d = d_func();-
322-
323 return
never executed: return d->visible;
d->visible;
never executed: return d->visible;
0
324}-
325void QWindow::create()-
326{-
327 QWindowPrivate * const d = d_func();-
328 d->create(false);-
329}
never executed: end of block
0
330WId QWindow::winId() const-
331{-
332 const QWindowPrivate * const d = d_func();-
333-
334 if (type() == Qt::ForeignWindow
type() == Qt::ForeignWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
335 return
never executed: return WId(property("_q_foreignWinId").value<WId>());
WId(property("_q_foreignWinId").value<WId>());
never executed: return WId(property("_q_foreignWinId").value<WId>());
0
336-
337 if(!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
338 const_cast<
never executed: const_cast<QWindow *>(this)->create();
QWindow *>(this)->create();
never executed: const_cast<QWindow *>(this)->create();
0
339-
340 return
never executed: return d->platformWindow->winId();
d->platformWindow->winId();
never executed: return d->platformWindow->winId();
0
341}-
342-
343-
344-
345-
346-
347-
348QWindow *QWindow::parent() const-
349{-
350 const QWindowPrivate * const d = d_func();-
351 return
never executed: return d->parentWindow;
d->parentWindow;
never executed: return d->parentWindow;
0
352}-
353void QWindow::setParent(QWindow *parent)-
354{-
355 QWindowPrivate * const d = d_func();-
356 if (d->parentWindow == parent
d->parentWindow == parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
357 return;
never executed: return;
0
358-
359 QScreen *newScreen = parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
? parent->screen() : screen();
0
360 if (d->windowRecreationRequired(newScreen)
d->windowRecre...red(newScreen)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
361 QMessageLogger(__FILE__, 636, __PRETTY_FUNCTION__).warning() << this << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')';-
362 return;
never executed: return;
0
363 }-
364-
365 QObject::setParent(parent);-
366 d->parentWindow = parent;-
367-
368 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
369 d->disconnectFromScreen();
never executed: d->disconnectFromScreen();
0
370 else-
371 d->connectToScreen(newScreen);
never executed: d->connectToScreen(newScreen);
0
372-
373-
374-
375-
376 if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
|| parent->handle()
parent->handle()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
377 setVisible(true);
never executed: setVisible(true);
0
378-
379 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
380 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
381 parent->create();
never executed: parent->create();
0
382-
383 d->platformWindow->setParent(parent ? parent->d_func()->platformWindow : 0);-
384 }
never executed: end of block
0
385-
386 QGuiApplicationPrivate::updateBlockedStatus(this);-
387}
never executed: end of block
0
388-
389-
390-
391-
392bool QWindow::isTopLevel() const-
393{-
394 const QWindowPrivate * const d = d_func();-
395 return
never executed: return d->parentWindow == 0;
d->parentWindow == 0;
never executed: return d->parentWindow == 0;
0
396}-
397bool QWindow::isModal() const-
398{-
399 const QWindowPrivate * const d = d_func();-
400 return
never executed: return d->modality != Qt::NonModal;
d->modality != Qt::NonModal;
never executed: return d->modality != Qt::NonModal;
0
401}-
402Qt::WindowModality QWindow::modality() const-
403{-
404 const QWindowPrivate * const d = d_func();-
405 return
never executed: return d->modality;
d->modality;
never executed: return d->modality;
0
406}-
407-
408void QWindow::setModality(Qt::WindowModality modality)-
409{-
410 QWindowPrivate * const d = d_func();-
411 if (d->modality == modality
d->modality == modalityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
412 return;
never executed: return;
0
413 d->modality = modality;-
414 modalityChanged(modality);-
415}
never executed: end of block
0
416void QWindow::setFormat(const QSurfaceFormat &format)-
417{-
418 QWindowPrivate * const d = d_func();-
419 d->requestedFormat = format;-
420}
never executed: end of block
0
421QSurfaceFormat QWindow::requestedFormat() const-
422{-
423 const QWindowPrivate * const d = d_func();-
424 return
never executed: return d->requestedFormat;
d->requestedFormat;
never executed: return d->requestedFormat;
0
425}-
426QSurfaceFormat QWindow::format() const-
427{-
428 const QWindowPrivate * const d = d_func();-
429 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
430 return
never executed: return d->platformWindow->format();
d->platformWindow->format();
never executed: return d->platformWindow->format();
0
431 return
never executed: return d->requestedFormat;
d->requestedFormat;
never executed: return d->requestedFormat;
0
432}-
433void QWindow::setFlags(Qt::WindowFlags flags)-
434{-
435 QWindowPrivate * const d = d_func();-
436 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
437 d->platformWindow->setWindowFlags(flags);
never executed: d->platformWindow->setWindowFlags(flags);
0
438 d->windowFlags = flags;-
439}
never executed: end of block
0
440-
441Qt::WindowFlags QWindow::flags() const-
442{-
443 const QWindowPrivate * const d = d_func();-
444 return
never executed: return d->windowFlags;
d->windowFlags;
never executed: return d->windowFlags;
0
445}-
446Qt::WindowType QWindow::type() const-
447{-
448 const QWindowPrivate * const d = d_func();-
449 return
never executed: return static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
never executed: return static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
0
450}-
451void QWindow::setTitle(const QString &title)-
452{-
453 QWindowPrivate * const d = d_func();-
454 bool changed = false;-
455 if (d->windowTitle != title
d->windowTitle != titleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
456 d->windowTitle = title;-
457 changed = true;-
458 }
never executed: end of block
0
459 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& type() != Qt::Desktop
type() != Qt::DesktopDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
460 d->platformWindow->setWindowTitle(title);
never executed: d->platformWindow->setWindowTitle(title);
0
461 if (changed
changedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
462 windowTitleChanged(title);
never executed: windowTitleChanged(title);
0
463}
never executed: end of block
0
464-
465QString QWindow::title() const-
466{-
467 const QWindowPrivate * const d = d_func();-
468 return
never executed: return d->windowTitle;
d->windowTitle;
never executed: return d->windowTitle;
0
469}-
470void QWindow::setFilePath(const QString &filePath)-
471{-
472 QWindowPrivate * const d = d_func();-
473 d->windowFilePath = filePath;-
474 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
475 d->platformWindow->setWindowFilePath(filePath);
never executed: d->platformWindow->setWindowFilePath(filePath);
0
476}
never executed: end of block
0
477-
478-
479-
480-
481-
482-
483QString QWindow::filePath() const-
484{-
485 const QWindowPrivate * const d = d_func();-
486 return
never executed: return d->windowFilePath;
d->windowFilePath;
never executed: return d->windowFilePath;
0
487}-
488-
489-
490-
491-
492-
493-
494-
495void QWindow::setIcon(const QIcon &icon)-
496{-
497 QWindowPrivate * const d = d_func();-
498 d->windowIcon = icon;-
499 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
500 d->platformWindow->setWindowIcon(icon);
never executed: d->platformWindow->setWindowIcon(icon);
0
501 QEvent e(QEvent::WindowIconChange);-
502 QCoreApplication::sendEvent(this, &e);-
503}
never executed: end of block
0
504-
505-
506-
507-
508-
509-
510QIcon QWindow::icon() const-
511{-
512 const QWindowPrivate * const d = d_func();-
513 if (d->windowIcon.isNull()
d->windowIcon.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
514 return
never executed: return QGuiApplication::windowIcon();
QGuiApplication::windowIcon();
never executed: return QGuiApplication::windowIcon();
0
515 return
never executed: return d->windowIcon;
d->windowIcon;
never executed: return d->windowIcon;
0
516}-
517-
518-
519-
520-
521-
522-
523void QWindow::raise()-
524{-
525 QWindowPrivate * const d = d_func();-
526 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
527 d->platformWindow->raise();
never executed: d->platformWindow->raise();
0
528}
never executed: end of block
0
529-
530-
531-
532-
533-
534-
535void QWindow::lower()-
536{-
537 QWindowPrivate * const d = d_func();-
538 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
539 d->platformWindow->lower();
never executed: d->platformWindow->lower();
0
540}
never executed: end of block
0
541void QWindow::setOpacity(qreal level)-
542{-
543 QWindowPrivate * const d = d_func();-
544 if (level == d->opacity
level == d->opacityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
545 return;
never executed: return;
0
546 d->opacity = level;-
547 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
548 d->platformWindow->setOpacity(level);-
549 opacityChanged(level);-
550 }
never executed: end of block
0
551}
never executed: end of block
0
552-
553qreal QWindow::opacity() const-
554{-
555 const QWindowPrivate * const d = d_func();-
556 return
never executed: return d->opacity;
d->opacity;
never executed: return d->opacity;
0
557}-
558void QWindow::setMask(const QRegion &region)-
559{-
560 QWindowPrivate * const d = d_func();-
561 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
562 return;
never executed: return;
0
563 d->platformWindow->setMask(QHighDpi::toNativeLocalRegion(region, this));-
564 d->mask = region;-
565}
never executed: end of block
0
566-
567-
568-
569-
570-
571-
572-
573QRegion QWindow::mask() const-
574{-
575 const QWindowPrivate * const d = d_func();-
576 return
never executed: return d->mask;
d->mask;
never executed: return d->mask;
0
577}-
578-
579-
580-
581-
582-
583-
584void QWindow::requestActivate()-
585{-
586 QWindowPrivate * const d = d_func();-
587 if (flags() & Qt::WindowDoesNotAcceptFocus
flags() & Qt::...NotAcceptFocusDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
588 QMessageLogger(__FILE__, 1013, __PRETTY_FUNCTION__).warning() << "requestActivate() called for " << this << " which has Qt::WindowDoesNotAcceptFocus set.";-
589 return;
never executed: return;
0
590 }-
591 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
592 d->platformWindow->requestActivateWindow();
never executed: d->platformWindow->requestActivateWindow();
0
593}
never executed: end of block
0
594bool QWindow::isExposed() const-
595{-
596 const QWindowPrivate * const d = d_func();-
597 return
never executed: return d->exposed;
d->exposed;
never executed: return d->exposed;
0
598}-
599bool QWindow::isActive() const-
600{-
601 const QWindowPrivate * const d = d_func();-
602 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
603 return
never executed: return false;
false;
never executed: return false;
0
604-
605 QWindow *focus = QGuiApplication::focusWindow();-
606-
607-
608 if (!focus
!focusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
609 return
never executed: return false;
false;
never executed: return false;
0
610-
611 if (focus == this
focus == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
612 return
never executed: return true;
true;
never executed: return true;
0
613-
614 if (!parent()
!parent()Description
TRUEnever evaluated
FALSEnever evaluated
&& !transientParent()
!transientParent()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
615 return
never executed: return isAncestorOf(focus);
isAncestorOf(focus);
never executed: return isAncestorOf(focus);
0
616 } else {-
617 return
never executed: return (parent() && parent()->isActive()) || (transientParent() && transientParent()->isActive());
(parent() && parent()->isActive()) || (transientParent() && transientParent()->isActive());
never executed: return (parent() && parent()->isActive()) || (transientParent() && transientParent()->isActive());
0
618 }-
619}-
620void QWindow::reportContentOrientationChange(Qt::ScreenOrientation orientation)-
621{-
622 QWindowPrivate * const d = d_func();-
623 if (d->contentOrientation == orientation
d->contentOrie...== orientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
624 return;
never executed: return;
0
625 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
626 d->platformWindow->handleContentOrientationChange(orientation);
never executed: d->platformWindow->handleContentOrientationChange(orientation);
0
627 d->contentOrientation = orientation;-
628 contentOrientationChanged(orientation);-
629}
never executed: end of block
0
630-
631Qt::ScreenOrientation QWindow::contentOrientation() const-
632{-
633 const QWindowPrivate * const d = d_func();-
634 return
never executed: return d->contentOrientation;
d->contentOrientation;
never executed: return d->contentOrientation;
0
635}-
636qreal QWindow::devicePixelRatio() const-
637{-
638 const QWindowPrivate * const d = d_func();-
639-
640-
641-
642-
643 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
644 return
never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->devicePixelRatio();
(static_cast<QGuiApplication *>(QCoreApplication::instance()))->devicePixelRatio();
never executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->devicePixelRatio();
0
645-
646 return
never executed: return d->platformWindow->devicePixelRatio() * QHighDpiScaling::factor(this);
d->platformWindow->devicePixelRatio() * QHighDpiScaling::factor(this);
never executed: return d->platformWindow->devicePixelRatio() * QHighDpiScaling::factor(this);
0
647}-
648void QWindow::setWindowState(Qt::WindowState state)-
649{-
650 if (state == Qt::WindowActive
state == Qt::WindowActiveDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
651 QMessageLogger(__FILE__, 1150, __PRETTY_FUNCTION__).warning("QWindow::setWindowState does not accept Qt::WindowActive");-
652 return;
never executed: return;
0
653 }-
654-
655 QWindowPrivate * const d = d_func();-
656 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
657 d->platformWindow->setWindowState(state);
never executed: d->platformWindow->setWindowState(state);
0
658 d->windowState = state;-
659 windowStateChanged(d->windowState);-
660 d->updateVisibility();-
661}
never executed: end of block
0
662-
663-
664-
665-
666-
667-
668Qt::WindowState QWindow::windowState() const-
669{-
670 const QWindowPrivate * const d = d_func();-
671 return
never executed: return d->windowState;
d->windowState;
never executed: return d->windowState;
0
672}-
673void QWindow::setTransientParent(QWindow *parent)-
674{-
675 QWindowPrivate * const d = d_func();-
676 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& !parent->isTopLevel()
!parent->isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
677 QMessageLogger(__FILE__, 1197, __PRETTY_FUNCTION__).warning() << parent << "must be a top level window.";-
678 return;
never executed: return;
0
679 }-
680-
681 d->transientParent = parent;-
682-
683 QGuiApplicationPrivate::updateBlockedStatus(this);-
684}
never executed: end of block
0
685-
686-
687-
688-
689-
690-
691QWindow *QWindow::transientParent() const-
692{-
693 const QWindowPrivate * const d = d_func();-
694 return
never executed: return d->transientParent.data();
d->transientParent.data();
never executed: return d->transientParent.data();
0
695}-
696bool QWindow::isAncestorOf(const QWindow *child, AncestorMode mode) const-
697{-
698 if (child->parent() == this
child->parent() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
|| (mode == IncludeTransients
mode == IncludeTransientsDescription
TRUEnever evaluated
FALSEnever evaluated
&& child->transientParent() == this
child->transie...rent() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
699 return
never executed: return true;
true;
never executed: return true;
0
700-
701 return
never executed: return (child->parent() && isAncestorOf(child->parent(), mode)) || (mode == IncludeTransients && child->transientParent() && isAncestorOf(child->transientParent(), mode));
(child->parent() && isAncestorOf(child->parent(), mode))
never executed: return (child->parent() && isAncestorOf(child->parent(), mode)) || (mode == IncludeTransients && child->transientParent() && isAncestorOf(child->transientParent(), mode));
0
702 || (mode == IncludeTransients && child->transientParent() && isAncestorOf(child->transientParent(), mode));
never executed: return (child->parent() && isAncestorOf(child->parent(), mode)) || (mode == IncludeTransients && child->transientParent() && isAncestorOf(child->transientParent(), mode));
0
703}-
704-
705-
706-
707-
708-
709-
710QSize QWindow::minimumSize() const-
711{-
712 const QWindowPrivate * const d = d_func();-
713 return
never executed: return d->minimumSize;
d->minimumSize;
never executed: return d->minimumSize;
0
714}-
715-
716-
717-
718-
719-
720-
721QSize QWindow::maximumSize() const-
722{-
723 const QWindowPrivate * const d = d_func();-
724 return
never executed: return d->maximumSize;
d->maximumSize;
never executed: return d->maximumSize;
0
725}-
726-
727-
728-
729-
730-
731-
732QSize QWindow::baseSize() const-
733{-
734 const QWindowPrivate * const d = d_func();-
735 return
never executed: return d->baseSize;
d->baseSize;
never executed: return d->baseSize;
0
736}-
737-
738-
739-
740-
741-
742-
743QSize QWindow::sizeIncrement() const-
744{-
745 const QWindowPrivate * const d = d_func();-
746 return
never executed: return d->sizeIncrement;
d->sizeIncrement;
never executed: return d->sizeIncrement;
0
747}-
748void QWindow::setMinimumSize(const QSize &size)-
749{-
750 QWindowPrivate * const d = d_func();-
751 QSize adjustedSize = QSize(qBound(0, size.width(), ((1<<24)-1)), qBound(0, size.height(), ((1<<24)-1)));-
752 if (d->minimumSize == adjustedSize
d->minimumSize == adjustedSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
753 return;
never executed: return;
0
754 QSize oldSize = d->minimumSize;-
755 d->minimumSize = adjustedSize;-
756 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& isTopLevel()
isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
757 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
758 if (d->minimumSize.width() != oldSize.width()
d->minimumSize...ldSize.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
759 minimumWidthChanged(d->minimumSize.width());
never executed: minimumWidthChanged(d->minimumSize.width());
0
760 if (d->minimumSize.height() != oldSize.height()
d->minimumSize...dSize.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
761 minimumHeightChanged(d->minimumSize.height());
never executed: minimumHeightChanged(d->minimumSize.height());
0
762}
never executed: end of block
0
763-
764-
765-
766-
767-
768void QWindow::setX(int arg)-
769{-
770 QWindowPrivate * const d = d_func();-
771 if (x() != arg
x() != argDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
772 setGeometry(QRect(arg, y(), width(), height()));
never executed: setGeometry(QRect(arg, y(), width(), height()));
0
773 else-
774 d->positionAutomatic = false;
never executed: d->positionAutomatic = false;
0
775}-
776-
777-
778-
779-
780-
781void QWindow::setY(int arg)-
782{-
783 QWindowPrivate * const d = d_func();-
784 if (y() != arg
y() != argDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
785 setGeometry(QRect(x(), arg, width(), height()));
never executed: setGeometry(QRect(x(), arg, width(), height()));
0
786 else-
787 d->positionAutomatic = false;
never executed: d->positionAutomatic = false;
0
788}-
789-
790-
791-
792-
793-
794void QWindow::setWidth(int arg)-
795{-
796 if (width() != arg
width() != argDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
797 resize(arg, height());
never executed: resize(arg, height());
0
798}
never executed: end of block
0
799-
800-
801-
802-
803-
804void QWindow::setHeight(int arg)-
805{-
806 if (height() != arg
height() != argDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
807 resize(width(), arg);
never executed: resize(width(), arg);
0
808}
never executed: end of block
0
809-
810-
811-
812-
813-
814void QWindow::setMinimumWidth(int w)-
815{-
816 setMinimumSize(QSize(w, minimumHeight()));-
817}
never executed: end of block
0
818-
819-
820-
821-
822-
823void QWindow::setMinimumHeight(int h)-
824{-
825 setMinimumSize(QSize(minimumWidth(), h));-
826}
never executed: end of block
0
827void QWindow::setMaximumSize(const QSize &size)-
828{-
829 QWindowPrivate * const d = d_func();-
830 QSize adjustedSize = QSize(qBound(0, size.width(), ((1<<24)-1)), qBound(0, size.height(), ((1<<24)-1)));-
831 if (d->maximumSize == adjustedSize
d->maximumSize == adjustedSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
832 return;
never executed: return;
0
833 QSize oldSize = d->maximumSize;-
834 d->maximumSize = adjustedSize;-
835 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& isTopLevel()
isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
836 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
837 if (d->maximumSize.width() != oldSize.width()
d->maximumSize...ldSize.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
838 maximumWidthChanged(d->maximumSize.width());
never executed: maximumWidthChanged(d->maximumSize.width());
0
839 if (d->maximumSize.height() != oldSize.height()
d->maximumSize...dSize.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
840 maximumHeightChanged(d->maximumSize.height());
never executed: maximumHeightChanged(d->maximumSize.height());
0
841}
never executed: end of block
0
842-
843-
844-
845-
846-
847void QWindow::setMaximumWidth(int w)-
848{-
849 setMaximumSize(QSize(w, maximumHeight()));-
850}
never executed: end of block
0
851-
852-
853-
854-
855-
856void QWindow::setMaximumHeight(int h)-
857{-
858 setMaximumSize(QSize(maximumWidth(), h));-
859}
never executed: end of block
0
860void QWindow::setBaseSize(const QSize &size)-
861{-
862 QWindowPrivate * const d = d_func();-
863 if (d->baseSize == size
d->baseSize == sizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
864 return;
never executed: return;
0
865 d->baseSize = size;-
866 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& isTopLevel()
isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
867 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
868}
never executed: end of block
0
869void QWindow::setSizeIncrement(const QSize &size)-
870{-
871 QWindowPrivate * const d = d_func();-
872 if (d->sizeIncrement == size
d->sizeIncrement == sizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
873 return;
never executed: return;
0
874 d->sizeIncrement = size;-
875 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& isTopLevel()
isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
876 d->platformWindow->propagateSizeHints();
never executed: d->platformWindow->propagateSizeHints();
0
877}
never executed: end of block
0
878-
879-
880-
881-
882-
883-
884-
885void QWindow::setGeometry(int posx, int posy, int w, int h)-
886{-
887 setGeometry(QRect(posx, posy, w, h));-
888}
never executed: end of block
0
889-
890-
891-
892-
893-
894-
895void QWindow::setGeometry(const QRect &rect)-
896{-
897 QWindowPrivate * const d = d_func();-
898 d->positionAutomatic = false;-
899 const QRect oldRect = geometry();-
900 if (rect == oldRect
rect == oldRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
901 return;
never executed: return;
0
902-
903 d->positionPolicy = QWindowPrivate::WindowFrameExclusive;-
904 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
905 QRect nativeRect;-
906 QScreen *newScreen = d->screenForGeometry(rect);-
907 if (newScreen
newScreenDescription
TRUEnever evaluated
FALSEnever evaluated
&& isTopLevel()
isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
908 nativeRect = QHighDpi::toNativePixels(rect, newScreen);
never executed: nativeRect = QHighDpi::toNativePixels(rect, newScreen);
0
909 else-
910 nativeRect = QHighDpi::toNativePixels(rect, this);
never executed: nativeRect = QHighDpi::toNativePixels(rect, this);
0
911 d->platformWindow->setGeometry(nativeRect);-
912 }
never executed: end of block
else {
0
913 d->geometry = rect;-
914-
915 if (rect.x() != oldRect.x()
rect.x() != oldRect.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
916 xChanged(rect.x());
never executed: xChanged(rect.x());
0
917 if (rect.y() != oldRect.y()
rect.y() != oldRect.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
918 yChanged(rect.y());
never executed: yChanged(rect.y());
0
919 if (rect.width() != oldRect.width()
rect.width() !...ldRect.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
920 widthChanged(rect.width());
never executed: widthChanged(rect.width());
0
921 if (rect.height() != oldRect.height()
rect.height() ...dRect.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
922 heightChanged(rect.height());
never executed: heightChanged(rect.height());
0
923 }
never executed: end of block
0
924}-
925-
926-
927-
928-
929-
930-
931-
932QScreen *QWindowPrivate::screenForGeometry(const QRect &newGeometry)-
933{-
934 QWindow * const q = q_func();-
935 QScreen *currentScreen = q->screen();-
936 QScreen *fallback = currentScreen;-
937 QPoint center = newGeometry.center();-
938 if (!q->parent()
!q->parent()Description
TRUEnever evaluated
FALSEnever evaluated
&& currentScreen
currentScreenDescription
TRUEnever evaluated
FALSEnever evaluated
&& !currentScreen->geometry().contains(center)
!currentScreen...ntains(center)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
939 const auto screens = currentScreen->virtualSiblings();-
940 for (QScreen* screen : screens) {-
941 if (screen->geometry().contains(center)
screen->geomet...ntains(center)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
942 return
never executed: return screen;
screen;
never executed: return screen;
0
943 if (screen->geometry().intersects(newGeometry)
screen->geomet...s(newGeometry)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
944 fallback = screen;
never executed: fallback = screen;
0
945 }
never executed: end of block
0
946 }
never executed: end of block
0
947 return
never executed: return fallback;
fallback;
never executed: return fallback;
0
948}-
949-
950-
951-
952-
953-
954-
955-
956QRect QWindow::geometry() const-
957{-
958 const QWindowPrivate * const d = d_func();-
959 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
960 return
never executed: return QHighDpi::fromNativePixels(d->platformWindow->geometry(), this);
QHighDpi::fromNativePixels(d->platformWindow->geometry(), this);
never executed: return QHighDpi::fromNativePixels(d->platformWindow->geometry(), this);
0
961 return
never executed: return d->geometry;
d->geometry;
never executed: return d->geometry;
0
962}-
963-
964-
965-
966-
967-
968-
969QMargins QWindow::frameMargins() const-
970{-
971 const QWindowPrivate * const d = d_func();-
972 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
973 return
never executed: return QHighDpi::fromNativePixels(d->platformWindow->frameMargins(), this);
QHighDpi::fromNativePixels(d->platformWindow->frameMargins(), this);
never executed: return QHighDpi::fromNativePixels(d->platformWindow->frameMargins(), this);
0
974 return
never executed: return QMargins();
QMargins();
never executed: return QMargins();
0
975}-
976-
977-
978-
979-
980-
981-
982QRect QWindow::frameGeometry() const-
983{-
984 const QWindowPrivate * const d = d_func();-
985 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
986 QMargins m = frameMargins();-
987 return
never executed: return QHighDpi::fromNativePixels(d->platformWindow->geometry(), this).adjusted(-m.left(), -m.top(), m.right(), m.bottom());
QHighDpi::fromNativePixels(d->platformWindow->geometry(), this).adjusted(-m.left(), -m.top(), m.right(), m.bottom());
never executed: return QHighDpi::fromNativePixels(d->platformWindow->geometry(), this).adjusted(-m.left(), -m.top(), m.right(), m.bottom());
0
988 }-
989 return
never executed: return d->geometry;
d->geometry;
never executed: return d->geometry;
0
990}-
991QPoint QWindow::framePosition() const-
992{-
993 const QWindowPrivate * const d = d_func();-
994 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
995 QMargins margins = frameMargins();-
996 return
never executed: return QHighDpi::fromNativePixels(d->platformWindow->geometry().topLeft(), this) - QPoint(margins.left(), margins.top());
QHighDpi::fromNativePixels(d->platformWindow->geometry().topLeft(), this) - QPoint(margins.left(), margins.top());
never executed: return QHighDpi::fromNativePixels(d->platformWindow->geometry().topLeft(), this) - QPoint(margins.left(), margins.top());
0
997 }-
998 return
never executed: return d->geometry.topLeft();
d->geometry.topLeft();
never executed: return d->geometry.topLeft();
0
999}-
1000-
1001-
1002-
1003-
1004-
1005-
1006void QWindow::setFramePosition(const QPoint &point)-
1007{-
1008 QWindowPrivate * const d = d_func();-
1009 d->positionPolicy = QWindowPrivate::WindowFrameInclusive;-
1010 d->positionAutomatic = false;-
1011 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1012 d->platformWindow->setGeometry(QHighDpi::toNativePixels(QRect(point, size()), this));-
1013 }
never executed: end of block
else {
0
1014 d->geometry.moveTopLeft(point);-
1015 }
never executed: end of block
0
1016}-
1017-
1018-
1019-
1020-
1021-
1022-
1023void QWindow::setPosition(const QPoint &pt)-
1024{-
1025 setGeometry(QRect(pt, size()));-
1026}
never executed: end of block
0
1027-
1028-
1029-
1030-
1031-
1032-
1033void QWindow::setPosition(int posx, int posy)-
1034{-
1035 setPosition(QPoint(posx, posy));-
1036}
never executed: end of block
0
1037void QWindow::resize(int w, int h)-
1038{-
1039 resize(QSize(w, h));-
1040}
never executed: end of block
0
1041-
1042-
1043-
1044-
1045-
1046-
1047void QWindow::resize(const QSize &newSize)-
1048{-
1049 QWindowPrivate * const d = d_func();-
1050 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1051 d->platformWindow->setGeometry(QHighDpi::toNativePixels(QRect(position(), newSize), this));-
1052 }
never executed: end of block
else {
0
1053 const QSize oldSize = d->geometry.size();-
1054 d->geometry.setSize(newSize);-
1055 if (newSize.width() != oldSize.width()
newSize.width(...ldSize.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1056 widthChanged(newSize.width());
never executed: widthChanged(newSize.width());
0
1057 if (newSize.height() != oldSize.height()
newSize.height...dSize.height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1058 heightChanged(newSize.height());
never executed: heightChanged(newSize.height());
0
1059 }
never executed: end of block
0
1060}-
1061-
1062-
1063-
1064-
1065-
1066-
1067void QWindow::destroy()-
1068{-
1069 QWindowPrivate * const d = d_func();-
1070 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1071 return;
never executed: return;
0
1072-
1073 QObjectList childrenWindows = children();-
1074 for (int i = 0; i < childrenWindows.size()
i < childrenWindows.size()Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1075 QObject *object = childrenWindows.at(i);-
1076 if (object->isWindowType()
object->isWindowType()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1077 QWindow *w = static_cast<QWindow*>(object);-
1078 w->destroy();-
1079 }
never executed: end of block
0
1080 }
never executed: end of block
0
1081-
1082 if (QGuiApplicationPrivate::focus_window == this
QGuiApplicatio...window == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1083 QGuiApplicationPrivate::focus_window = parent();
never executed: QGuiApplicationPrivate::focus_window = parent();
0
1084 if (QGuiApplicationPrivate::currentMouseWindow == this
QGuiApplicatio...Window == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1085 QGuiApplicationPrivate::currentMouseWindow = parent();
never executed: QGuiApplicationPrivate::currentMouseWindow = parent();
0
1086 if (QGuiApplicationPrivate::currentMousePressWindow == this
QGuiApplicatio...Window == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1087 QGuiApplicationPrivate::currentMousePressWindow = parent();
never executed: QGuiApplicationPrivate::currentMousePressWindow = parent();
0
1088-
1089 for (int i = 0; i < QGuiApplicationPrivate::tabletDevicePoints.size()
i < QGuiApplic...ePoints.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1090 if (QGuiApplicationPrivate::tabletDevicePoints.at(i).target == this
QGuiApplicatio...target == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1091 QGuiApplicationPrivate::tabletDevicePoints[i].target = parent();
never executed: QGuiApplicationPrivate::tabletDevicePoints[i].target = parent();
0
1092-
1093 bool wasVisible = isVisible();-
1094 d->visibilityOnDestroy = wasVisible
wasVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1095-
1096 setVisible(false);-
1097-
1098 QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);-
1099 QGuiApplication::sendEvent(this, &e);-
1100-
1101 delete d->platformWindow;-
1102 d->resizeEventPending = true;-
1103 d->receivedExpose = false;-
1104 d->exposed = false;-
1105 d->platformWindow = 0;-
1106-
1107 if (wasVisible
wasVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1108 d->maybeQuitOnLastWindowClosed();
never executed: d->maybeQuitOnLastWindowClosed();
0
1109}
never executed: end of block
0
1110-
1111-
1112-
1113-
1114-
1115-
1116QPlatformWindow *QWindow::handle() const-
1117{-
1118 const QWindowPrivate * const d = d_func();-
1119 return
never executed: return d->platformWindow;
d->platformWindow;
never executed: return d->platformWindow;
0
1120}-
1121-
1122-
1123-
1124-
1125-
1126-
1127QPlatformSurface *QWindow::surfaceHandle() const-
1128{-
1129 const QWindowPrivate * const d = d_func();-
1130 return
never executed: return d->platformWindow;
d->platformWindow;
never executed: return d->platformWindow;
0
1131}-
1132bool QWindow::setKeyboardGrabEnabled(bool grab)-
1133{-
1134 QWindowPrivate * const d = d_func();-
1135 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1136 return
never executed: return d->platformWindow->setKeyboardGrabEnabled(grab);
d->platformWindow->setKeyboardGrabEnabled(grab);
never executed: return d->platformWindow->setKeyboardGrabEnabled(grab);
0
1137 return
never executed: return false;
false;
never executed: return false;
0
1138}-
1139bool QWindow::setMouseGrabEnabled(bool grab)-
1140{-
1141 QWindowPrivate * const d = d_func();-
1142 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1143 return
never executed: return d->platformWindow->setMouseGrabEnabled(grab);
d->platformWindow->setMouseGrabEnabled(grab);
never executed: return d->platformWindow->setMouseGrabEnabled(grab);
0
1144 return
never executed: return false;
false;
never executed: return false;
0
1145}-
1146QScreen *QWindow::screen() const-
1147{-
1148 const QWindowPrivate * const d = d_func();-
1149 return
never executed: return d->parentWindow ? d->parentWindow->screen() : d->topLevelScreen.data();
d->parentWindow ? d->parentWindow->screen() : d->topLevelScreen.data();
never executed: return d->parentWindow ? d->parentWindow->screen() : d->topLevelScreen.data();
0
1150}-
1151void QWindow::setScreen(QScreen *newScreen)-
1152{-
1153 QWindowPrivate * const d = d_func();-
1154 if (!newScreen
!newScreenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1155 newScreen = QGuiApplication::primaryScreen();
never executed: newScreen = QGuiApplication::primaryScreen();
0
1156 d->setTopLevelScreen(newScreen, newScreen != 0);-
1157}
never executed: end of block
0
1158QAccessibleInterface *QWindow::accessibleRoot() const-
1159{-
1160 return
never executed: return 0;
0;
never executed: return 0;
0
1161}-
1162QObject *QWindow::focusObject() const-
1163{-
1164 return
never executed: return const_cast<QWindow *>(this);
const_cast<QWindow *>(this);
never executed: return const_cast<QWindow *>(this);
0
1165}-
1166void QWindow::show()-
1167{-
1168 Qt::WindowState defaultState = QGuiApplicationPrivate::platformIntegration()->defaultWindowState(d_func()->windowFlags);-
1169 if (defaultState == Qt::WindowFullScreen
defaultState =...ndowFullScreenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1170 showFullScreen();
never executed: showFullScreen();
0
1171 else if (defaultState == Qt::WindowMaximized
defaultState =...indowMaximizedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1172 showMaximized();
never executed: showMaximized();
0
1173 else-
1174 showNormal();
never executed: showNormal();
0
1175}-
1176void QWindow::hide()-
1177{-
1178 setVisible(false);-
1179}
never executed: end of block
0
1180void QWindow::showMinimized()-
1181{-
1182 setWindowState(Qt::WindowMinimized);-
1183 setVisible(true);-
1184}
never executed: end of block
0
1185void QWindow::showMaximized()-
1186{-
1187 setWindowState(Qt::WindowMaximized);-
1188 setVisible(true);-
1189}
never executed: end of block
0
1190void QWindow::showFullScreen()-
1191{-
1192 setWindowState(Qt::WindowFullScreen);-
1193 setVisible(true);-
1194-
1195-
1196 requestActivate();-
1197-
1198}
never executed: end of block
0
1199void QWindow::showNormal()-
1200{-
1201 setWindowState(Qt::WindowNoState);-
1202 setVisible(true);-
1203}
never executed: end of block
0
1204bool QWindow::close()-
1205{-
1206 QWindowPrivate * const d = d_func();-
1207-
1208-
1209 if (parent()
parent()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1210 return
never executed: return false;
false;
never executed: return false;
0
1211-
1212 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1213 return
never executed: return true;
true;
never executed: return true;
0
1214-
1215 bool accepted = false;-
1216 QWindowSystemInterface::handleCloseEvent(this, &accepted);-
1217 QWindowSystemInterface::flushWindowSystemEvents();-
1218 return
never executed: return accepted;
accepted;
never executed: return accepted;
0
1219}-
1220void QWindow::exposeEvent(QExposeEvent *ev)-
1221{-
1222 ev->ignore();-
1223}
never executed: end of block
0
1224-
1225-
1226-
1227-
1228void QWindow::moveEvent(QMoveEvent *ev)-
1229{-
1230 ev->ignore();-
1231}
never executed: end of block
0
1232void QWindow::resizeEvent(QResizeEvent *ev)-
1233{-
1234 ev->ignore();-
1235}
never executed: end of block
0
1236void QWindow::showEvent(QShowEvent *ev)-
1237{-
1238 ev->ignore();-
1239}
never executed: end of block
0
1240-
1241-
1242-
1243-
1244-
1245-
1246-
1247void QWindow::hideEvent(QHideEvent *ev)-
1248{-
1249 ev->ignore();-
1250}
never executed: end of block
0
1251bool QWindow::event(QEvent *ev)-
1252{-
1253 switch (ev->type()) {-
1254 case
never executed: case QEvent::MouseMove:
QEvent::MouseMove:
never executed: case QEvent::MouseMove:
0
1255 mouseMoveEvent(static_cast<QMouseEvent*>(ev));-
1256 break;
never executed: break;
0
1257-
1258 case
never executed: case QEvent::MouseButtonPress:
QEvent::MouseButtonPress:
never executed: case QEvent::MouseButtonPress:
0
1259 mousePressEvent(static_cast<QMouseEvent*>(ev));-
1260 break;
never executed: break;
0
1261-
1262 case
never executed: case QEvent::MouseButtonRelease:
QEvent::MouseButtonRelease:
never executed: case QEvent::MouseButtonRelease:
0
1263 mouseReleaseEvent(static_cast<QMouseEvent*>(ev));-
1264 break;
never executed: break;
0
1265-
1266 case
never executed: case QEvent::MouseButtonDblClick:
QEvent::MouseButtonDblClick:
never executed: case QEvent::MouseButtonDblClick:
0
1267 mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev));-
1268 break;
never executed: break;
0
1269-
1270 case
never executed: case QEvent::TouchBegin:
QEvent::TouchBegin:
never executed: case QEvent::TouchBegin:
0
1271 case
never executed: case QEvent::TouchUpdate:
QEvent::TouchUpdate:
never executed: case QEvent::TouchUpdate:
0
1272 case
never executed: case QEvent::TouchEnd:
QEvent::TouchEnd:
never executed: case QEvent::TouchEnd:
0
1273 case
never executed: case QEvent::TouchCancel:
QEvent::TouchCancel:
never executed: case QEvent::TouchCancel:
0
1274 touchEvent(static_cast<QTouchEvent *>(ev));-
1275 break;
never executed: break;
0
1276-
1277 case
never executed: case QEvent::Move:
QEvent::Move:
never executed: case QEvent::Move:
0
1278 moveEvent(static_cast<QMoveEvent*>(ev));-
1279 break;
never executed: break;
0
1280-
1281 case
never executed: case QEvent::Resize:
QEvent::Resize:
never executed: case QEvent::Resize:
0
1282 resizeEvent(static_cast<QResizeEvent*>(ev));-
1283 break;
never executed: break;
0
1284-
1285 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
0
1286 keyPressEvent(static_cast<QKeyEvent *>(ev));-
1287 break;
never executed: break;
0
1288-
1289 case
never executed: case QEvent::KeyRelease:
QEvent::KeyRelease:
never executed: case QEvent::KeyRelease:
0
1290 keyReleaseEvent(static_cast<QKeyEvent *>(ev));-
1291 break;
never executed: break;
0
1292-
1293 case
never executed: case QEvent::FocusIn:
QEvent::FocusIn:
never executed: case QEvent::FocusIn:
{
0
1294 focusInEvent(static_cast<QFocusEvent *>(ev));-
1295-
1296 QAccessible::State state;-
1297 state.active = true;-
1298 QAccessibleStateChangeEvent event(this, state);-
1299 QAccessible::updateAccessibility(&event);-
1300-
1301 break;
never executed: break;
}
0
1302-
1303 case
never executed: case QEvent::FocusOut:
QEvent::FocusOut:
never executed: case QEvent::FocusOut:
{
0
1304 focusOutEvent(static_cast<QFocusEvent *>(ev));-
1305-
1306 QAccessible::State state;-
1307 state.active = true;-
1308 QAccessibleStateChangeEvent event(this, state);-
1309 QAccessible::updateAccessibility(&event);-
1310-
1311 break;
never executed: break;
}
0
1312-
1313-
1314 case
never executed: case QEvent::Wheel:
QEvent::Wheel:
never executed: case QEvent::Wheel:
0
1315 wheelEvent(static_cast<QWheelEvent*>(ev));-
1316 break;
never executed: break;
0
1317-
1318-
1319 case
never executed: case QEvent::Close:
QEvent::Close:
never executed: case QEvent::Close:
0
1320 if (ev->isAccepted()
ev->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1321 destroy();
never executed: destroy();
0
1322 break;
never executed: break;
0
1323-
1324 case
never executed: case QEvent::Expose:
QEvent::Expose:
never executed: case QEvent::Expose:
0
1325 exposeEvent(static_cast<QExposeEvent *>(ev));-
1326 break;
never executed: break;
0
1327-
1328 case
never executed: case QEvent::Show:
QEvent::Show:
never executed: case QEvent::Show:
0
1329 showEvent(static_cast<QShowEvent *>(ev));-
1330 break;
never executed: break;
0
1331-
1332 case
never executed: case QEvent::Hide:
QEvent::Hide:
never executed: case QEvent::Hide:
0
1333 hideEvent(static_cast<QHideEvent *>(ev));-
1334 break;
never executed: break;
0
1335-
1336 case
never executed: case QEvent::ApplicationWindowIconChange:
QEvent::ApplicationWindowIconChange:
never executed: case QEvent::ApplicationWindowIconChange:
0
1337 setIcon(icon());-
1338 break;
never executed: break;
0
1339-
1340 case
never executed: case QEvent::WindowStateChange:
QEvent::WindowStateChange:
never executed: case QEvent::WindowStateChange:
{
0
1341 QWindowPrivate * const d = d_func();-
1342 windowStateChanged(d->windowState);-
1343 d->updateVisibility();-
1344 break;
never executed: break;
0
1345 }-
1346-
1347-
1348 case
never executed: case QEvent::TabletPress:
QEvent::TabletPress:
never executed: case QEvent::TabletPress:
0
1349 case
never executed: case QEvent::TabletMove:
QEvent::TabletMove:
never executed: case QEvent::TabletMove:
0
1350 case
never executed: case QEvent::TabletRelease:
QEvent::TabletRelease:
never executed: case QEvent::TabletRelease:
0
1351 tabletEvent(static_cast<QTabletEvent *>(ev));-
1352 break;
never executed: break;
0
1353-
1354-
1355 case
never executed: case QEvent::Timer:
QEvent::Timer:
never executed: case QEvent::Timer:
{
0
1356 QWindowPrivate * const d = d_func();-
1357 if (static_cast<
static_cast<QT...d->updateTimerDescription
TRUEnever evaluated
FALSEnever evaluated
QTimerEvent *>(ev)->timerId() == d->updateTimer
static_cast<QT...d->updateTimerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1358 killTimer(d->updateTimer);-
1359 d->updateTimer = 0;-
1360 d->deliverUpdateRequest();-
1361 }
never executed: end of block
else {
0
1362 QObject::event(ev);-
1363 }
never executed: end of block
0
1364 break;
never executed: break;
0
1365 }-
1366-
1367 case
never executed: case QEvent::PlatformSurface:
QEvent::PlatformSurface:
never executed: case QEvent::PlatformSurface:
{
0
1368 if ((static_cast<
(static_cast<Q...tToBeDestroyedDescription
TRUEnever evaluated
FALSEnever evaluated
QPlatformSurfaceEvent *>(ev))->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed
(static_cast<Q...tToBeDestroyedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1369-
1370 QOpenGLContext *context = QOpenGLContext::currentContext();-
1371 if (context
contextDescription
TRUEnever evaluated
FALSEnever evaluated
&& context->surface() == static_cast<QSurface *>(this)
context->surfa...rface *>(this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1372 context->doneCurrent();
never executed: context->doneCurrent();
0
1373-
1374 }
never executed: end of block
0
1375 break;
never executed: break;
0
1376 }-
1377-
1378 default
never executed: default:
:
never executed: default:
0
1379 return
never executed: return QObject::event(ev);
QObject::event(ev);
never executed: return QObject::event(ev);
0
1380 }-
1381 return
never executed: return true;
true;
never executed: return true;
0
1382}-
1383-
1384void QWindowPrivate::deliverUpdateRequest()-
1385{-
1386 QWindow * const q = q_func();-
1387 updateRequestPending = false;-
1388 QEvent request(QEvent::UpdateRequest);-
1389 QCoreApplication::sendEvent(q, &request);-
1390}
never executed: end of block
0
1391void QWindow::requestUpdate()-
1392{-
1393 ((!(QThread::currentThread() == QCoreApplication::instance()->thread())) ? qt_assert_x("QWindow", "Updates can only be scheduled from the GUI (main) thread",-
1394 __FILE__-
1395 ,-
1396 2199-
1397 ) : qt_noop())-
1398 ;-
1399-
1400 QWindowPrivate * const d = d_func();-
1401 if (d->updateRequestPending
d->updateRequestPendingDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1402 return;
never executed: return;
0
1403 d->updateRequestPending = true;-
1404 d->platformWindow->requestUpdate();-
1405}
never executed: end of block
0
1406-
1407-
1408-
1409-
1410-
1411-
1412void QWindow::keyPressEvent(QKeyEvent *ev)-
1413{-
1414 ev->ignore();-
1415}
never executed: end of block
0
1416-
1417-
1418-
1419-
1420-
1421-
1422void QWindow::keyReleaseEvent(QKeyEvent *ev)-
1423{-
1424 ev->ignore();-
1425}
never executed: end of block
0
1426void QWindow::focusInEvent(QFocusEvent *ev)-
1427{-
1428 ev->ignore();-
1429}
never executed: end of block
0
1430void QWindow::focusOutEvent(QFocusEvent *ev)-
1431{-
1432 ev->ignore();-
1433}
never executed: end of block
0
1434-
1435-
1436-
1437-
1438-
1439-
1440void QWindow::mousePressEvent(QMouseEvent *ev)-
1441{-
1442 ev->ignore();-
1443}
never executed: end of block
0
1444-
1445-
1446-
1447-
1448-
1449-
1450void QWindow::mouseReleaseEvent(QMouseEvent *ev)-
1451{-
1452 ev->ignore();-
1453}
never executed: end of block
0
1454-
1455-
1456-
1457-
1458-
1459-
1460void QWindow::mouseDoubleClickEvent(QMouseEvent *ev)-
1461{-
1462 ev->ignore();-
1463}
never executed: end of block
0
1464-
1465-
1466-
1467-
1468void QWindow::mouseMoveEvent(QMouseEvent *ev)-
1469{-
1470 ev->ignore();-
1471}
never executed: end of block
0
1472-
1473-
1474-
1475-
1476-
1477void QWindow::wheelEvent(QWheelEvent *ev)-
1478{-
1479 ev->ignore();-
1480}
never executed: end of block
0
1481-
1482-
1483-
1484-
1485-
1486void QWindow::touchEvent(QTouchEvent *ev)-
1487{-
1488 ev->ignore();-
1489}
never executed: end of block
0
1490void QWindow::tabletEvent(QTabletEvent *ev)-
1491{-
1492 ev->ignore();-
1493}
never executed: end of block
0
1494bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *result)-
1495{-
1496 (void)eventType;;-
1497 (void)message;;-
1498 (void)result;;-
1499 return
never executed: return false;
false;
never executed: return false;
0
1500}-
1501QPoint QWindow::mapToGlobal(const QPoint &pos) const-
1502{-
1503 const QWindowPrivate * const d = d_func();-
1504-
1505 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
0
1506 && (type() == Qt::ForeignWindow
type() == Qt::ForeignWindowDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->platformWindow->isEmbedded()
d->platformWin...->isEmbedded()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1507 return
never executed: return QHighDpi::fromNativeLocalPosition(d->platformWindow->mapToGlobal(QHighDpi::toNativeLocalPosition(pos, this)), this);
QHighDpi::fromNativeLocalPosition(d->platformWindow->mapToGlobal(QHighDpi::toNativeLocalPosition(pos, this)), this);
never executed: return QHighDpi::fromNativeLocalPosition(d->platformWindow->mapToGlobal(QHighDpi::toNativeLocalPosition(pos, this)), this);
0
1508 }-
1509 return
never executed: return pos + d->globalPosition();
pos + d->globalPosition();
never executed: return pos + d->globalPosition();
0
1510}-
1511QPoint QWindow::mapFromGlobal(const QPoint &pos) const-
1512{-
1513 const QWindowPrivate * const d = d_func();-
1514-
1515 if (d->platformWindow
d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
0
1516 && (type() == Qt::ForeignWindow
type() == Qt::ForeignWindowDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->platformWindow->isEmbedded()
d->platformWin...->isEmbedded()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1517 return
never executed: return QHighDpi::fromNativeLocalPosition(d->platformWindow->mapFromGlobal(QHighDpi::toNativeLocalPosition(pos, this)), this);
QHighDpi::fromNativeLocalPosition(d->platformWindow->mapFromGlobal(QHighDpi::toNativeLocalPosition(pos, this)), this);
never executed: return QHighDpi::fromNativeLocalPosition(d->platformWindow->mapFromGlobal(QHighDpi::toNativeLocalPosition(pos, this)), this);
0
1518 }-
1519 return
never executed: return pos - d->globalPosition();
pos - d->globalPosition();
never executed: return pos - d->globalPosition();
0
1520}-
1521-
1522-
1523__attribute__((visibility("default"))) QWindowPrivate *qt_window_private(QWindow *window)-
1524{-
1525 return
never executed: return window->d_func();
window->d_func();
never executed: return window->d_func();
0
1526}-
1527-
1528void QWindowPrivate::maybeQuitOnLastWindowClosed()-
1529{-
1530 if (!QCoreApplication::instance()
!QCoreApplication::instance()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1531 return;
never executed: return;
0
1532-
1533 QWindow * const q = q_func();-
1534-
1535 bool quitOnClose = QGuiApplication::quitOnLastWindowClosed()
QGuiApplicatio...WindowClosed()Description
TRUEnever evaluated
FALSEnever evaluated
&& !q->parent()
!q->parent()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1536 QWindowList list = QGuiApplication::topLevelWindows();-
1537 bool lastWindowClosed = true;-
1538 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1539 QWindow *w = list.at(i);-
1540 if (!w->isVisible()
!w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| w->transientParent()
w->transientParent()Description
TRUEnever evaluated
FALSEnever evaluated
|| w->type() == Qt::ToolTip
w->type() == Qt::ToolTipDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1541 continue;
never executed: continue;
0
1542 lastWindowClosed = false;-
1543 break;
never executed: break;
0
1544 }-
1545 if (lastWindowClosed
lastWindowClosedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1546 QGuiApplicationPrivate::emitLastWindowClosed();-
1547 if (quitOnClose
quitOnCloseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1548 QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance()));-
1549 applicationPrivate->maybeQuit();-
1550 }
never executed: end of block
0
1551 }
never executed: end of block
0
1552}
never executed: end of block
0
1553-
1554QWindow *QWindowPrivate::topLevelWindow() const-
1555{-
1556 const QWindow * const q = q_func();-
1557-
1558 QWindow *window = const_cast<QWindow *>(q);-
1559-
1560 while (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1561 QWindow *parent = window->parent();-
1562 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1563 parent = window->transientParent();
never executed: parent = window->transientParent();
0
1564-
1565 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1566 break;
never executed: break;
0
1567-
1568 window = parent;-
1569 }
never executed: end of block
0
1570-
1571 return
never executed: return window;
window;
never executed: return window;
0
1572}-
1573QWindow *QWindow::fromWinId(WId id)-
1574{-
1575 if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ForeignWindows)
!QGuiApplicati...oreignWindows)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1576 QMessageLogger(__FILE__, 2454, __PRETTY_FUNCTION__).warning("QWindow::fromWinId(): platform plugin does not support foreign windows.");-
1577 return
never executed: return 0;
0;
never executed: return 0;
0
1578 }-
1579-
1580 QWindow *window = new QWindow;-
1581 window->setFlags(Qt::ForeignWindow);-
1582 window->setProperty("_q_foreignWinId", QVariant::fromValue(id));-
1583 window->create();-
1584 if (!window->handle()
!window->handle()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1585 delete window;-
1586 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
1587 }-
1588 return
never executed: return window;
window;
never executed: return window;
0
1589}-
1590void QWindow::alert(int msec)-
1591{-
1592 QWindowPrivate * const d = d_func();-
1593 if (!d->platformWindow
!d->platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->platformWindow->isAlertState()
d->platformWin...isAlertState()Description
TRUEnever evaluated
FALSEnever evaluated
|| isActive()
isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1594 return;
never executed: return;
0
1595 d->platformWindow->setAlertState(true);-
1596 if (d->platformWindow->isAlertState()
d->platformWin...isAlertState()Description
TRUEnever evaluated
FALSEnever evaluated
&& msec
msecDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1597 QTimer::singleShot(msec, this, qFlagLocation("1""_q_clearAlert()" "\0" __FILE__ ":" "2487"));
never executed: QTimer::singleShot(msec, this, qFlagLocation("1""_q_clearAlert()" "\0" __FILE__ ":" "2487"));
0
1598}
never executed: end of block
0
1599-
1600void QWindowPrivate::_q_clearAlert()-
1601{-
1602 if (platformWindow
platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
&& platformWindow->isAlertState()
platformWindow->isAlertState()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1603 platformWindow->setAlertState(false);
never executed: platformWindow->setAlertState(false);
0
1604}
never executed: end of block
0
1605void QWindow::setCursor(const QCursor &cursor)-
1606{-
1607 QWindowPrivate * const d = d_func();-
1608 d->setCursor(&cursor);-
1609}
never executed: end of block
0
1610-
1611-
1612-
1613-
1614void QWindow::unsetCursor()-
1615{-
1616 QWindowPrivate * const d = d_func();-
1617 d->setCursor(0);-
1618}
never executed: end of block
0
1619-
1620-
1621-
1622-
1623-
1624-
1625QCursor QWindow::cursor() const-
1626{-
1627 const QWindowPrivate * const d = d_func();-
1628 return
never executed: return d->cursor;
d->cursor;
never executed: return d->cursor;
0
1629}-
1630-
1631void QWindowPrivate::setCursor(const QCursor *newCursor)-
1632{-
1633-
1634 QWindow * const q = q_func();-
1635 if (newCursor
newCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1636 const Qt::CursorShape newShape = newCursor->shape();-
1637 if (newShape <= Qt::LastCursor
newShape <= Qt::LastCursorDescription
TRUEnever evaluated
FALSEnever evaluated
&& hasCursor
hasCursorDescription
TRUEnever evaluated
FALSEnever evaluated
&& newShape == cursor.shape()
newShape == cursor.shape()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1638 return;
never executed: return;
0
1639 cursor = *newCursor;-
1640 hasCursor = true;-
1641 }
never executed: end of block
else {
0
1642 if (!hasCursor
!hasCursorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1643 return;
never executed: return;
0
1644 cursor = QCursor(Qt::ArrowCursor);-
1645 hasCursor = false;-
1646 }
never executed: end of block
0
1647-
1648 QScreen* screen = q->screen();-
1649 if (screen
screenDescription
TRUEnever evaluated
FALSEnever evaluated
&& screen->handle()->cursor()
screen->handle()->cursor()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1650 applyCursor();-
1651 QEvent event(QEvent::CursorChange);-
1652 QGuiApplication::sendEvent(q, &event);-
1653 }
never executed: end of block
0
1654}
never executed: end of block
0
1655-
1656void QWindowPrivate::applyCursor()-
1657{-
1658 QWindow * const q = q_func();-
1659 if (platformWindow
platformWindowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1660 if (QPlatformCursor *platformCursor = q->screen()->handle()->cursor()
QPlatformCurso...le()->cursor()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1661 QCursor *c = QGuiApplication::overrideCursor();-
1662 if (!c
!cDescription
TRUEnever evaluated
FALSEnever evaluated
&& hasCursor
hasCursorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1663 c = &cursor;
never executed: c = &cursor;
0
1664 platformCursor->changeCursor(c, q);-
1665 }
never executed: end of block
0
1666 }
never executed: end of block
0
1667}
never executed: end of block
0
1668-
1669-
1670-
1671QDebug operator<<(QDebug debug, const QWindow *window)-
1672{-
1673 QDebugStateSaver saver(debug);-
1674 debug.nospace();-
1675 if (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1676 debug << window->metaObject()->className() << '(' << (const void *)window;-
1677 if (!window->objectName().isEmpty()
!window->objec...me().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1678 debug << ", name=" << window->objectName();
never executed: debug << ", name=" << window->objectName();
0
1679 if (debug.verbosity() > 2
debug.verbosity() > 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1680 const QRect geometry = window->geometry();-
1681 if (window->isVisible()
window->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1682 debug << ", visible";
never executed: debug << ", visible";
0
1683 if (window->isExposed()
window->isExposed()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1684 debug << ", exposed";
never executed: debug << ", exposed";
0
1685 debug << ", state=" << window->windowState()-
1686 << ", type=" << window->type() << ", flags=" << window->flags()-
1687 << ", surface type=" << window->surfaceType();-
1688 if (window->isTopLevel()
window->isTopLevel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1689 debug << ", toplevel";
never executed: debug << ", toplevel";
0
1690 debug << ", " << geometry.width() << 'x' << geometry.height()-
1691 << forcesign << geometry.x() << geometry.y() << noforcesign;-
1692 const QMargins margins = window->frameMargins();-
1693 if (!margins.isNull()
!margins.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1694 debug << ", margins=" << margins;
never executed: debug << ", margins=" << margins;
0
1695 debug << ", devicePixelRatio=" << window->devicePixelRatio();-
1696 if (const
const QPlatfor...ndow->handle()Description
TRUEnever evaluated
FALSEnever evaluated
QPlatformWindow *platformWindow = window->handle()
const QPlatfor...ndow->handle()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1697 debug << ", winId=0x" << hex << platformWindow->winId() << dec;
never executed: debug << ", winId=0x" << hex << platformWindow->winId() << dec;
0
1698 if (const
const QScreen ...ndow->screen()Description
TRUEnever evaluated
FALSEnever evaluated
QScreen *screen = window->screen()
const QScreen ...ndow->screen()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1699 debug << ", on " << screen->name();
never executed: debug << ", on " << screen->name();
0
1700 }
never executed: end of block
0
1701 debug << ')';-
1702 }
never executed: end of block
else {
0
1703 debug << "QWindow(0x0)";-
1704 }
never executed: end of block
0
1705 return
never executed: return debug;
debug;
never executed: return debug;
0
1706}-
1707-
1708-
1709-
1710-
Switch to Source codePreprocessed file

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