kernel/qwidget_qpa.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "QtWidgets/qwidget.h" -
43#include "QtGui/qevent.h" -
44#include "QtWidgets/qapplication.h" -
45#include "private/qwidgetbackingstore_p.h" -
46#include "private/qwidget_p.h" -
47#include "private/qwidgetwindow_qpa_p.h" -
48#include "private/qapplication_p.h" -
49#include "QtWidgets/qdesktopwidget.h" -
50#include <qpa/qplatformwindow.h> -
51#include "QtGui/qsurfaceformat.h" -
52#include <qpa/qplatformopenglcontext.h> -
53#include <qpa/qplatformintegration.h> -
54#include "QtGui/private/qwindow_p.h" -
55 -
56#include <qpa/qplatformcursor.h> -
57#include <QtGui/QGuiApplication> -
58#include <QtGui/QScreen> -
59#include <QtCore/QMargins> -
60 -
61QT_BEGIN_NAMESPACE -
62 -
63void q_createNativeChildrenAndSetParent(const QWidget *parentWidget) -
64{ -
65 QObjectList children = parentWidget->children();
executed (the execution status of this line is deduced): QObjectList children = parentWidget->children();
-
66 for (int i = 0; i < children.size(); i++) {
evaluated: i < children.size()
TRUEFALSE
yes
Evaluation Count:18254
yes
Evaluation Count:12472
12472-18254
67 if (children.at(i)->isWidgetType()) {
evaluated: children.at(i)->isWidgetType()
TRUEFALSE
yes
Evaluation Count:10881
yes
Evaluation Count:7373
7373-10881
68 const QWidget *childWidget = qobject_cast<const QWidget *>(children.at(i));
executed (the execution status of this line is deduced): const QWidget *childWidget = qobject_cast<const QWidget *>(children.at(i));
-
69 if (childWidget) { // should not be necessary
partially evaluated: childWidget
TRUEFALSE
yes
Evaluation Count:10881
no
Evaluation Count:0
0-10881
70 if (childWidget->testAttribute(Qt::WA_NativeWindow)) {
evaluated: childWidget->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:10878
3-10878
71 if (!childWidget->windowHandle())
partially evaluated: !childWidget->windowHandle()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
72 childWidget->winId();
never executed: childWidget->winId();
0
73 if (childWidget->windowHandle()) {
partially evaluated: childWidget->windowHandle()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
74 QWindow *parentWindow = childWidget->nativeParentWidget()->windowHandle();
executed (the execution status of this line is deduced): QWindow *parentWindow = childWidget->nativeParentWidget()->windowHandle();
-
75 if (childWidget->isWindow())
partially evaluated: childWidget->isWindow()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
76 childWidget->windowHandle()->setTransientParent(parentWindow);
never executed: childWidget->windowHandle()->setTransientParent(parentWindow);
0
77 else -
78 childWidget->windowHandle()->setParent(parentWindow);
executed: childWidget->windowHandle()->setParent(parentWindow);
Execution Count:3
3
79 } -
80 } else {
executed: }
Execution Count:3
3
81 q_createNativeChildrenAndSetParent(childWidget);
executed (the execution status of this line is deduced): q_createNativeChildrenAndSetParent(childWidget);
-
82 }
executed: }
Execution Count:10878
10878
83 } -
84 }
executed: }
Execution Count:10881
10881
85 }
executed: }
Execution Count:18254
18254
86 -
87}
executed: }
Execution Count:12472
12472
88 -
89void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow) -
90{ -
91 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
92 -
93 Q_UNUSED(window);
executed (the execution status of this line is deduced): (void)window;;
-
94 Q_UNUSED(initializeWindow);
executed (the execution status of this line is deduced): (void)initializeWindow;;
-
95 Q_UNUSED(destroyOldWindow);
executed (the execution status of this line is deduced): (void)destroyOldWindow;;
-
96 -
97 Qt::WindowFlags flags = data.window_flags;
executed (the execution status of this line is deduced): Qt::WindowFlags flags = data.window_flags;
-
98 -
99 if (!q->testAttribute(Qt::WA_NativeWindow) && !q->isWindow())
evaluated: !q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
yes
Evaluation Count:7548
yes
Evaluation Count:5
evaluated: !q->isWindow()
TRUEFALSE
yes
Evaluation Count:5955
yes
Evaluation Count:1593
5-7548
100 return; // we only care about real toplevels
executed: return;
Execution Count:5955
5955
101 -
102 QWindow *win = topData()->window;
executed (the execution status of this line is deduced): QWindow *win = topData()->window;
-
103 // topData() ensures the extra is created but does not ensure 'window' is non-null -
104 // in case the extra was already valid. -
105 if (!win) {
evaluated: !win
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1597
1-1597
106 createTLSysExtra();
executed (the execution status of this line is deduced): createTLSysExtra();
-
107 win = topData()->window;
executed (the execution status of this line is deduced): win = topData()->window;
-
108 }
executed: }
Execution Count:1
1
109 -
110 win->setFlags(data.window_flags);
executed (the execution status of this line is deduced): win->setFlags(data.window_flags);
-
111 fixPosIncludesFrame();
executed (the execution status of this line is deduced): fixPosIncludesFrame();
-
112 win->setGeometry(q->geometry());
executed (the execution status of this line is deduced): win->setGeometry(q->geometry());
-
113 win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0));
executed (the execution status of this line is deduced): win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0));
-
114 -
115 if (q->testAttribute(Qt::WA_TranslucentBackground)) {
evaluated: q->testAttribute(Qt::WA_TranslucentBackground)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1595
3-1595
116 QSurfaceFormat format;
executed (the execution status of this line is deduced): QSurfaceFormat format;
-
117 format.setAlphaBufferSize(8);
executed (the execution status of this line is deduced): format.setAlphaBufferSize(8);
-
118 win->setFormat(format);
executed (the execution status of this line is deduced): win->setFormat(format);
-
119 }
executed: }
Execution Count:3
3
120 -
121 if (QWidget *nativeParent = q->nativeParentWidget()) {
evaluated: QWidget *nativeParent = q->nativeParentWidget()
TRUEFALSE
yes
Evaluation Count:90
yes
Evaluation Count:1508
90-1508
122 if (nativeParent->windowHandle()) {
partially evaluated: nativeParent->windowHandle()
TRUEFALSE
yes
Evaluation Count:90
no
Evaluation Count:0
0-90
123 if (flags & Qt::Window) {
evaluated: flags & Qt::Window
TRUEFALSE
yes
Evaluation Count:86
yes
Evaluation Count:4
4-86
124 win->setTransientParent(nativeParent->windowHandle());
executed (the execution status of this line is deduced): win->setTransientParent(nativeParent->windowHandle());
-
125 win->setParent(0);
executed (the execution status of this line is deduced): win->setParent(0);
-
126 } else {
executed: }
Execution Count:86
86
127 win->setTransientParent(0);
executed (the execution status of this line is deduced): win->setTransientParent(0);
-
128 win->setParent(nativeParent->windowHandle());
executed (the execution status of this line is deduced): win->setParent(nativeParent->windowHandle());
-
129 }
executed: }
Execution Count:4
4
130 } -
131 }
executed: }
Execution Count:90
90
132 -
133 qt_window_private(win)->positionPolicy = topData()->posIncludesFrame ?
evaluated: topData()->posIncludesFrame
TRUEFALSE
yes
Evaluation Count:193
yes
Evaluation Count:1405
193-1405
134 QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
executed (the execution status of this line is deduced): QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
-
135 win->create();
executed (the execution status of this line is deduced): win->create();
-
136 -
137 data.window_flags = win->flags();
executed (the execution status of this line is deduced): data.window_flags = win->flags();
-
138 -
139 QBackingStore *store = q->backingStore();
executed (the execution status of this line is deduced): QBackingStore *store = q->backingStore();
-
140 -
141 if (!store) {
evaluated: !store
TRUEFALSE
yes
Evaluation Count:1587
yes
Evaluation Count:7
7-1587
142 if (win && q->windowType() != Qt::Desktop)
partially evaluated: win
TRUEFALSE
yes
Evaluation Count:1587
no
Evaluation Count:0
evaluated: q->windowType() != Qt::Desktop
TRUEFALSE
yes
Evaluation Count:1482
yes
Evaluation Count:105
0-1587
143 q->setBackingStore(new QBackingStore(win));
executed: q->setBackingStore(new QBackingStore(win));
Execution Count:1482
1482
144 else -
145 q->setAttribute(Qt::WA_PaintOnScreen, true);
executed: q->setAttribute(Qt::WA_PaintOnScreen, true);
Execution Count:105
105
146 } -
147 -
148 setWindowModified_helper();
executed (the execution status of this line is deduced): setWindowModified_helper();
-
149 setWinId(win->winId());
executed (the execution status of this line is deduced): setWinId(win->winId());
-
150 -
151 // Check children and create windows for them if necessary -
152 q_createNativeChildrenAndSetParent(q);
executed (the execution status of this line is deduced): q_createNativeChildrenAndSetParent(q);
-
153 -
154 if (extra && !extra->mask.isEmpty())
partially evaluated: extra
TRUEFALSE
yes
Evaluation Count:1594
no
Evaluation Count:0
evaluated: !extra->mask.isEmpty()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:1590
0-1594
155 setMask_sys(extra->mask);
executed: setMask_sys(extra->mask);
Execution Count:4
4
156 -
157 // If widget is already shown, set window visible, too -
158 if (q->isVisible())
partially evaluated: q->isVisible()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1594
0-1594
159 win->setVisible(true);
never executed: win->setVisible(true);
0
160}
executed: }
Execution Count:1594
1594
161 -
162void QWidget::destroy(bool destroyWindow, bool destroySubWindows) -
163{ -
164 Q_D(QWidget);
executed (the execution status of this line is deduced): QWidgetPrivate * const d = d_func();
-
165 -
166 d->aboutToDestroy();
executed (the execution status of this line is deduced): d->aboutToDestroy();
-
167 if (!isWindow() && parentWidget())
evaluated: !isWindow()
TRUEFALSE
yes
Evaluation Count:25605
yes
Evaluation Count:6497
partially evaluated: parentWidget()
TRUEFALSE
yes
Evaluation Count:25605
no
Evaluation Count:0
0-25605
168 parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
executed: parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
Execution Count:25605
25605
169 d->deactivateWidgetCleanup();
executed (the execution status of this line is deduced): d->deactivateWidgetCleanup();
-
170 -
171 if ((windowType() == Qt::Popup))
evaluated: (windowType() == Qt::Popup)
TRUEFALSE
yes
Evaluation Count:553
yes
Evaluation Count:31549
553-31549
172 qApp->d_func()->closePopup(this);
executed: (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->closePopup(this);
Execution Count:553
553
173 -
174 if (this == QApplicationPrivate::active_window)
partially evaluated: this == QApplicationPrivate::active_window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32102
0-32102
175 QApplication::setActiveWindow(0);
never executed: QApplication::setActiveWindow(0);
0
176 if (QWidget::mouseGrabber() == this)
partially evaluated: QWidget::mouseGrabber() == this
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32102
0-32102
177 releaseMouse();
never executed: releaseMouse();
0
178 if (QWidget::keyboardGrabber() == this)
evaluated: QWidget::keyboardGrabber() == this
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:32101
1-32101
179 releaseKeyboard();
executed: releaseKeyboard();
Execution Count:1
1
180 -
181 setAttribute(Qt::WA_WState_Created, false);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_WState_Created, false);
-
182 -
183 if (windowType() != Qt::Desktop) {
evaluated: windowType() != Qt::Desktop
TRUEFALSE
yes
Evaluation Count:31753
yes
Evaluation Count:349
349-31753
184 if (destroySubWindows) {
partially evaluated: destroySubWindows
TRUEFALSE
yes
Evaluation Count:31753
no
Evaluation Count:0
0-31753
185 QObjectList childList(children());
executed (the execution status of this line is deduced): QObjectList childList(children());
-
186 for (int i = 0; i < childList.size(); i++) {
evaluated: i < childList.size()
TRUEFALSE
yes
Evaluation Count:4314
yes
Evaluation Count:31753
4314-31753
187 QWidget *widget = qobject_cast<QWidget *>(childList.at(i));
executed (the execution status of this line is deduced): QWidget *widget = qobject_cast<QWidget *>(childList.at(i));
-
188 if (widget && widget->testAttribute(Qt::WA_NativeWindow)) {
evaluated: widget
TRUEFALSE
yes
Evaluation Count:2855
yes
Evaluation Count:1459
partially evaluated: widget->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2855
0-2855
189 if (widget->windowHandle()) {
never evaluated: widget->windowHandle()
0
190 widget->destroy();
never executed (the execution status of this line is deduced): widget->destroy();
-
191 }
never executed: }
0
192 }
never executed: }
0
193 }
executed: }
Execution Count:4314
4314
194 }
executed: }
Execution Count:31753
31753
195 if (destroyWindow) {
partially evaluated: destroyWindow
TRUEFALSE
yes
Evaluation Count:31753
no
Evaluation Count:0
0-31753
196 d->deleteTLSysExtra();
executed (the execution status of this line is deduced): d->deleteTLSysExtra();
-
197 } else {
executed: }
Execution Count:31753
31753
198 if (parentWidget() && parentWidget()->testAttribute(Qt::WA_WState_Created)) {
never evaluated: parentWidget()
never evaluated: parentWidget()->testAttribute(Qt::WA_WState_Created)
0
199 d->hide_sys();
never executed (the execution status of this line is deduced): d->hide_sys();
-
200 }
never executed: }
0
201 }
never executed: }
0
202 -
203 d->setWinId(0);
executed (the execution status of this line is deduced): d->setWinId(0);
-
204 }
executed: }
Execution Count:31753
31753
205}
executed: }
Execution Count:32102
32102
206 -
207void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) -
208{ -
209 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
210 -
211 Qt::WindowFlags oldFlags = data.window_flags;
executed (the execution status of this line is deduced): Qt::WindowFlags oldFlags = data.window_flags;
-
212 bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
executed (the execution status of this line is deduced): bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
-
213 -
214 int targetScreen = -1;
executed (the execution status of this line is deduced): int targetScreen = -1;
-
215 // Handle a request to move the widget to a particular screen -
216 if (newparent && newparent->windowType() == Qt::Desktop) {
evaluated: newparent
TRUEFALSE
yes
Evaluation Count:30397
yes
Evaluation Count:428
partially evaluated: newparent->windowType() == Qt::Desktop
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:30397
0-30397
217 // make sure the widget is created on the same screen as the -
218 // programmer specified desktop widget -
219 -
220 // get the desktop's screen number -
221 targetScreen = newparent->window()->d_func()->topData()->screenIndex;
never executed (the execution status of this line is deduced): targetScreen = newparent->window()->d_func()->topData()->screenIndex;
-
222 newparent = 0;
never executed (the execution status of this line is deduced): newparent = 0;
-
223 }
never executed: }
0
224 -
225 setWinId(0);
executed (the execution status of this line is deduced): setWinId(0);
-
226 -
227 if (parent != newparent) {
evaluated: parent != newparent
TRUEFALSE
yes
Evaluation Count:30468
yes
Evaluation Count:357
357-30468
228 QObjectPrivate::setParent_helper(newparent); //### why does this have to be done in the _sys function???
executed (the execution status of this line is deduced): QObjectPrivate::setParent_helper(newparent);
-
229 if (q->windowHandle()) {
evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:30437
31-30437
230 q->windowHandle()->setFlags(f);
executed (the execution status of this line is deduced): q->windowHandle()->setFlags(f);
-
231 QWidget *parentWithWindow =
executed (the execution status of this line is deduced): QWidget *parentWithWindow =
-
232 newparent ? (newparent->windowHandle() ? newparent : newparent->nativeParentWidget()) : 0;
evaluated: newparent
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1
1-30
233 if (parentWithWindow) {
evaluated: parentWithWindow
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:4
4-27
234 if (f & Qt::Window) {
evaluated: f & Qt::Window
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:22
5-22
235 q->windowHandle()->setTransientParent(parentWithWindow->windowHandle());
executed (the execution status of this line is deduced): q->windowHandle()->setTransientParent(parentWithWindow->windowHandle());
-
236 q->windowHandle()->setParent(0);
executed (the execution status of this line is deduced): q->windowHandle()->setParent(0);
-
237 } else {
executed: }
Execution Count:5
5
238 q->windowHandle()->setTransientParent(0);
executed (the execution status of this line is deduced): q->windowHandle()->setTransientParent(0);
-
239 q->windowHandle()->setParent(parentWithWindow->windowHandle());
executed (the execution status of this line is deduced): q->windowHandle()->setParent(parentWithWindow->windowHandle());
-
240 }
executed: }
Execution Count:22
22
241 } else { -
242 q->windowHandle()->setTransientParent(0);
executed (the execution status of this line is deduced): q->windowHandle()->setTransientParent(0);
-
243 q->windowHandle()->setParent(0);
executed (the execution status of this line is deduced): q->windowHandle()->setParent(0);
-
244 }
executed: }
Execution Count:4
4
245 } -
246 }
executed: }
Execution Count:30468
30468
247 -
248 if (!newparent) {
evaluated: !newparent
TRUEFALSE
yes
Evaluation Count:428
yes
Evaluation Count:30397
428-30397
249 f |= Qt::Window;
executed (the execution status of this line is deduced): f |= Qt::Window;
-
250 if (targetScreen == -1) {
partially evaluated: targetScreen == -1
TRUEFALSE
yes
Evaluation Count:428
no
Evaluation Count:0
0-428
251 if (parent)
partially evaluated: parent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:428
0-428
252 targetScreen = q->parentWidget()->window()->d_func()->topData()->screenIndex;
never executed: targetScreen = q->parentWidget()->window()->d_func()->topData()->screenIndex;
0
253 }
executed: }
Execution Count:428
428
254 }
executed: }
Execution Count:428
428
255 -
256 bool explicitlyHidden = q->testAttribute(Qt::WA_WState_Hidden) && q->testAttribute(Qt::WA_WState_ExplicitShowHide);
evaluated: q->testAttribute(Qt::WA_WState_Hidden)
TRUEFALSE
yes
Evaluation Count:30612
yes
Evaluation Count:213
evaluated: q->testAttribute(Qt::WA_WState_ExplicitShowHide)
TRUEFALSE
yes
Evaluation Count:180
yes
Evaluation Count:30432
180-30612
257 -
258 // Reparenting toplevel to child -
259 if (!(f&Qt::Window) && (oldFlags&Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) {
evaluated: !(f&Qt::Window)
TRUEFALSE
yes
Evaluation Count:29810
yes
Evaluation Count:1015
evaluated: (oldFlags&Qt::Window)
TRUEFALSE
yes
Evaluation Count:2262
yes
Evaluation Count:27548
partially evaluated: !q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
yes
Evaluation Count:2262
no
Evaluation Count:0
0-29810
260 //qDebug() << "setParent_sys() change from toplevel"; -
261 q->destroy();
executed (the execution status of this line is deduced): q->destroy();
-
262 }
executed: }
Execution Count:2262
2262
263 -
264 adjustFlags(f, q);
executed (the execution status of this line is deduced): adjustFlags(f, q);
-
265 data.window_flags = f;
executed (the execution status of this line is deduced): data.window_flags = f;
-
266 q->setAttribute(Qt::WA_WState_Created, false);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_WState_Created, false);
-
267 q->setAttribute(Qt::WA_WState_Visible, false);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_WState_Visible, false);
-
268 q->setAttribute(Qt::WA_WState_Hidden, false);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_WState_Hidden, false);
-
269 -
270 if (newparent && wasCreated && (q->testAttribute(Qt::WA_NativeWindow) || (f & Qt::Window)))
evaluated: newparent
TRUEFALSE
yes
Evaluation Count:30397
yes
Evaluation Count:428
evaluated: wasCreated
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:30377
partially evaluated: q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:20
evaluated: (f & Qt::Window)
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:7
0-30397
271 q->createWinId();
executed: q->createWinId();
Execution Count:13
13
272 -
273 if (q->isWindow() || (!newparent || newparent->isVisible()) || explicitlyHidden)
evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:1015
yes
Evaluation Count:29810
partially evaluated: !newparent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:29810
evaluated: newparent->isVisible()
TRUEFALSE
yes
Evaluation Count:397
yes
Evaluation Count:29413
evaluated: explicitlyHidden
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:29400
0-29810
274 q->setAttribute(Qt::WA_WState_Hidden);
executed: q->setAttribute(Qt::WA_WState_Hidden);
Execution Count:1425
1425
275 q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden);
-
276 -
277 // move the window to the selected screen -
278 if (!newparent && targetScreen != -1) {
evaluated: !newparent
TRUEFALSE
yes
Evaluation Count:428
yes
Evaluation Count:30397
partially evaluated: targetScreen != -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:428
0-30397
279 if (maybeTopData())
never evaluated: maybeTopData()
0
280 maybeTopData()->screenIndex = targetScreen;
never executed: maybeTopData()->screenIndex = targetScreen;
0
281 // only if it is already created -
282 if (q->testAttribute(Qt::WA_WState_Created)) {
never evaluated: q->testAttribute(Qt::WA_WState_Created)
0
283 q->windowHandle()->setScreen(QGuiApplication::screens().value(targetScreen, 0));
never executed (the execution status of this line is deduced): q->windowHandle()->setScreen(QGuiApplication::screens().value(targetScreen, 0));
-
284 }
never executed: }
0
285 }
never executed: }
0
286}
executed: }
Execution Count:30825
30825
287 -
288QPoint QWidget::mapToGlobal(const QPoint &pos) const -
289{ -
290 int x = pos.x(), y = pos.y();
executed (the execution status of this line is deduced): int x = pos.x(), y = pos.y();
-
291 const QWidget *w = this;
executed (the execution status of this line is deduced): const QWidget *w = this;
-
292 while (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:27485
yes
Evaluation Count:137
137-27485
293 QWindow *window = w->windowHandle();
executed (the execution status of this line is deduced): QWindow *window = w->windowHandle();
-
294 if (window && window->handle())
evaluated: window
TRUEFALSE
yes
Evaluation Count:13543
yes
Evaluation Count:13942
partially evaluated: window->handle()
TRUEFALSE
yes
Evaluation Count:13543
no
Evaluation Count:0
0-13942
295 return window->mapToGlobal(QPoint(x, y));
executed: return window->mapToGlobal(QPoint(x, y));
Execution Count:13543
13543
296 -
297 x += w->data->crect.x();
executed (the execution status of this line is deduced): x += w->data->crect.x();
-
298 y += w->data->crect.y();
executed (the execution status of this line is deduced): y += w->data->crect.y();
-
299 w = w->isWindow() ? 0 : w->parentWidget();
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:137
yes
Evaluation Count:13805
137-13805
300 }
executed: }
Execution Count:13942
13942
301 return QPoint(x, y);
executed: return QPoint(x, y);
Execution Count:137
137
302} -
303 -
304QPoint QWidget::mapFromGlobal(const QPoint &pos) const -
305{ -
306 int x = pos.x(), y = pos.y();
executed (the execution status of this line is deduced): int x = pos.x(), y = pos.y();
-
307 const QWidget *w = this;
executed (the execution status of this line is deduced): const QWidget *w = this;
-
308 while (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:8586
yes
Evaluation Count:41
41-8586
309 QWindow *window = w->windowHandle();
executed (the execution status of this line is deduced): QWindow *window = w->windowHandle();
-
310 if (window && window->handle())
evaluated: window
TRUEFALSE
yes
Evaluation Count:4705
yes
Evaluation Count:3881
evaluated: window->handle()
TRUEFALSE
yes
Evaluation Count:4684
yes
Evaluation Count:21
21-4705
311 return window->mapFromGlobal(QPoint(x, y));
executed: return window->mapFromGlobal(QPoint(x, y));
Execution Count:4684
4684
312 -
313 x -= w->data->crect.x();
executed (the execution status of this line is deduced): x -= w->data->crect.x();
-
314 y -= w->data->crect.y();
executed (the execution status of this line is deduced): y -= w->data->crect.y();
-
315 w = w->isWindow() ? 0 : w->parentWidget();
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:41
yes
Evaluation Count:3861
41-3861
316 }
executed: }
Execution Count:3902
3902
317 return QPoint(x, y);
executed: return QPoint(x, y);
Execution Count:41
41
318} -
319 -
320void QWidgetPrivate::updateSystemBackground() {} -
321 -
322#ifndef QT_NO_CURSOR -
323void QWidgetPrivate::setCursor_sys(const QCursor &cursor) -
324{ -
325 Q_UNUSED(cursor);
executed (the execution status of this line is deduced): (void)cursor;;
-
326 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
327 qt_qpa_set_cursor(q, false);
executed (the execution status of this line is deduced): qt_qpa_set_cursor(q, false);
-
328}
executed: }
Execution Count:1905
1905
329 -
330void QWidgetPrivate::unsetCursor_sys() -
331{ -
332 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
333 qt_qpa_set_cursor(q, false);
executed (the execution status of this line is deduced): qt_qpa_set_cursor(q, false);
-
334}
executed: }
Execution Count:57
57
335 -
336#endif //QT_NO_CURSOR -
337 -
338void QWidgetPrivate::setWindowTitle_sys(const QString &caption) -
339{ -
340 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
341 if (!q->isWindow())
evaluated: !q->isWindow()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:1971
8-1971
342 return;
executed: return;
Execution Count:8
8
343 -
344 if (QWindow *window = q->windowHandle())
partially evaluated: QWindow *window = q->windowHandle()
TRUEFALSE
yes
Evaluation Count:1971
no
Evaluation Count:0
0-1971
345 window->setTitle(caption);
executed: window->setTitle(caption);
Execution Count:1971
1971
346 -
347}
executed: }
Execution Count:1971
1971
348 -
349void QWidgetPrivate::setWindowFilePath_sys(const QString &filePath) -
350{ -
351 Q_Q(QWidget);
never executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
352 if (!q->isWindow())
never evaluated: !q->isWindow()
0
353 return;
never executed: return;
0
354 -
355 if (QWindow *window = q->windowHandle())
never evaluated: QWindow *window = q->windowHandle()
0
356 window->setFilePath(filePath);
never executed: window->setFilePath(filePath);
0
357}
never executed: }
0
358 -
359void QWidgetPrivate::setWindowIcon_sys() -
360{ -
361 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
362 if (QWindow *window = q->windowHandle())
partially evaluated: QWindow *window = q->windowHandle()
TRUEFALSE
yes
Evaluation Count:1609
no
Evaluation Count:0
0-1609
363 window->setIcon(q->windowIcon());
executed: window->setIcon(q->windowIcon());
Execution Count:1609
1609
364}
executed: }
Execution Count:1609
1609
365 -
366void QWidgetPrivate::setWindowIconText_sys(const QString &iconText) -
367{ -
368 Q_UNUSED(iconText);
executed (the execution status of this line is deduced): (void)iconText;;
-
369}
executed: }
Execution Count:1776
1776
370 -
371QWidget *qt_pressGrab = 0; -
372QWidget *qt_mouseGrb = 0; -
373static QWidget *keyboardGrb = 0; -
374 -
375static inline QWindow *grabberWindow(const QWidget *w) -
376{ -
377 QWindow *window = w->windowHandle();
executed (the execution status of this line is deduced): QWindow *window = w->windowHandle();
-
378 if (!window)
evaluated: !window
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:287
4-287
379 if (const QWidget *nativeParent = w->nativeParentWidget())
partially evaluated: const QWidget *nativeParent = w->nativeParentWidget()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
380 window = nativeParent->windowHandle();
executed: window = nativeParent->windowHandle();
Execution Count:4
4
381 return window;
executed: return window;
Execution Count:291
291
382} -
383 -
384void QWidget::grabMouse() -
385{ -
386 if (qt_mouseGrb)
partially evaluated: qt_mouseGrb
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
387 qt_mouseGrb->releaseMouse();
never executed: qt_mouseGrb->releaseMouse();
0
388 -
389 if (QWindow *window = grabberWindow(this))
partially evaluated: QWindow *window = grabberWindow(this)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
390 window->setMouseGrabEnabled(true);
executed: window->setMouseGrabEnabled(true);
Execution Count:2
2
391 -
392 qt_mouseGrb = this;
executed (the execution status of this line is deduced): qt_mouseGrb = this;
-
393 qt_pressGrab = 0;
executed (the execution status of this line is deduced): qt_pressGrab = 0;
-
394}
executed: }
Execution Count:2
2
395 -
396#ifndef QT_NO_CURSOR -
397void QWidget::grabMouse(const QCursor &cursor) -
398{ -
399 Q_UNUSED(cursor);
never executed (the execution status of this line is deduced): (void)cursor;;
-
400 grabMouse();
never executed (the execution status of this line is deduced): grabMouse();
-
401}
never executed: }
0
402#endif -
403 -
404bool QWidgetPrivate::stealMouseGrab(bool grab) -
405{ -
406 // This is like a combination of grab/releaseMouse() but with error checking -
407 // and it has no effect on the result of mouseGrabber(). -
408 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
409 QWindow *window = grabberWindow(q);
executed (the execution status of this line is deduced): QWindow *window = grabberWindow(q);
-
410 return window ? window->setMouseGrabEnabled(grab) : false;
executed: return window ? window->setMouseGrabEnabled(grab) : false;
Execution Count:142
142
411} -
412 -
413void QWidget::releaseMouse() -
414{ -
415 if (qt_mouseGrb == this) {
partially evaluated: qt_mouseGrb == this
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
416 if (QWindow *window = grabberWindow(this))
partially evaluated: QWindow *window = grabberWindow(this)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
417 window->setMouseGrabEnabled(false);
executed: window->setMouseGrabEnabled(false);
Execution Count:2
2
418 qt_mouseGrb = 0;
executed (the execution status of this line is deduced): qt_mouseGrb = 0;
-
419 }
executed: }
Execution Count:2
2
420}
executed: }
Execution Count:2
2
421 -
422void QWidget::grabKeyboard() -
423{ -
424 if (keyboardGrb)
partially evaluated: keyboardGrb
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
425 keyboardGrb->releaseKeyboard();
never executed: keyboardGrb->releaseKeyboard();
0
426 if (QWindow *window = grabberWindow(this))
partially evaluated: QWindow *window = grabberWindow(this)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
427 window->setKeyboardGrabEnabled(true);
executed: window->setKeyboardGrabEnabled(true);
Execution Count:1
1
428 keyboardGrb = this;
executed (the execution status of this line is deduced): keyboardGrb = this;
-
429}
executed: }
Execution Count:1
1
430 -
431bool QWidgetPrivate::stealKeyboardGrab(bool grab) -
432{ -
433 // This is like a combination of grab/releaseKeyboard() but with error -
434 // checking and it has no effect on the result of keyboardGrabber(). -
435 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
436 QWindow *window = grabberWindow(q);
executed (the execution status of this line is deduced): QWindow *window = grabberWindow(q);
-
437 return window ? window->setKeyboardGrabEnabled(grab) : false;
executed: return window ? window->setKeyboardGrabEnabled(grab) : false;
Execution Count:143
143
438} -
439 -
440void QWidget::releaseKeyboard() -
441{ -
442 if (keyboardGrb == this) {
partially evaluated: keyboardGrb == this
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
443 if (QWindow *window = grabberWindow(this))
partially evaluated: QWindow *window = grabberWindow(this)
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
444 window->setKeyboardGrabEnabled(false);
executed: window->setKeyboardGrabEnabled(false);
Execution Count:1
1
445 keyboardGrb = 0;
executed (the execution status of this line is deduced): keyboardGrb = 0;
-
446 }
executed: }
Execution Count:1
1
447}
executed: }
Execution Count:1
1
448 -
449QWidget *QWidget::mouseGrabber() -
450{ -
451 if (qt_mouseGrb)
partially evaluated: qt_mouseGrb
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:33995
0-33995
452 return qt_mouseGrb;
never executed: return qt_mouseGrb;
0
453 return qt_pressGrab;
executed: return qt_pressGrab;
Execution Count:33995
33995
454} -
455 -
456QWidget *QWidget::keyboardGrabber() -
457{ -
458 return keyboardGrb;
executed: return keyboardGrb;
Execution Count:32253
32253
459} -
460 -
461void QWidget::activateWindow() -
462{ -
463 QWindow *const wnd = window()->windowHandle();
executed (the execution status of this line is deduced): QWindow *const wnd = window()->windowHandle();
-
464 -
465 if (wnd)
partially evaluated: wnd
TRUEFALSE
yes
Evaluation Count:123
no
Evaluation Count:0
0-123
466 wnd->requestActivate();
executed: wnd->requestActivate();
Execution Count:123
123
467}
executed: }
Execution Count:123
123
468 -
469// Position top level windows at the center, avoid showing -
470// Windows at the default 0,0 position excluding the frame. -
471static inline QRect positionTopLevelWindow(QRect geometry, const QScreen *screen) -
472{ -
473 if (screen && geometry.x() == 0 && geometry.y() == 0) {
partially evaluated: screen
TRUEFALSE
yes
Evaluation Count:1450
no
Evaluation Count:0
evaluated: geometry.x() == 0
TRUEFALSE
yes
Evaluation Count:1221
yes
Evaluation Count:229
partially evaluated: geometry.y() == 0
TRUEFALSE
yes
Evaluation Count:1221
no
Evaluation Count:0
0-1450
474 const QRect availableGeometry = screen->availableGeometry();
executed (the execution status of this line is deduced): const QRect availableGeometry = screen->availableGeometry();
-
475 if (availableGeometry.width() > geometry.width()
evaluated: availableGeometry.width() > geometry.width()
TRUEFALSE
yes
Evaluation Count:1214
yes
Evaluation Count:7
7-1214
476 && availableGeometry.height() > geometry.height())
evaluated: availableGeometry.height() > geometry.height()
TRUEFALSE
yes
Evaluation Count:1212
yes
Evaluation Count:2
2-1212
477 geometry.moveCenter(availableGeometry.center());
executed: geometry.moveCenter(availableGeometry.center());
Execution Count:1212
1212
478 }
executed: }
Execution Count:1221
1221
479 return geometry;
executed: return geometry;
Execution Count:1450
1450
480} -
481 -
482// move() was invoked with Qt::WA_WState_Created not set (frame geometry -
483// unknown), that is, crect has a position including the frame. -
484// If we can determine the frame strut, fix that and clear the flag. -
485void QWidgetPrivate::fixPosIncludesFrame() -
486{ -
487 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
488 if (QTLWExtra *te = maybeTopData()) {
evaluated: QTLWExtra *te = maybeTopData()
TRUEFALSE
yes
Evaluation Count:5182
yes
Evaluation Count:515
515-5182
489 if (te->posIncludesFrame) {
evaluated: te->posIncludesFrame
TRUEFALSE
yes
Evaluation Count:568
yes
Evaluation Count:4614
568-4614
490 // For Qt::WA_DontShowOnScreen, assume a frame of 0 (for -
491 // example, in QGraphicsProxyWidget). -
492 if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
partially evaluated: q->testAttribute(Qt::WA_DontShowOnScreen)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:568
0-568
493 te->posIncludesFrame = 0;
never executed (the execution status of this line is deduced): te->posIncludesFrame = 0;
-
494 } else {
never executed: }
0
495 if (q->windowHandle()) {
partially evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:568
no
Evaluation Count:0
0-568
496 updateFrameStrut();
executed (the execution status of this line is deduced): updateFrameStrut();
-
497 if (!q->data->fstrut_dirty) {
partially evaluated: !q->data->fstrut_dirty
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:568
0-568
498 data.crect.translate(te->frameStrut.x(), te->frameStrut.y());
never executed (the execution status of this line is deduced): data.crect.translate(te->frameStrut.x(), te->frameStrut.y());
-
499 te->posIncludesFrame = 0;
never executed (the execution status of this line is deduced): te->posIncludesFrame = 0;
-
500 }
never executed: }
0
501 } // windowHandle()
executed: }
Execution Count:568
568
502 } // !WA_DontShowOnScreen
executed: }
Execution Count:568
568
503 } // posIncludesFrame -
504 } // QTLWExtra
executed: }
Execution Count:5182
5182
505}
executed: }
Execution Count:5697
5697
506 -
507void QWidgetPrivate::show_sys() -
508{ -
509 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
510 -
511 QWindow *window = q->windowHandle();
executed (the execution status of this line is deduced): QWindow *window = q->windowHandle();
-
512 -
513 if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
evaluated: q->testAttribute(Qt::WA_DontShowOnScreen)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:10803
3-10803
514 invalidateBuffer(q->rect());
executed (the execution status of this line is deduced): invalidateBuffer(q->rect());
-
515 q->setAttribute(Qt::WA_Mapped);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_Mapped);
-
516 if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
partially evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
partially evaluated: q->windowModality() != Qt::NonModal
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
never evaluated: window
0-3
517 // add our window to the modal window list -
518 QGuiApplicationPrivate::showModalWindow(window);
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::showModalWindow(window);
-
519 }
never executed: }
0
520 return;
executed: return;
Execution Count:3
3
521 } -
522 -
523 QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
executed (the execution status of this line is deduced): QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
-
524 -
525 if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow))
evaluated: !q->isWindow()
TRUEFALSE
yes
Evaluation Count:9256
yes
Evaluation Count:1547
evaluated: !q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
yes
Evaluation Count:9252
yes
Evaluation Count:4
4-9256
526 return;
executed: return;
Execution Count:9252
9252
527 -
528 if (window) {
partially evaluated: window
TRUEFALSE
yes
Evaluation Count:1551
no
Evaluation Count:0
0-1551
529 if (q->isWindow())
evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:1547
yes
Evaluation Count:4
4-1547
530 fixPosIncludesFrame();
executed: fixPosIncludesFrame();
Execution Count:1547
1547
531 QRect geomRect = q->geometry();
executed (the execution status of this line is deduced): QRect geomRect = q->geometry();
-
532 if (q->isWindow()) {
evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:1547
yes
Evaluation Count:4
4-1547
533 if (!q->testAttribute(Qt::WA_Moved))
evaluated: !q->testAttribute(Qt::WA_Moved)
TRUEFALSE
yes
Evaluation Count:1450
yes
Evaluation Count:97
97-1450
534 geomRect = positionTopLevelWindow(geomRect, window->screen());
executed: geomRect = positionTopLevelWindow(geomRect, window->screen());
Execution Count:1450
1450
535 } else {
executed: }
Execution Count:1547
1547
536 QPoint topLeftOfWindow = q->mapTo(q->nativeParentWidget(),QPoint());
executed (the execution status of this line is deduced): QPoint topLeftOfWindow = q->mapTo(q->nativeParentWidget(),QPoint());
-
537 geomRect.moveTopLeft(topLeftOfWindow);
executed (the execution status of this line is deduced): geomRect.moveTopLeft(topLeftOfWindow);
-
538 }
executed: }
Execution Count:4
4
539 const QRect windowRect = window->geometry();
executed (the execution status of this line is deduced): const QRect windowRect = window->geometry();
-
540 if (windowRect != geomRect) {
evaluated: windowRect != geomRect
TRUEFALSE
yes
Evaluation Count:1222
yes
Evaluation Count:329
329-1222
541 window->setGeometry(geomRect);
executed (the execution status of this line is deduced): window->setGeometry(geomRect);
-
542 }
executed: }
Execution Count:1222
1222
543 -
544 if (QBackingStore *store = q->backingStore()) {
partially evaluated: QBackingStore *store = q->backingStore()
TRUEFALSE
yes
Evaluation Count:1551
no
Evaluation Count:0
0-1551
545 if (store->size() != geomRect.size()) {
evaluated: store->size() != geomRect.size()
TRUEFALSE
yes
Evaluation Count:1439
yes
Evaluation Count:112
112-1439
546 store->resize(geomRect.size());
executed (the execution status of this line is deduced): store->resize(geomRect.size());
-
547 }
executed: }
Execution Count:1439
1439
548 }
executed: }
Execution Count:1551
1551
549 -
550#ifndef QT_NO_CURSOR -
551 qt_qpa_set_cursor(q, false); // Needed in case cursor was set before show
executed (the execution status of this line is deduced): qt_qpa_set_cursor(q, false);
-
552#endif -
553 invalidateBuffer(q->rect());
executed (the execution status of this line is deduced): invalidateBuffer(q->rect());
-
554 window->setVisible(true);
executed (the execution status of this line is deduced): window->setVisible(true);
-
555 }
executed: }
Execution Count:1551
1551
556}
executed: }
Execution Count:1551
1551
557 -
558 -
559void QWidgetPrivate::hide_sys() -
560{ -
561 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
562 -
563 QWindow *window = q->windowHandle();
executed (the execution status of this line is deduced): QWindow *window = q->windowHandle();
-
564 -
565 if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
partially evaluated: q->testAttribute(Qt::WA_DontShowOnScreen)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2733
0-2733
566 q->setAttribute(Qt::WA_Mapped, false);
never executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_Mapped, false);
-
567 if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
never evaluated: q->isWindow()
never evaluated: q->windowModality() != Qt::NonModal
never evaluated: window
0
568 // remove our window from the modal window list -
569 QGuiApplicationPrivate::hideModalWindow(window);
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::hideModalWindow(window);
-
570 }
never executed: }
0
571 // do not return here, if window non-zero, we must hide it -
572 }
never executed: }
0
573 -
574 deactivateWidgetCleanup();
executed (the execution status of this line is deduced): deactivateWidgetCleanup();
-
575 -
576 if (!q->isWindow()) {
evaluated: !q->isWindow()
TRUEFALSE
yes
Evaluation Count:1248
yes
Evaluation Count:1485
1248-1485
577 QWidget *p = q->parentWidget();
executed (the execution status of this line is deduced): QWidget *p = q->parentWidget();
-
578 if (p &&p->isVisible()) {
partially evaluated: p
TRUEFALSE
yes
Evaluation Count:1248
no
Evaluation Count:0
evaluated: p->isVisible()
TRUEFALSE
yes
Evaluation Count:901
yes
Evaluation Count:347
0-1248
579 invalidateBuffer(q->rect());
executed (the execution status of this line is deduced): invalidateBuffer(q->rect());
-
580 }
executed: }
Execution Count:901
901
581 } else {
executed: }
Execution Count:1248
1248
582 invalidateBuffer(q->rect());
executed (the execution status of this line is deduced): invalidateBuffer(q->rect());
-
583 }
executed: }
Execution Count:1485
1485
584 -
585 if (window)
evaluated: window
TRUEFALSE
yes
Evaluation Count:1485
yes
Evaluation Count:1248
1248-1485
586 window->setVisible(false);
executed: window->setVisible(false);
Execution Count:1485
1485
587}
executed: }
Execution Count:2733
2733
588 -
589Qt::WindowState effectiveState(Qt::WindowStates state) -
590 { -
591 if (state & Qt::WindowMinimized)
evaluated: state & Qt::WindowMinimized
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:304
54-304
592 return Qt::WindowMinimized;
executed: return Qt::WindowMinimized;
Execution Count:54
54
593 else if (state & Qt::WindowFullScreen)
evaluated: state & Qt::WindowFullScreen
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:295
9-295
594 return Qt::WindowFullScreen;
executed: return Qt::WindowFullScreen;
Execution Count:9
9
595 else if (state & Qt::WindowMaximized)
evaluated: state & Qt::WindowMaximized
TRUEFALSE
yes
Evaluation Count:120
yes
Evaluation Count:175
120-175
596 return Qt::WindowMaximized;
executed: return Qt::WindowMaximized;
Execution Count:120
120
597 return Qt::WindowNoState;
executed: return Qt::WindowNoState;
Execution Count:175
175
598 } -
599 -
600void QWidget::setWindowState(Qt::WindowStates newstate) -
601{ -
602 Q_D(QWidget);
executed (the execution status of this line is deduced): QWidgetPrivate * const d = d_func();
-
603 Qt::WindowStates oldstate = windowState();
executed (the execution status of this line is deduced): Qt::WindowStates oldstate = windowState();
-
604 if (oldstate == newstate)
evaluated: oldstate == newstate
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:176
14-176
605 return;
executed: return;
Execution Count:14
14
606 if (isWindow() && !testAttribute(Qt::WA_WState_Created))
evaluated: isWindow()
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:147
evaluated: !testAttribute(Qt::WA_WState_Created)
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:20
9-147
607 create();
executed: create();
Execution Count:9
9
608 -
609 data->window_state = newstate;
executed (the execution status of this line is deduced): data->window_state = newstate;
-
610 data->in_set_window_state = 1;
executed (the execution status of this line is deduced): data->in_set_window_state = 1;
-
611 Qt::WindowState newEffectiveState = effectiveState(newstate);
executed (the execution status of this line is deduced): Qt::WindowState newEffectiveState = effectiveState(newstate);
-
612 Qt::WindowState oldEffectiveState = effectiveState(oldstate);
executed (the execution status of this line is deduced): Qt::WindowState oldEffectiveState = effectiveState(oldstate);
-
613 if (isWindow() && newEffectiveState != oldEffectiveState) {
evaluated: isWindow()
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:147
partially evaluated: newEffectiveState != oldEffectiveState
TRUEFALSE
yes
Evaluation Count:29
no
Evaluation Count:0
0-147
614 // Ensure the initial size is valid, since we store it as normalGeometry below. -
615 if (!testAttribute(Qt::WA_Resized) && !isVisible())
evaluated: !testAttribute(Qt::WA_Resized)
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:12
evaluated: !isVisible()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:10
7-17
616 adjustSize();
executed: adjustSize();
Execution Count:7
7
617 -
618 d->createTLExtra();
executed (the execution status of this line is deduced): d->createTLExtra();
-
619 if (oldEffectiveState == Qt::WindowNoState)
evaluated: oldEffectiveState == Qt::WindowNoState
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:11
11-18
620 d->topData()->normalGeometry = geometry();
executed: d->topData()->normalGeometry = geometry();
Execution Count:18
18
621 -
622 Q_ASSERT(windowHandle());
executed (the execution status of this line is deduced): qt_noop();
-
623 windowHandle()->setWindowState(newEffectiveState);
executed (the execution status of this line is deduced): windowHandle()->setWindowState(newEffectiveState);
-
624 }
executed: }
Execution Count:29
29
625 data->in_set_window_state = 0;
executed (the execution status of this line is deduced): data->in_set_window_state = 0;
-
626 -
627 if (newstate & Qt::WindowActive)
evaluated: newstate & Qt::WindowActive
TRUEFALSE
yes
Evaluation Count:83
yes
Evaluation Count:93
83-93
628 activateWindow();
executed: activateWindow();
Execution Count:83
83
629 -
630 QWindowStateChangeEvent e(oldstate);
executed (the execution status of this line is deduced): QWindowStateChangeEvent e(oldstate);
-
631 QApplication::sendEvent(this, &e);
executed (the execution status of this line is deduced): QApplication::sendEvent(this, &e);
-
632}
executed: }
Execution Count:176
176
633 -
634void QWidgetPrivate::setFocus_sys() -
635{ -
636 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
637 // Embedded native widget may have taken the focus; get it back to toplevel if that is the case -
638 const QWidget *topLevel = q->window();
executed (the execution status of this line is deduced): const QWidget *topLevel = q->window();
-
639 if (topLevel->windowType() != Qt::Popup) {
evaluated: topLevel->windowType() != Qt::Popup
TRUEFALSE
yes
Evaluation Count:827
yes
Evaluation Count:14
14-827
640 if (QWindow *nativeWindow = q->window()->windowHandle()) {
partially evaluated: QWindow *nativeWindow = q->window()->windowHandle()
TRUEFALSE
yes
Evaluation Count:827
no
Evaluation Count:0
0-827
641 if (nativeWindow != QGuiApplication::focusWindow()
evaluated: nativeWindow != QGuiApplication::focusWindow()
TRUEFALSE
yes
Evaluation Count:85
yes
Evaluation Count:742
85-742
642 && q->testAttribute(Qt::WA_WState_Created)) {
partially evaluated: q->testAttribute(Qt::WA_WState_Created)
TRUEFALSE
yes
Evaluation Count:85
no
Evaluation Count:0
0-85
643 nativeWindow->requestActivate();
executed (the execution status of this line is deduced): nativeWindow->requestActivate();
-
644 }
executed: }
Execution Count:85
85
645 }
executed: }
Execution Count:827
827
646 }
executed: }
Execution Count:827
827
647}
executed: }
Execution Count:841
841
648 -
649void QWidgetPrivate::raise_sys() -
650{ -
651 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
652 if (q->isWindow() || q->testAttribute(Qt::WA_NativeWindow)) {
evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:92
yes
Evaluation Count:1864
partially evaluated: q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1864
0-1864
653 q->windowHandle()->raise();
executed (the execution status of this line is deduced): q->windowHandle()->raise();
-
654 }
executed: }
Execution Count:92
92
655}
executed: }
Execution Count:1956
1956
656 -
657void QWidgetPrivate::lower_sys() -
658{ -
659 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
660 if (q->isWindow() || q->testAttribute(Qt::WA_NativeWindow)) {
partially evaluated: q->isWindow()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:37
partially evaluated: q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:37
0-37
661 Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
never executed (the execution status of this line is deduced): qt_noop();
-
662 q->windowHandle()->lower();
never executed (the execution status of this line is deduced): q->windowHandle()->lower();
-
663 } else if (QWidget *p = q->parentWidget()) {
never executed: }
partially evaluated: QWidget *p = q->parentWidget()
TRUEFALSE
yes
Evaluation Count:37
no
Evaluation Count:0
0-37
664 setDirtyOpaqueRegion();
executed (the execution status of this line is deduced): setDirtyOpaqueRegion();
-
665 p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
executed (the execution status of this line is deduced): p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
-
666 }
executed: }
Execution Count:37
37
667} -
668 -
669void QWidgetPrivate::stackUnder_sys(QWidget*) -
670{ -
671 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
672 if (QWidget *p = q->parentWidget()) {
partially evaluated: QWidget *p = q->parentWidget()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
673 setDirtyOpaqueRegion();
executed (the execution status of this line is deduced): setDirtyOpaqueRegion();
-
674 p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
executed (the execution status of this line is deduced): p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
-
675 }
executed: }
Execution Count:1
1
676}
executed: }
Execution Count:1
1
677 -
678void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) -
679{ -
680 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
681 if (extra) { // any size restrictions?
evaluated: extra
TRUEFALSE
yes
Evaluation Count:15628
yes
Evaluation Count:6972
6972-15628
682 w = qMin(w,extra->maxw);
executed (the execution status of this line is deduced): w = qMin(w,extra->maxw);
-
683 h = qMin(h,extra->maxh);
executed (the execution status of this line is deduced): h = qMin(h,extra->maxh);
-
684 w = qMax(w,extra->minw);
executed (the execution status of this line is deduced): w = qMax(w,extra->minw);
-
685 h = qMax(h,extra->minh);
executed (the execution status of this line is deduced): h = qMax(h,extra->minh);
-
686 }
executed: }
Execution Count:15628
15628
687 -
688 QPoint oldp = q->geometry().topLeft();
executed (the execution status of this line is deduced): QPoint oldp = q->geometry().topLeft();
-
689 QSize olds = q->size();
executed (the execution status of this line is deduced): QSize olds = q->size();
-
690 QRect r(x, y, w, h);
executed (the execution status of this line is deduced): QRect r(x, y, w, h);
-
691 -
692 bool isResize = olds != r.size();
executed (the execution status of this line is deduced): bool isResize = olds != r.size();
-
693 isMove = oldp != r.topLeft(); //### why do we have isMove as a parameter?
executed (the execution status of this line is deduced): isMove = oldp != r.topLeft();
-
694 -
695 -
696 // We only care about stuff that changes the geometry, or may -
697 // cause the window manager to change its state -
698 if (r.size() == olds && oldp == r.topLeft())
evaluated: r.size() == olds
TRUEFALSE
yes
Evaluation Count:16340
yes
Evaluation Count:6260
evaluated: oldp == r.topLeft()
TRUEFALSE
yes
Evaluation Count:15684
yes
Evaluation Count:656
656-16340
699 return;
executed: return;
Execution Count:15684
15684
700 -
701 if (!data.in_set_window_state) {
evaluated: !data.in_set_window_state
TRUEFALSE
yes
Evaluation Count:6910
yes
Evaluation Count:6
6-6910
702 q->data->window_state &= ~Qt::WindowMaximized;
executed (the execution status of this line is deduced): q->data->window_state &= ~Qt::WindowMaximized;
-
703 q->data->window_state &= ~Qt::WindowFullScreen;
executed (the execution status of this line is deduced): q->data->window_state &= ~Qt::WindowFullScreen;
-
704 if (q->isWindow())
evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:1575
yes
Evaluation Count:5335
1575-5335
705 topData()->normalGeometry = QRect(0, 0, -1, -1);
executed: topData()->normalGeometry = QRect(0, 0, -1, -1);
Execution Count:1575
1575
706 }
executed: }
Execution Count:6910
6910
707 -
708 QPoint oldPos = q->pos();
executed (the execution status of this line is deduced): QPoint oldPos = q->pos();
-
709 data.crect = r;
executed (the execution status of this line is deduced): data.crect = r;
-
710 -
711 bool needsShow = false;
executed (the execution status of this line is deduced): bool needsShow = false;
-
712 -
713 if (!(data.window_state & Qt::WindowFullScreen) && (w == 0 || h == 0)) {
evaluated: !(data.window_state & Qt::WindowFullScreen)
TRUEFALSE
yes
Evaluation Count:6915
yes
Evaluation Count:1
evaluated: w == 0
TRUEFALSE
yes
Evaluation Count:129
yes
Evaluation Count:6786
evaluated: h == 0
TRUEFALSE
yes
Evaluation Count:118
yes
Evaluation Count:6668
1-6915
714 q->setAttribute(Qt::WA_OutsideWSRange, true);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_OutsideWSRange, true);
-
715 if (q->isVisible() && q->testAttribute(Qt::WA_Mapped))
evaluated: q->isVisible()
TRUEFALSE
yes
Evaluation Count:179
yes
Evaluation Count:68
partially evaluated: q->testAttribute(Qt::WA_Mapped)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:179
0-179
716 hide_sys();
never executed: hide_sys();
0
717 data.crect = QRect(x, y, w, h);
executed (the execution status of this line is deduced): data.crect = QRect(x, y, w, h);
-
718 } else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) {
executed: }
Execution Count:247
evaluated: q->isVisible()
TRUEFALSE
yes
Evaluation Count:3932
yes
Evaluation Count:2737
evaluated: q->testAttribute(Qt::WA_OutsideWSRange)
TRUEFALSE
yes
Evaluation Count:168
yes
Evaluation Count:3764
168-3932
719 q->setAttribute(Qt::WA_OutsideWSRange, false);
executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_OutsideWSRange, false);
-
720 needsShow = true;
executed (the execution status of this line is deduced): needsShow = true;
-
721 }
executed: }
Execution Count:168
168
722 -
723 if (q->isVisible()) {
evaluated: q->isVisible()
TRUEFALSE
yes
Evaluation Count:4111
yes
Evaluation Count:2805
2805-4111
724 if (!q->testAttribute(Qt::WA_DontShowOnScreen) && !q->testAttribute(Qt::WA_OutsideWSRange)) {
partially evaluated: !q->testAttribute(Qt::WA_DontShowOnScreen)
TRUEFALSE
yes
Evaluation Count:4111
no
Evaluation Count:0
evaluated: !q->testAttribute(Qt::WA_OutsideWSRange)
TRUEFALSE
yes
Evaluation Count:3932
yes
Evaluation Count:179
0-4111
725 if (q->windowHandle()) {
evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:290
yes
Evaluation Count:3642
290-3642
726 if (q->isWindow()) {
partially evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:290
no
Evaluation Count:0
0-290
727 q->windowHandle()->setGeometry(q->geometry());
executed (the execution status of this line is deduced): q->windowHandle()->setGeometry(q->geometry());
-
728 } else {
executed: }
Execution Count:290
290
729 QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint());
never executed (the execution status of this line is deduced): QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint());
-
730 q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size()));
never executed (the execution status of this line is deduced): q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size()));
-
731 }
never executed: }
0
732 const QWidgetBackingStore *bs = maybeBackingStore();
executed (the execution status of this line is deduced): const QWidgetBackingStore *bs = maybeBackingStore();
-
733 if (bs->store) {
partially evaluated: bs->store
TRUEFALSE
yes
Evaluation Count:290
no
Evaluation Count:0
0-290
734 if (isResize)
evaluated: isResize
TRUEFALSE
yes
Evaluation Count:147
yes
Evaluation Count:143
143-147
735 bs->store->resize(r.size());
executed: bs->store->resize(r.size());
Execution Count:147
147
736 }
executed: }
Execution Count:290
290
737 -
738 if (needsShow)
evaluated: needsShow
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:273
17-273
739 show_sys();
executed: show_sys();
Execution Count:17
17
740 }
executed: }
Execution Count:290
290
741 -
742 if (!q->isWindow()) {
evaluated: !q->isWindow()
TRUEFALSE
yes
Evaluation Count:3642
yes
Evaluation Count:290
290-3642
743 if (isMove && !isResize)
evaluated: isMove
TRUEFALSE
yes
Evaluation Count:800
yes
Evaluation Count:2842
evaluated: !isResize
TRUEFALSE
yes
Evaluation Count:369
yes
Evaluation Count:431
369-2842
744 moveRect(QRect(oldPos, olds), x - oldPos.x(), y - oldPos.y());
executed: moveRect(QRect(oldPos, olds), x - oldPos.x(), y - oldPos.y());
Execution Count:369
369
745 else -
746 invalidateBuffer_resizeHelper(oldPos, olds);
executed: invalidateBuffer_resizeHelper(oldPos, olds);
Execution Count:3273
3273
747 } -
748 }
executed: }
Execution Count:3932
3932
749 -
750 if (isMove) {
evaluated: isMove
TRUEFALSE
yes
Evaluation Count:1014
yes
Evaluation Count:3097
1014-3097
751 QMoveEvent e(q->pos(), oldPos);
executed (the execution status of this line is deduced): QMoveEvent e(q->pos(), oldPos);
-
752 QApplication::sendEvent(q, &e);
executed (the execution status of this line is deduced): QApplication::sendEvent(q, &e);
-
753 }
executed: }
Execution Count:1014
1014
754 if (isResize) {
evaluated: isResize
TRUEFALSE
yes
Evaluation Count:3599
yes
Evaluation Count:512
512-3599
755 QResizeEvent e(r.size(), olds);
executed (the execution status of this line is deduced): QResizeEvent e(r.size(), olds);
-
756 QApplication::sendEvent(q, &e);
executed (the execution status of this line is deduced): QApplication::sendEvent(q, &e);
-
757 if (q->windowHandle())
evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:148
yes
Evaluation Count:3451
148-3451
758 q->update();
executed: q->update();
Execution Count:148
148
759 }
executed: }
Execution Count:3599
3599
760 } else { // not visible
executed: }
Execution Count:4111
4111
761 if (isMove && q->pos() != oldPos)
evaluated: isMove
TRUEFALSE
yes
Evaluation Count:842
yes
Evaluation Count:1963
partially evaluated: q->pos() != oldPos
TRUEFALSE
yes
Evaluation Count:842
no
Evaluation Count:0
0-1963
762 q->setAttribute(Qt::WA_PendingMoveEvent, true);
executed: q->setAttribute(Qt::WA_PendingMoveEvent, true);
Execution Count:842
842
763 if (isResize)
evaluated: isResize
TRUEFALSE
yes
Evaluation Count:2661
yes
Evaluation Count:144
144-2661
764 q->setAttribute(Qt::WA_PendingResizeEvent, true);
executed: q->setAttribute(Qt::WA_PendingResizeEvent, true);
Execution Count:2661
2661
765 }
executed: }
Execution Count:2805
2805
766 -
767} -
768 -
769void QWidgetPrivate::setConstraints_sys() -
770{ -
771 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
772 if (extra && q->windowHandle()) {
partially evaluated: extra
TRUEFALSE
yes
Evaluation Count:1821
no
Evaluation Count:0
evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:573
yes
Evaluation Count:1248
0-1821
773 QWindow *win = q->windowHandle();
executed (the execution status of this line is deduced): QWindow *win = q->windowHandle();
-
774 QWindowPrivate *winp = qt_window_private(win);
executed (the execution status of this line is deduced): QWindowPrivate *winp = qt_window_private(win);
-
775 -
776 winp->minimumSize = QSize(extra->minw, extra->minh);
executed (the execution status of this line is deduced): winp->minimumSize = QSize(extra->minw, extra->minh);
-
777 winp->maximumSize = QSize(extra->maxw, extra->maxh);
executed (the execution status of this line is deduced): winp->maximumSize = QSize(extra->maxw, extra->maxh);
-
778 -
779 if (extra->topextra) {
partially evaluated: extra->topextra
TRUEFALSE
yes
Evaluation Count:573
no
Evaluation Count:0
0-573
780 winp->baseSize = QSize(extra->topextra->basew, extra->topextra->baseh);
executed (the execution status of this line is deduced): winp->baseSize = QSize(extra->topextra->basew, extra->topextra->baseh);
-
781 winp->sizeIncrement = QSize(extra->topextra->incw, extra->topextra->inch);
executed (the execution status of this line is deduced): winp->sizeIncrement = QSize(extra->topextra->incw, extra->topextra->inch);
-
782 }
executed: }
Execution Count:573
573
783 -
784 if (winp->platformWindow) {
evaluated: winp->platformWindow
TRUEFALSE
yes
Evaluation Count:568
yes
Evaluation Count:5
5-568
785 fixPosIncludesFrame();
executed (the execution status of this line is deduced): fixPosIncludesFrame();
-
786 winp->platformWindow->propagateSizeHints();
executed (the execution status of this line is deduced): winp->platformWindow->propagateSizeHints();
-
787 }
executed: }
Execution Count:568
568
788 }
executed: }
Execution Count:573
573
789}
executed: }
Execution Count:1821
1821
790 -
791void QWidgetPrivate::scroll_sys(int dx, int dy) -
792{ -
793 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
794 scrollChildren(dx, dy);
executed (the execution status of this line is deduced): scrollChildren(dx, dy);
-
795 scrollRect(q->rect(), dx, dy);
executed (the execution status of this line is deduced): scrollRect(q->rect(), dx, dy);
-
796}
executed: }
Execution Count:1111
1111
797 -
798void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r) -
799{ -
800 scrollRect(r, dx, dy);
never executed (the execution status of this line is deduced): scrollRect(r, dx, dy);
-
801}
never executed: }
0
802 -
803int QWidget::metric(PaintDeviceMetric m) const -
804{ -
805 Q_D(const QWidget);
executed (the execution status of this line is deduced): const QWidgetPrivate * const d = d_func();
-
806 -
807 QScreen *screen = 0;
executed (the execution status of this line is deduced): QScreen *screen = 0;
-
808 if (QWidget *topLevel = window())
partially evaluated: QWidget *topLevel = window()
TRUEFALSE
yes
Evaluation Count:116993
no
Evaluation Count:0
0-116993
809 if (QWindow *topLevelWindow = topLevel->windowHandle()) {
evaluated: QWindow *topLevelWindow = topLevel->windowHandle()
TRUEFALSE
yes
Evaluation Count:37012
yes
Evaluation Count:79981
37012-79981
810 QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(topLevelWindow);
executed (the execution status of this line is deduced): QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(topLevelWindow);
-
811 if (platformScreen)
partially evaluated: platformScreen
TRUEFALSE
yes
Evaluation Count:37012
no
Evaluation Count:0
0-37012
812 screen = platformScreen->screen();
executed: screen = platformScreen->screen();
Execution Count:37012
37012
813 }
executed: }
Execution Count:37012
37012
814 if (!screen && QGuiApplication::primaryScreen())
evaluated: !screen
TRUEFALSE
yes
Evaluation Count:79981
yes
Evaluation Count:37012
partially evaluated: QGuiApplication::primaryScreen()
TRUEFALSE
yes
Evaluation Count:79981
no
Evaluation Count:0
0-79981
815 screen = QGuiApplication::primaryScreen();
executed: screen = QGuiApplication::primaryScreen();
Execution Count:79981
79981
816 -
817 if (!screen) {
partially evaluated: !screen
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116993
0-116993
818 if (m == PdmDpiX || m == PdmDpiY)
never evaluated: m == PdmDpiX
never evaluated: m == PdmDpiY
0
819 return 72;
never executed: return 72;
0
820 return QPaintDevice::metric(m);
never executed: return QPaintDevice::metric(m);
0
821 } -
822 int val;
executed (the execution status of this line is deduced): int val;
-
823 if (m == PdmWidth) {
evaluated: m == PdmWidth
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:116987
6-116987
824 val = data->crect.width();
executed (the execution status of this line is deduced): val = data->crect.width();
-
825 } else if (m == PdmWidthMM) {
executed: }
Execution Count:6
partially evaluated: m == PdmWidthMM
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116987
0-116987
826 val = data->crect.width() * screen->physicalSize().width() / screen->geometry().width();
never executed (the execution status of this line is deduced): val = data->crect.width() * screen->physicalSize().width() / screen->geometry().width();
-
827 } else if (m == PdmHeight) {
never executed: }
evaluated: m == PdmHeight
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:116981
0-116981
828 val = data->crect.height();
executed (the execution status of this line is deduced): val = data->crect.height();
-
829 } else if (m == PdmHeightMM) {
executed: }
Execution Count:6
partially evaluated: m == PdmHeightMM
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116981
0-116981
830 val = data->crect.height() * screen->physicalSize().height() / screen->geometry().height();
never executed (the execution status of this line is deduced): val = data->crect.height() * screen->physicalSize().height() / screen->geometry().height();
-
831 } else if (m == PdmDepth) {
never executed: }
evaluated: m == PdmDepth
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:116978
0-116978
832 return screen->depth();
executed: return screen->depth();
Execution Count:3
3
833 } else if (m == PdmDpiX) {
evaluated: m == PdmDpiX
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:116968
10-116968
834 if (d->extra && d->extra->customDpiX)
partially evaluated: d->extra
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
partially evaluated: d->extra->customDpiX
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
835 return d->extra->customDpiX;
never executed: return d->extra->customDpiX;
0
836 else if (d->parent)
partially evaluated: d->parent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
837 return static_cast<QWidget *>(d->parent)->metric(m);
never executed: return static_cast<QWidget *>(d->parent)->metric(m);
0
838 return qRound(screen->logicalDotsPerInchX());
executed: return qRound(screen->logicalDotsPerInchX());
Execution Count:10
10
839 } else if (m == PdmDpiY) {
evaluated: m == PdmDpiY
TRUEFALSE
yes
Evaluation Count:116936
yes
Evaluation Count:32
32-116936
840 if (d->extra && d->extra->customDpiY)
evaluated: d->extra
TRUEFALSE
yes
Evaluation Count:29073
yes
Evaluation Count:87863
partially evaluated: d->extra->customDpiY
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:29073
0-87863
841 return d->extra->customDpiY;
never executed: return d->extra->customDpiY;
0
842 else if (d->parent)
evaluated: d->parent
TRUEFALSE
yes
Evaluation Count:69862
yes
Evaluation Count:47074
47074-69862
843 return static_cast<QWidget *>(d->parent)->metric(m);
executed: return static_cast<QWidget *>(d->parent)->metric(m);
Execution Count:69862
69862
844 return qRound(screen->logicalDotsPerInchY());
executed: return qRound(screen->logicalDotsPerInchY());
Execution Count:47074
47074
845 } else if (m == PdmPhysicalDpiX) {
evaluated: m == PdmPhysicalDpiX
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:16
16
846 return qRound(screen->physicalDotsPerInchX());
executed: return qRound(screen->physicalDotsPerInchX());
Execution Count:16
16
847 } else if (m == PdmPhysicalDpiY) {
partially evaluated: m == PdmPhysicalDpiY
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
848 return qRound(screen->physicalDotsPerInchY());
executed: return qRound(screen->physicalDotsPerInchY());
Execution Count:16
16
849 } else { -
850 val = QPaintDevice::metric(m);// XXX
never executed (the execution status of this line is deduced): val = QPaintDevice::metric(m);
-
851 }
never executed: }
0
852 return val;
executed: return val;
Execution Count:12
12
853} -
854 -
855/*! -
856 \preliminary -
857 -
858 Returns the QPlatformWindow this widget will be drawn into. -
859*/ -
860QWindow *QWidget::windowHandle() const -
861{ -
862 Q_D(const QWidget);
executed (the execution status of this line is deduced): const QWidgetPrivate * const d = d_func();
-
863 QTLWExtra *extra = d->maybeTopData();
executed (the execution status of this line is deduced): QTLWExtra *extra = d->maybeTopData();
-
864 if (extra)
evaluated: extra
TRUEFALSE
yes
Evaluation Count:232649
yes
Evaluation Count:275921
232649-275921
865 return extra->window;
executed: return extra->window;
Execution Count:232649
232649
866 -
867 return 0;
executed: return 0;
Execution Count:275921
275921
868} -
869 -
870void QWidgetPrivate::createSysExtra() -
871{ -
872} -
873 -
874void QWidgetPrivate::deleteSysExtra() -
875{ -
876 -
877} -
878 -
879void QWidgetPrivate::createTLSysExtra() -
880{ -
881 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
882 extra->topextra->screenIndex = 0;
executed (the execution status of this line is deduced): extra->topextra->screenIndex = 0;
-
883 extra->topextra->window = 0;
executed (the execution status of this line is deduced): extra->topextra->window = 0;
-
884 if (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) {
evaluated: q->testAttribute(Qt::WA_NativeWindow)
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2245
evaluated: q->isWindow()
TRUEFALSE
yes
Evaluation Count:2216
yes
Evaluation Count:29
4-2245
885 extra->topextra->window = new QWidgetWindow(q);
executed (the execution status of this line is deduced): extra->topextra->window = new QWidgetWindow(q);
-
886 if (extra->minw || extra->minh)
evaluated: extra->minw
TRUEFALSE
yes
Evaluation Count:184
yes
Evaluation Count:2036
evaluated: extra->minh
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2035
1-2036
887 extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh));
executed: extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh));
Execution Count:185
185
888 if (extra->maxw != QWIDGETSIZE_MAX || extra->maxh != QWIDGETSIZE_MAX)
evaluated: extra->maxw != ((1<<24)-1)
TRUEFALSE
yes
Evaluation Count:180
yes
Evaluation Count:2040
evaluated: extra->maxh != ((1<<24)-1)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2039
1-2040
889 extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh));
executed: extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh));
Execution Count:181
181
890 }
executed: }
Execution Count:2220
2220
891}
executed: }
Execution Count:2249
2249
892 -
893void QWidgetPrivate::deleteTLSysExtra() -
894{ -
895 if (extra && extra->topextra) {
evaluated: extra
TRUEFALSE
yes
Evaluation Count:12208
yes
Evaluation Count:21702
evaluated: extra->topextra
TRUEFALSE
yes
Evaluation Count:4200
yes
Evaluation Count:8008
4200-21702
896 //the toplevel might have a context with a "qglcontext associated with it. We need to -
897 //delete the qglcontext before we delete the qplatformopenglcontext. -
898 //One unfortunate thing about this is that we potentially create a glContext just to -
899 //delete it straight afterwards. -
900 if (extra->topextra->window) {
evaluated: extra->topextra->window
TRUEFALSE
yes
Evaluation Count:2152
yes
Evaluation Count:2048
2048-2152
901 extra->topextra->window->destroy();
executed (the execution status of this line is deduced): extra->topextra->window->destroy();
-
902 }
executed: }
Execution Count:2152
2152
903 setWinId(0);
executed (the execution status of this line is deduced): setWinId(0);
-
904 delete extra->topextra->window;
executed (the execution status of this line is deduced): delete extra->topextra->window;
-
905 extra->topextra->window = 0;
executed (the execution status of this line is deduced): extra->topextra->window = 0;
-
906 -
907 extra->topextra->backingStoreTracker.destroy();
executed (the execution status of this line is deduced): extra->topextra->backingStoreTracker.destroy();
-
908 delete extra->topextra->backingStore;
executed (the execution status of this line is deduced): delete extra->topextra->backingStore;
-
909 extra->topextra->backingStore = 0;
executed (the execution status of this line is deduced): extra->topextra->backingStore = 0;
-
910 -
911 }
executed: }
Execution Count:4200
4200
912}
executed: }
Execution Count:33910
33910
913 -
914void QWidgetPrivate::registerDropSite(bool on) -
915{ -
916 Q_UNUSED(on);
executed (the execution status of this line is deduced): (void)on;;
-
917}
executed: }
Execution Count:35351
35351
918 -
919void QWidgetPrivate::setMask_sys(const QRegion &region) -
920{ -
921 if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowMasks)) {
partially evaluated: !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowMasks)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
922 qWarning("%s: Not supported on %s.", Q_FUNC_INFO, qPrintable(QGuiApplication::platformName()));
never executed (the execution status of this line is deduced): QMessageLogger("kernel/qwidget_qpa.cpp", 922, __PRETTY_FUNCTION__).warning("%s: Not supported on %s.", __PRETTY_FUNCTION__, QString(QGuiApplication::platformName()).toLocal8Bit().constData());
-
923 return;
never executed: return;
0
924 } -
925 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
926 if (const QWindow *window = q->windowHandle())
evaluated: const QWindow *window = q->windowHandle()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:21
4-21
927 if (QPlatformWindow *platformWindow = window->handle())
partially evaluated: QPlatformWindow *platformWindow = window->handle()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
928 platformWindow->setMask(region);
executed: platformWindow->setMask(region);
Execution Count:4
4
929}
executed: }
Execution Count:25
25
930 -
931void QWidgetPrivate::updateFrameStrut() -
932{ -
933 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
934 if (q->data->fstrut_dirty) {
evaluated: q->data->fstrut_dirty
TRUEFALSE
yes
Evaluation Count:10021
yes
Evaluation Count:3
3-10021
935 if (QTLWExtra *te = maybeTopData()) {
evaluated: QTLWExtra *te = maybeTopData()
TRUEFALSE
yes
Evaluation Count:4132
yes
Evaluation Count:5889
4132-5889
936 if (te->window) {
evaluated: te->window
TRUEFALSE
yes
Evaluation Count:4067
yes
Evaluation Count:65
65-4067
937 if (const QPlatformWindow *pw = te->window->handle()) {
evaluated: const QPlatformWindow *pw = te->window->handle()
TRUEFALSE
yes
Evaluation Count:3874
yes
Evaluation Count:193
193-3874
938 const QMargins margins = pw->frameMargins();
executed (the execution status of this line is deduced): const QMargins margins = pw->frameMargins();
-
939 if (!margins.isNull()) {
evaluated: !margins.isNull()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3872
2-3872
940 te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
executed (the execution status of this line is deduced): te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
-
941 q->data->fstrut_dirty = false;
executed (the execution status of this line is deduced): q->data->fstrut_dirty = false;
-
942 }
executed: }
Execution Count:2
2
943 }
executed: }
Execution Count:3874
3874
944 }
executed: }
Execution Count:4067
4067
945 }
executed: }
Execution Count:4132
4132
946 }
executed: }
Execution Count:10021
10021
947}
executed: }
Execution Count:10024
10024
948 -
949void QWidgetPrivate::setWindowOpacity_sys(qreal level) -
950{ -
951 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
952 if (q->windowHandle())
partially evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:274
no
Evaluation Count:0
0-274
953 q->windowHandle()->setOpacity(level);
executed: q->windowHandle()->setOpacity(level);
Execution Count:274
274
954}
executed: }
Execution Count:274
274
955 -
956void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &oldRect) -
957{ -
958 Q_UNUSED(dontShow);
executed (the execution status of this line is deduced): (void)dontShow;;
-
959 Q_UNUSED(oldRect);
executed (the execution status of this line is deduced): (void)oldRect;;
-
960 // XXX -
961}
executed: }
Execution Count:3
3
962 -
963QPaintEngine *QWidget::paintEngine() const -
964{ -
965 qWarning("QWidget::paintEngine: Should no longer be called");
never executed (the execution status of this line is deduced): QMessageLogger("kernel/qwidget_qpa.cpp", 965, __PRETTY_FUNCTION__).warning("QWidget::paintEngine: Should no longer be called");
-
966 -
967#ifdef Q_OS_WIN -
968 // We set this bit which is checked in setAttribute for -
969 // Qt::WA_PaintOnScreen. We do this to allow these two scenarios: -
970 // -
971 // 1. Users accidentally set Qt::WA_PaintOnScreen on X and port to -
972 // Windows which would mean suddenly their widgets stop working. -
973 // -
974 // 2. Users set paint on screen and subclass paintEngine() to -
975 // return 0, in which case we have a "hole" in the backingstore -
976 // allowing use of GDI or DirectX directly. -
977 // -
978 // 1 is WRONG, but to minimize silent failures, we have set this -
979 // bit to ignore the setAttribute call. 2. needs to be -
980 // supported because its our only means of embedding native -
981 // graphics stuff. -
982 const_cast<QWidgetPrivate *>(d_func())->noPaintOnScreen = 1; -
983#endif -
984 -
985 return 0; //##### @@@
never executed: return 0;
0
986} -
987 -
988void QWidgetPrivate::setModal_sys() -
989{ -
990 Q_Q(QWidget);
executed (the execution status of this line is deduced): QWidget * const q = q_func();
-
991 if (q->windowHandle())
evaluated: q->windowHandle()
TRUEFALSE
yes
Evaluation Count:1639
yes
Evaluation Count:5955
1639-5955
992 q->windowHandle()->setModality(q->windowModality());
executed: q->windowHandle()->setModality(q->windowModality());
Execution Count:1639
1639
993}
executed: }
Execution Count:7594
7594
994 -
995#ifndef QT_NO_CURSOR -
996static inline void applyCursor(QWidget *w, QCursor c) -
997{ -
998 if (QWindow *window = w->windowHandle())
partially evaluated: QWindow *window = w->windowHandle()
TRUEFALSE
yes
Evaluation Count:2029
no
Evaluation Count:0
0-2029
999 window->setCursor(c);
executed: window->setCursor(c);
Execution Count:2029
2029
1000}
executed: }
Execution Count:2029
2029
1001 -
1002void qt_qpa_set_cursor(QWidget *w, bool force) -
1003{ -
1004 if (!w->testAttribute(Qt::WA_WState_Created))
evaluated: !w->testAttribute(Qt::WA_WState_Created)
TRUEFALSE
yes
Evaluation Count:1931
yes
Evaluation Count:2110
1931-2110
1005 return;
executed: return;
Execution Count:1931
1931
1006 -
1007 static QPointer<QWidget> lastUnderMouse = 0; -
1008 if (force) {
evaluated: force
TRUEFALSE
yes
Evaluation Count:458
yes
Evaluation Count:1652
458-1652
1009 lastUnderMouse = w;
executed (the execution status of this line is deduced): lastUnderMouse = w;
-
1010 } else if (lastUnderMouse) {
executed: }
Execution Count:458
evaluated: lastUnderMouse
TRUEFALSE
yes
Evaluation Count:57
yes
Evaluation Count:1595
57-1595
1011 const WId lastWinId = lastUnderMouse->effectiveWinId();
executed (the execution status of this line is deduced): const WId lastWinId = lastUnderMouse->effectiveWinId();
-
1012 const WId winId = w->effectiveWinId();
executed (the execution status of this line is deduced): const WId winId = w->effectiveWinId();
-
1013 if (lastWinId && lastWinId == winId)
partially evaluated: lastWinId
TRUEFALSE
yes
Evaluation Count:57
no
Evaluation Count:0
evaluated: lastWinId == winId
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:42
0-57
1014 w = lastUnderMouse;
executed: w = lastUnderMouse;
Execution Count:15
15
1015 } else if (!w->internalWinId()) {
executed: }
Execution Count:57
evaluated: !w->internalWinId()
TRUEFALSE
yes
Evaluation Count:81
yes
Evaluation Count:1514
57-1514
1016 return; // The mouse is not under this widget, and it's not native, so don't change it.
executed: return;
Execution Count:81
81
1017 } -
1018 -
1019 while (!w->internalWinId() && w->parentWidget() && !w->isWindow()
evaluated: !w->internalWinId()
TRUEFALSE
yes
Evaluation Count:766
yes
Evaluation Count:2019
partially evaluated: w->parentWidget()
TRUEFALSE
yes
Evaluation Count:766
no
Evaluation Count:0
partially evaluated: !w->isWindow()
TRUEFALSE
yes
Evaluation Count:766
no
Evaluation Count:0
0-2019
1020 && !w->testAttribute(Qt::WA_SetCursor))
evaluated: !w->testAttribute(Qt::WA_SetCursor)
TRUEFALSE
yes
Evaluation Count:756
yes
Evaluation Count:10
10-756
1021 w = w->parentWidget();
executed: w = w->parentWidget();
Execution Count:756
756
1022 -
1023 QWidget *nativeParent = w;
executed (the execution status of this line is deduced): QWidget *nativeParent = w;
-
1024 if (!w->internalWinId())
evaluated: !w->internalWinId()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:2019
10-2019
1025 nativeParent = w->nativeParentWidget();
executed: nativeParent = w->nativeParentWidget();
Execution Count:10
10
1026 if (!nativeParent || !nativeParent->internalWinId())
partially evaluated: !nativeParent
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2029
partially evaluated: !nativeParent->internalWinId()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2029
0-2029
1027 return;
never executed: return;
0
1028 -
1029 if (w->isWindow() || w->testAttribute(Qt::WA_SetCursor)) {
evaluated: w->isWindow()
TRUEFALSE
yes
Evaluation Count:2015
yes
Evaluation Count:14
evaluated: w->testAttribute(Qt::WA_SetCursor)
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:4
4-2015
1030 if (w->isEnabled())
evaluated: w->isEnabled()
TRUEFALSE
yes
Evaluation Count:2019
yes
Evaluation Count:6
6-2019
1031 applyCursor(nativeParent, w->cursor());
executed: applyCursor(nativeParent, w->cursor());
Execution Count:2019
2019
1032 else -
1033 // Enforce the windows behavior of clearing the cursor on -
1034 // disabled widgets. -
1035 applyCursor(nativeParent, Qt::ArrowCursor);
executed: applyCursor(nativeParent, Qt::ArrowCursor);
Execution Count:6
6
1036 } else { -
1037 applyCursor(nativeParent, Qt::ArrowCursor);
executed (the execution status of this line is deduced): applyCursor(nativeParent, Qt::ArrowCursor);
-
1038 }
executed: }
Execution Count:4
4
1039} -
1040#endif //QT_NO_CURSOR -
1041 -
1042QT_END_NAMESPACE -
1043 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial