kernel/qguiapplication.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -
11 -
12 -
13 -
14 -
15 -
16 -
17 -
18 -
19 -
20__attribute__((visibility("default"))) bool qt_is_gui_used = true; -
21 -
22Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton; -
23Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier; -
24 -
25QPointF QGuiApplicationPrivate::lastCursorPosition(0.0, 0.0); -
26 -
27bool QGuiApplicationPrivate::tabletState = false; -
28QWindow *QGuiApplicationPrivate::tabletPressTarget = 0; -
29QWindow *QGuiApplicationPrivate::currentMouseWindow = 0; -
30 -
31QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0; -
32QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0; -
33 -
34QList<QObject *> QGuiApplicationPrivate::generic_plugin_list; -
35 -
36enum ApplicationResourceFlags -
37{ -
38 ApplicationPaletteExplicitlySet = 0x1, -
39 ApplicationFontExplicitlySet = 0x2 -
40}; -
41 -
42static unsigned applicationResourceFlags = 0; -
43 -
44QString *QGuiApplicationPrivate::platform_name = 0; -
45QString *QGuiApplicationPrivate::displayName = 0; -
46 -
47QPalette *QGuiApplicationPrivate::app_pal = 0; -
48 -
49Qt::MouseButtons QGuiApplicationPrivate::buttons = Qt::NoButton; -
50ulong QGuiApplicationPrivate::mousePressTime = 0; -
51Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton; -
52int QGuiApplicationPrivate::mousePressX = 0; -
53int QGuiApplicationPrivate::mousePressY = 0; -
54int QGuiApplicationPrivate::mouse_double_click_distance = 5; -
55 -
56static Qt::LayoutDirection layout_direction = Qt::LeftToRight; -
57static bool force_reverse = false; -
58 -
59QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0; -
60QTouchDevice *QGuiApplicationPrivate::m_fakeTouchDevice = 0; -
61int QGuiApplicationPrivate::m_fakeMouseSourcePointId = 0; -
62 -
63 -
64QClipboard *QGuiApplicationPrivate::qt_clipboard = 0; -
65 -
66 -
67QList<QScreen *> QGuiApplicationPrivate::screen_list; -
68 -
69QWindowList QGuiApplicationPrivate::window_list; -
70QWindow *QGuiApplicationPrivate::focus_window = 0; -
71 -
72static QBasicMutex applicationFontMutex; -
73QFont *QGuiApplicationPrivate::app_font = 0; -
74bool QGuiApplicationPrivate::obey_desktop_settings = true; -
75bool QGuiApplicationPrivate::noGrab = false; -
76 -
77static qreal fontSmoothingGamma = 1.7; -
78 -
79extern void qRegisterGuiVariant(); -
80extern void qInitDrawhelperAsm(); -
81extern void qInitImageConversions(); -
82 -
83static bool qt_detectRTLLanguage() -
84{ -
85 return force_reverse ^ 52
86 (QCoreApplication::tr("QT_LAYOUT_DIRECTION", 52
87 "Translate this string to the string 'LTR' in left-to-right" 52
88 " languages or to 'RTL' in right-to-left languages (such as Hebrew" 52
89 " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
executed: return force_reverse ^ (QCoreApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
Execution Count:52
52
90} -
91 -
92static void initPalette() -
93{ -
94 if (!QGuiApplicationPrivate::app_pal)
evaluated: !QGuiApplicationPrivate::app_pal
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:121948
2-121948
95 if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette())
partially evaluated: const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
96 QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
0
97 if (!QGuiApplicationPrivate::app_pal)
evaluated: !QGuiApplicationPrivate::app_pal
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:121948
2-121948
98 QGuiApplicationPrivate::app_pal = new QPalette(Qt::black);
executed: QGuiApplicationPrivate::app_pal = new QPalette(Qt::black);
Execution Count:2
2
99}
executed: }
Execution Count:121950
121950
100 -
101static inline void clearPalette() -
102{ -
103 delete QGuiApplicationPrivate::app_pal; -
104 QGuiApplicationPrivate::app_pal = 0; -
105}
executed: }
Execution Count:258
258
106 -
107static void initFontUnlocked() -
108{ -
109 if (!QGuiApplicationPrivate::app_font) {
evaluated: !QGuiApplicationPrivate::app_font
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:806322
160-806322
110 if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()
TRUEFALSE
yes
Evaluation Count:160
no
Evaluation Count:0
0-160
111 if (const QFont *font = theme->font(QPlatformTheme::SystemFont))
partially evaluated: const QFont *font = theme->font(QPlatformTheme::SystemFont)
TRUEFALSE
yes
Evaluation Count:160
no
Evaluation Count:0
0-160
112 QGuiApplicationPrivate::app_font = new QFont(*font);
executed: QGuiApplicationPrivate::app_font = new QFont(*font);
Execution Count:160
160
113 }
executed: }
Execution Count:160
160
114 if (!QGuiApplicationPrivate::app_font)
partially evaluated: !QGuiApplicationPrivate::app_font
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:806482
0-806482
115 QGuiApplicationPrivate::app_font = 0
116 new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
0
117}
executed: }
Execution Count:806482
806482
118 -
119static inline void clearFontUnlocked() -
120{ -
121 delete QGuiApplicationPrivate::app_font; -
122 QGuiApplicationPrivate::app_font = 0; -
123}
executed: }
Execution Count:258
258
124QGuiApplication::QGuiApplication(int &argc, char **argv, int flags) -
125 -
126 : QCoreApplication(*new QGuiApplicationPrivate(argc, argv, flags)) -
127{ -
128 d_func()->init(); -
129 -
130 QCoreApplicationPrivate::eventDispatcher->startingUp(); -
131}
executed: }
Execution Count:75
75
132 -
133 -
134 -
135 -
136QGuiApplication::QGuiApplication(QGuiApplicationPrivate &p) -
137 : QCoreApplication(p) -
138{ -
139 d_func()->init(); }
executed: }
Execution Count:201
201
140 -
141 -
142 -
143 -
144QGuiApplication::~QGuiApplication() -
145{ -
146 QGuiApplicationPrivate * const d = d_func(); -
147 -
148 d->eventDispatcher->closingDown(); -
149 d->eventDispatcher = 0; -
150 -
151 -
152 delete QGuiApplicationPrivate::qt_clipboard; -
153 QGuiApplicationPrivate::qt_clipboard = 0; -
154 -
155 -
156 -
157 delete d->session_manager; -
158 d->session_manager = 0; -
159 -
160 -
161 clearPalette(); -
162 -
163 -
164 d->cursor_list.clear(); -
165 -
166 -
167 delete QGuiApplicationPrivate::platform_name; -
168 QGuiApplicationPrivate::platform_name = 0; -
169 delete QGuiApplicationPrivate::displayName; -
170 QGuiApplicationPrivate::displayName = 0; -
171}
executed: }
Execution Count:258
258
172 -
173QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags) -
174 : QCoreApplicationPrivate(argc, argv, flags), -
175 styleHints(0), -
176 inputMethod(0), -
177 lastTouchType(QEvent::TouchEnd) -
178{ -
179 self = this; -
180 application_type = QCoreApplicationPrivate::Gui; -
181 -
182 is_session_restored = false; -
183 is_saving_session = false; -
184 -
185}
executed: }
Execution Count:276
276
186void QGuiApplication::setApplicationDisplayName(const QString &name) -
187{ -
188 if (!QGuiApplicationPrivate::displayName)
partially evaluated: !QGuiApplicationPrivate::displayName
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
189 QGuiApplicationPrivate::displayName = new QString;
executed: QGuiApplicationPrivate::displayName = new QString;
Execution Count:1
1
190 *QGuiApplicationPrivate::displayName = name; -
191}
executed: }
Execution Count:1
1
192 -
193QString QGuiApplication::applicationDisplayName() -
194{ -
195 return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
executed: return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
Execution Count:2
2
196} -
197QWindow *QGuiApplication::modalWindow() -
198{ -
199 if (QGuiApplicationPrivate::self->modalWindowList.isEmpty())
evaluated: QGuiApplicationPrivate::self->modalWindowList.isEmpty()
TRUEFALSE
yes
Evaluation Count:2064
yes
Evaluation Count:328
328-2064
200 return 0;
executed: return 0;
Execution Count:2064
2064
201 return QGuiApplicationPrivate::self->modalWindowList.first();
executed: return QGuiApplicationPrivate::self->modalWindowList.first();
Execution Count:328
328
202} -
203 -
204void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window) -
205{ -
206 bool shouldBeBlocked = false; -
207 if ((window->type() & Qt::Popup) != Qt::Popup && !self->modalWindowList.isEmpty())
evaluated: (window->type() & Qt::Popup) != Qt::Popup
TRUEFALSE
yes
Evaluation Count:912
yes
Evaluation Count:90
evaluated: !self->modalWindowList.isEmpty()
TRUEFALSE
yes
Evaluation Count:493
yes
Evaluation Count:419
90-912
208 shouldBeBlocked = self->isWindowBlocked(window);
executed: shouldBeBlocked = self->isWindowBlocked(window);
Execution Count:493
493
209 -
210 if (shouldBeBlocked != window->d_func()->blockedByModalWindow) {
evaluated: shouldBeBlocked != window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:514
yes
Evaluation Count:488
488-514
211 QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked); -
212 -
213 window->d_func()->blockedByModalWindow = shouldBeBlocked; -
214 QGuiApplication::sendEvent(window, &e); -
215 }
executed: }
Execution Count:514
514
216}
executed: }
Execution Count:1002
1002
217 -
218void QGuiApplicationPrivate::showModalWindow(QWindow *modal) -
219{ -
220 self->modalWindowList.prepend(modal); -
221 -
222 -
223 if (currentMouseWindow && (currentMouseWindow->type() & Qt::Popup) != Qt::Popup) {
evaluated: currentMouseWindow
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:81
partially evaluated: (currentMouseWindow->type() & Qt::Popup) != Qt::Popup
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
0-81
224 bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow); -
225 if (shouldBeBlocked) {
evaluated: shouldBeBlocked
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:15
10-15
226 -
227 self->modalWindowList.removeFirst(); -
228 QEvent e(QEvent::Leave); -
229 QGuiApplication::sendEvent(currentMouseWindow, &e); -
230 currentMouseWindow = 0; -
231 self->modalWindowList.prepend(modal); -
232 }
executed: }
Execution Count:10
10
233 }
executed: }
Execution Count:25
25
234 -
235 QWindowList windows = QGuiApplication::topLevelWindows(); -
236 for (int i = 0; i < windows.count(); ++i) {
evaluated: i < windows.count()
TRUEFALSE
yes
Evaluation Count:387
yes
Evaluation Count:106
106-387
237 QWindow *window = windows.at(i); -
238 if (!window->d_func()->blockedByModalWindow)
evaluated: !window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:379
yes
Evaluation Count:8
8-379
239 updateBlockedStatus(window);
executed: updateBlockedStatus(window);
Execution Count:379
379
240 }
executed: }
Execution Count:387
387
241 -
242 updateBlockedStatus(modal); -
243}
executed: }
Execution Count:106
106
244 -
245void QGuiApplicationPrivate::hideModalWindow(QWindow *window) -
246{ -
247 self->modalWindowList.removeAll(window); -
248 -
249 QWindowList windows = QGuiApplication::topLevelWindows(); -
250 for (int i = 0; i < windows.count(); ++i) {
evaluated: i < windows.count()
TRUEFALSE
yes
Evaluation Count:387
yes
Evaluation Count:106
106-387
251 QWindow *window = windows.at(i); -
252 if (window->d_func()->blockedByModalWindow)
evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:264
yes
Evaluation Count:123
123-264
253 updateBlockedStatus(window);
executed: updateBlockedStatus(window);
Execution Count:264
264
254 }
executed: }
Execution Count:387
387
255}
executed: }
Execution Count:106
106
256 -
257 -
258 -
259 -
260 -
261 -
262bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const -
263{ -
264 QWindow *unused = 0; -
265 if (!blockingWindow)
partially evaluated: !blockingWindow
TRUEFALSE
yes
Evaluation Count:54
no
Evaluation Count:0
0-54
266 blockingWindow = &unused;
executed: blockingWindow = &unused;
Execution Count:54
54
267 -
268 if (modalWindowList.isEmpty()) {
partially evaluated: modalWindowList.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:54
0-54
269 *blockingWindow = 0; -
270 return false;
never executed: return false;
0
271 } -
272 -
273 for (int i = 0; i < modalWindowList.count(); ++i) {
evaluated: i < modalWindowList.count()
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:13
13-61
274 QWindow *modalWindow = modalWindowList.at(i); -
275 -
276 { -
277 -
278 QWindow *w = window; -
279 while (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:74
yes
Evaluation Count:41
41-74
280 if (w == modalWindow) {
evaluated: w == modalWindow
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:54
20-54
281 *blockingWindow = 0; -
282 return false;
executed: return false;
Execution Count:20
20
283 } -
284 QWindow *p = w->parent(); -
285 if (!p)
partially evaluated: !p
TRUEFALSE
yes
Evaluation Count:54
no
Evaluation Count:0
0-54
286 p = w->transientParent();
executed: p = w->transientParent();
Execution Count:54
54
287 w = p; -
288 }
executed: }
Execution Count:54
54
289 } -
290 -
291 Qt::WindowModality windowModality = modalWindow->modality(); -
292 switch (windowModality) { -
293 case Qt::ApplicationModal: -
294 { -
295 if (modalWindow != window) {
partially evaluated: modalWindow != window
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-12
296 *blockingWindow = modalWindow; -
297 return true;
executed: return true;
Execution Count:12
12
298 } -
299 break;
never executed: break;
0
300 } -
301 case Qt::WindowModal: -
302 { -
303 QWindow *w = window; -
304 do { -
305 QWindow *m = modalWindow; -
306 do { -
307 if (m == w) {
evaluated: m == w
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:58
9-58
308 *blockingWindow = m; -
309 return true;
executed: return true;
Execution Count:9
9
310 } -
311 QWindow *p = m->parent(); -
312 if (!p)
partially evaluated: !p
TRUEFALSE
yes
Evaluation Count:58
no
Evaluation Count:0
0-58
313 p = m->transientParent();
executed: p = m->transientParent();
Execution Count:58
58
314 m = p; -
315 } while (m);
executed: }
Execution Count:58
evaluated: m
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:20
20-58
316 QWindow *p = w->parent(); -
317 if (!p)
partially evaluated: !p
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
0-20
318 p = w->transientParent();
executed: p = w->transientParent();
Execution Count:20
20
319 w = p; -
320 } while (w);
executed: }
Execution Count:20
partially evaluated: w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:20
0-20
321 break;
executed: break;
Execution Count:20
20
322 } -
323 default: -
324 qt_noop(); -
325 break;
never executed: break;
0
326 } -
327 }
executed: }
Execution Count:20
20
328 *blockingWindow = 0; -
329 return false;
executed: return false;
Execution Count:13
13
330} -
331 -
332 -
333 -
334 -
335 -
336QWindow *QGuiApplication::focusWindow() -
337{ -
338 return QGuiApplicationPrivate::focus_window;
executed: return QGuiApplicationPrivate::focus_window;
Execution Count:51590
51590
339} -
340QObject *QGuiApplication::focusObject() -
341{ -
342 if (focusWindow())
evaluated: focusWindow()
TRUEFALSE
yes
Evaluation Count:7841
yes
Evaluation Count:34551
7841-34551
343 return focusWindow()->focusObject();
executed: return focusWindow()->focusObject();
Execution Count:7841
7841
344 return 0;
executed: return 0;
Execution Count:34551
34551
345} -
346QWindowList QGuiApplication::allWindows() -
347{ -
348 return QGuiApplicationPrivate::window_list;
executed: return QGuiApplicationPrivate::window_list;
Execution Count:6
6
349} -
350QWindowList QGuiApplication::topLevelWindows() -
351{ -
352 const QWindowList &list = QGuiApplicationPrivate::window_list; -
353 QWindowList topLevelWindows; -
354 for (int i = 0; i < list.size(); i++) {
evaluated: i < list.size()
TRUEFALSE
yes
Evaluation Count:865
yes
Evaluation Count:251
251-865
355 if (!list.at(i)->parent()) {
evaluated: !list.at(i)->parent()
TRUEFALSE
yes
Evaluation Count:862
yes
Evaluation Count:3
3-862
356 -
357 -
358 const bool embedded = list.at(i)->handle() && list.at(i)->handle()->isEmbedded(0);
evaluated: list.at(i)->handle()
TRUEFALSE
yes
Evaluation Count:620
yes
Evaluation Count:242
partially evaluated: list.at(i)->handle()->isEmbedded(0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:620
0-620
359 if (!embedded)
partially evaluated: !embedded
TRUEFALSE
yes
Evaluation Count:862
no
Evaluation Count:0
0-862
360 topLevelWindows.prepend(list.at(i));
executed: topLevelWindows.prepend(list.at(i));
Execution Count:862
862
361 }
executed: }
Execution Count:862
862
362 }
executed: }
Execution Count:865
865
363 return topLevelWindows;
executed: return topLevelWindows;
Execution Count:251
251
364} -
365 -
366 -
367 -
368 -
369 -
370 -
371QScreen *QGuiApplication::primaryScreen() -
372{ -
373 if (QGuiApplicationPrivate::screen_list.isEmpty())
evaluated: QGuiApplicationPrivate::screen_list.isEmpty()
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:183245
19-183245
374 return 0;
executed: return 0;
Execution Count:19
19
375 return QGuiApplicationPrivate::screen_list.at(0);
executed: return QGuiApplicationPrivate::screen_list.at(0);
Execution Count:183245
183245
376} -
377 -
378 -
379 -
380 -
381 -
382QList<QScreen *> QGuiApplication::screens() -
383{ -
384 return QGuiApplicationPrivate::screen_list;
executed: return QGuiApplicationPrivate::screen_list;
Execution Count:7253
7253
385} -
386qreal QGuiApplication::devicePixelRatio() const -
387{ -
388 -
389 static qreal topDevicePixelRatio = 0.0; -
390 if (!qFuzzyIsNull(topDevicePixelRatio)) {
evaluated: !qFuzzyIsNull(topDevicePixelRatio)
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:2
2-20
391 return topDevicePixelRatio;
executed: return topDevicePixelRatio;
Execution Count:20
20
392 } -
393 -
394 topDevicePixelRatio = 1.0; -
395 for (QForeachContainer<__typeof__(QGuiApplicationPrivate::screen_list)> _container_(QGuiApplicationPrivate::screen_list); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QScreen *screen = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
396 topDevicePixelRatio = qMax(topDevicePixelRatio, screen->devicePixelRatio()); -
397 }
executed: }
Execution Count:2
2
398 -
399 return topDevicePixelRatio;
executed: return topDevicePixelRatio;
Execution Count:2
2
400} -
401 -
402 -
403 -
404 -
405QWindow *QGuiApplication::topLevelAt(const QPoint &pos) -
406{ -
407 QList<QScreen *> screens = QGuiApplication::screens(); -
408 QList<QScreen *>::const_iterator screen = screens.constBegin(); -
409 QList<QScreen *>::const_iterator end = screens.constEnd(); -
410 -
411 while (screen != end) {
partially evaluated: screen != end
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
412 if ((*screen)->geometry().contains(pos))
partially evaluated: (*screen)->geometry().contains(pos)
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
413 return (*screen)->handle()->topLevelAt(pos);
executed: return (*screen)->handle()->topLevelAt(pos);
Execution Count:6
6
414 ++screen; -
415 }
never executed: }
0
416 return 0;
never executed: return 0;
0
417} -
418QString QGuiApplication::platformName() -
419{ -
420 return QGuiApplicationPrivate::platform_name ? 10
421 *QGuiApplicationPrivate::platform_name : QString();
executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
Execution Count:10
10
422} -
423 -
424static void init_platform(const QString &pluginArgument, const QString &platformPluginPath) -
425{ -
426 -
427 QStringList arguments = pluginArgument.split(QLatin1Char(':')); -
428 const QString name = arguments.takeFirst().toLower(); -
429 -
430 -
431 QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, arguments, platformPluginPath); -
432 if (QGuiApplicationPrivate::platform_integration) {
partially evaluated: QGuiApplicationPrivate::platform_integration
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
433 QGuiApplicationPrivate::platform_name = new QString(name); -
434 } else {
executed: }
Execution Count:276
276
435 QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath); -
436 QString fatalMessage = -
437 QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name); -
438 for (QForeachContainer<__typeof__(keys)> _container_(keys); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &key = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
439 fatalMessage.append(key + QLatin1Char('\n')); -
440 }
never executed: }
0
441 QMessageLogger("kernel/qguiapplication.cpp", 781, __PRETTY_FUNCTION__).fatal("%s", fatalMessage.toLocal8Bit().constData()); -
442 return;
never executed: return;
0
443 } -
444 -
445 -
446 -
447 const QStringList themeNames = QGuiApplicationPrivate::platform_integration->themeNames(); -
448 for (QForeachContainer<__typeof__(themeNames)> _container_(themeNames); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &themeName = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
449 QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath); -
450 if (QGuiApplicationPrivate::platform_theme)
partially evaluated: QGuiApplicationPrivate::platform_theme
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
451 break;
never executed: break;
0
452 }
executed: }
Execution Count:276
276
453 -
454 -
455 -
456 if (!QGuiApplicationPrivate::platform_theme) {
partially evaluated: !QGuiApplicationPrivate::platform_theme
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
457 for (QForeachContainer<__typeof__(themeNames)> _container_(themeNames); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &themeName = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
458 QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName); -
459 if (QGuiApplicationPrivate::platform_theme)
partially evaluated: QGuiApplicationPrivate::platform_theme
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
460 break;
executed: break;
Execution Count:276
276
461 }
never executed: }
0
462 -
463 }
executed: }
Execution Count:276
276
464 -
465 -
466 if (!QGuiApplicationPrivate::platform_theme)
partially evaluated: !QGuiApplicationPrivate::platform_theme
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
467 QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
never executed: QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
0
468 -
469 -
470 -
471 -
472 if (!arguments.isEmpty()) {
partially evaluated: !arguments.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
473 if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()) {
never evaluated: QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()
0
474 for (QForeachContainer<__typeof__(arguments)> _container_(arguments); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &argument = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
475 const int equalsPos = argument.indexOf(QLatin1Char('=')); -
476 const QByteArray name = -
477 equalsPos != -1 ? argument.left(equalsPos).toUtf8() : argument.toUtf8();
never evaluated: equalsPos != -1
0
478 const QVariant value = -
479 equalsPos != -1 ? QVariant(argument.mid(equalsPos + 1)) : QVariant(true);
never evaluated: equalsPos != -1
0
480 nativeInterface->setProperty(name.constData(), value); -
481 }
never executed: }
0
482 }
never executed: }
0
483 }
never executed: }
0
484 -
485 -
486 fontSmoothingGamma = QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal(); -
487}
executed: }
Execution Count:276
276
488 -
489static void init_plugins(const QList<QByteArray> &pluginList) -
490{ -
491 for (int i = 0; i < pluginList.count(); ++i) {
evaluated: i < pluginList.count()
TRUEFALSE
yes
Evaluation Count:277
yes
Evaluation Count:276
276-277
492 QByteArray pluginSpec = pluginList.at(i); -
493 int colonPos = pluginSpec.indexOf(':'); -
494 QObject *plugin; -
495 if (colonPos < 0)
partially evaluated: colonPos < 0
TRUEFALSE
yes
Evaluation Count:277
no
Evaluation Count:0
0-277
496 plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString());
executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString());
Execution Count:277
277
497 else -
498 plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), 0
499 QLatin1String(pluginSpec.mid(colonPos+1)));
never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1)));
0
500 if (plugin)
evaluated: plugin
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:276
1-276
501 QGuiApplicationPrivate::generic_plugin_list.append(plugin);
executed: QGuiApplicationPrivate::generic_plugin_list.append(plugin);
Execution Count:1
1
502 }
executed: }
Execution Count:277
277
503}
executed: }
Execution Count:276
276
504 -
505void QGuiApplicationPrivate::createPlatformIntegration() -
506{ -
507 -
508 -
509 -
510 QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true); -
511 -
512 -
513 QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); -
514 QByteArray platformName; -
515 -
516 platformName = "xcb"; -
517 -
518 QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM"); -
519 if (!platformNameEnv.isEmpty()) {
partially evaluated: !platformNameEnv.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
520 platformName = platformNameEnv; -
521 }
never executed: }
0
522 -
523 -
524 -
525 int j = argc ? 1 : 0;
evaluated: argc
TRUEFALSE
yes
Evaluation Count:211
yes
Evaluation Count:65
65-211
526 for (int i=1; i<argc; i++) {
evaluated: i<argc
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:276
8-276
527 if (argv[i] && *argv[i] != '-') {
partially evaluated: argv[i]
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
evaluated: *argv[i] != '-'
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
0-8
528 argv[j++] = argv[i]; -
529 continue;
executed: continue;
Execution Count:3
3
530 } -
531 QByteArray arg = argv[i]; -
532 if (arg == "-platformpluginpath") {
partially evaluated: arg == "-platformpluginpath"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
533 if (++i < argc)
never evaluated: ++i < argc
0
534 platformPluginPath = QLatin1String(argv[i]);
never executed: platformPluginPath = QLatin1String(argv[i]);
0
535 } else if (arg == "-platform") {
partially evaluated: arg == "-platform"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
never executed: }
0-5
536 if (++i < argc)
never evaluated: ++i < argc
0
537 platformName = argv[i];
never executed: platformName = argv[i];
0
538 } else {
never executed: }
0
539 argv[j++] = argv[i]; -
540 }
executed: }
Execution Count:5
5
541 } -
542 -
543 if (j < argc) {
partially evaluated: j < argc
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
544 argv[j] = 0; -
545 argc = j; -
546 }
never executed: }
0
547 -
548 init_platform(QLatin1String(platformName), platformPluginPath); -
549 -
550}
executed: }
Execution Count:276
276
551 -
552void QGuiApplicationPrivate::createEventDispatcher() -
553{ -
554 if (platform_integration == 0)
partially evaluated: platform_integration == 0
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
555 createPlatformIntegration();
executed: createPlatformIntegration();
Execution Count:276
276
556 -
557 if (!eventDispatcher) {
partially evaluated: !eventDispatcher
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
558 QAbstractEventDispatcher *eventDispatcher = platform_integration->guiThreadEventDispatcher(); -
559 setEventDispatcher(eventDispatcher); -
560 }
never executed: }
0
561}
executed: }
Execution Count:276
276
562 -
563void QGuiApplicationPrivate::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher) -
564{ -
565 QGuiApplication * const q = q_func(); -
566 -
567 if (!QCoreApplicationPrivate::eventDispatcher) {
partially evaluated: !QCoreApplicationPrivate::eventDispatcher
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
568 QCoreApplicationPrivate::eventDispatcher = eventDispatcher; -
569 QCoreApplicationPrivate::eventDispatcher->setParent(q); -
570 threadData->eventDispatcher = eventDispatcher; -
571 }
executed: }
Execution Count:276
276
572 -
573}
executed: }
Execution Count:276
276
574void QGuiApplicationPrivate::init() -
575{ -
576 bool doGrabUnderDebugger = false; -
577 QList<QByteArray> pluginList; -
578 -
579 -
580 int j = argc ? 1 : 0;
evaluated: argc
TRUEFALSE
yes
Evaluation Count:211
yes
Evaluation Count:65
65-211
581 for (int i=1; i<argc; i++) {
evaluated: i<argc
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:276
7-276
582 if (argv[i] && *argv[i] != '-') {
partially evaluated: argv[i]
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
evaluated: *argv[i] != '-'
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:5
0-7
583 argv[j++] = argv[i]; -
584 continue;
executed: continue;
Execution Count:2
2
585 } -
586 QByteArray arg = argv[i]; -
587 if (arg == "-plugin") {
evaluated: arg == "-plugin"
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
1-4
588 if (++i < argc)
partially evaluated: ++i < argc
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
589 pluginList << argv[i];
executed: pluginList << argv[i];
Execution Count:1
1
590 } else if (arg == "-reverse") {
evaluated: arg == "-reverse"
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
executed: }
Execution Count:1
1-3
591 force_reverse = true; -
592 QGuiApplication::setLayoutDirection(Qt::RightToLeft); -
593 } else if (arg == "-nograb") {
partially evaluated: arg == "-nograb"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
executed: }
Execution Count:1
0-3
594 QGuiApplicationPrivate::noGrab = true; -
595 } else if (arg == "-dograb") {
never executed: }
partially evaluated: arg == "-dograb"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
596 doGrabUnderDebugger = true; -
597 -
598 } else if (arg == "-session" && i < argc-1) {
never executed: }
partially evaluated: arg == "-session"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
never evaluated: i < argc-1
0-3
599 ++i; -
600 if (argv[i] && *argv[i]) {
never evaluated: argv[i]
never evaluated: *argv[i]
0
601 session_id = QString::fromLatin1(argv[i]); -
602 int p = session_id.indexOf(QLatin1Char('_')); -
603 if (p >= 0) {
never evaluated: p >= 0
0
604 session_key = session_id.mid(p +1); -
605 session_id = session_id.left(p); -
606 }
never executed: }
0
607 is_session_restored = true; -
608 }
never executed: }
0
609 -
610 } else {
never executed: }
0
611 argv[j++] = argv[i]; -
612 }
executed: }
Execution Count:3
3
613 } -
614 -
615 if (j < argc) {
evaluated: j < argc
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:274
2-274
616 argv[j] = 0; -
617 argc = j; -
618 }
executed: }
Execution Count:2
2
619 (void)doGrabUnderDebugger; -
620 -
621 -
622 -
623 for (QForeachContainer<__typeof__(qgetenv("QT_QPA_GENERIC_PLUGINS").split(','))> _container_(qgetenv("QT_QPA_GENERIC_PLUGINS").split(',')); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QByteArray &plugin = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
624 pluginList << plugin;
executed: pluginList << plugin;
Execution Count:276
276
625 -
626 if (platform_integration == 0)
partially evaluated: platform_integration == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
627 createPlatformIntegration();
never executed: createPlatformIntegration();
0
628 -
629 -
630 qInitDrawhelperAsm(); -
631 -
632 qInitImageConversions(); -
633 -
634 QFont::initialize(); -
635 -
636 -
637 QCursorData::initialize(); -
638 -
639 -
640 -
641 qRegisterGuiVariant(); -
642 -
643 QWindowSystemInterfacePrivate::eventTime.start(); -
644 -
645 is_app_running = true; -
646 init_plugins(pluginList); -
647 QWindowSystemInterface::flushWindowSystemEvents(); -
648 -
649 QGuiApplication * const q = q_func(); -
650 -
651 -
652 -
653 session_manager = new QSessionManager(q, session_id, session_key); -
654 -
655 -
656}
executed: }
Execution Count:276
276
657 -
658extern void qt_cleanupFontDatabase(); -
659 -
660QGuiApplicationPrivate::~QGuiApplicationPrivate() -
661{ -
662 is_app_closing = true; -
663 is_app_running = false; -
664 -
665 for (int i = 0; i < generic_plugin_list.count(); ++i)
evaluated: i < generic_plugin_list.count()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:258
1-258
666 delete generic_plugin_list.at(i);
executed: delete generic_plugin_list.at(i);
Execution Count:1
1
667 generic_plugin_list.clear(); -
668 -
669 clearFontUnlocked(); -
670 -
671 QFont::cleanup(); -
672 -
673 -
674 QCursorData::cleanup(); -
675 -
676 -
677 layout_direction = Qt::LeftToRight; -
678 -
679 cleanupThreadData(); -
680 -
681 delete styleHints; -
682 delete inputMethod; -
683 -
684 qt_cleanupFontDatabase(); -
685 -
686 QPixmapCache::clear(); -
687 -
688 delete platform_theme; -
689 platform_theme = 0; -
690 delete platform_integration; -
691 platform_integration = 0; -
692 delete m_gammaTables.load(); -
693}
executed: }
Execution Count:258
258
694Qt::KeyboardModifiers QGuiApplication::keyboardModifiers() -
695{ -
696 return QGuiApplicationPrivate::modifier_buttons;
executed: return QGuiApplicationPrivate::modifier_buttons;
Execution Count:536
536
697} -
698Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers() -
699{ -
700 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); -
701 return pi->queryKeyboardModifiers();
never executed: return pi->queryKeyboardModifiers();
0
702} -
703Qt::MouseButtons QGuiApplication::mouseButtons() -
704{ -
705 return QGuiApplicationPrivate::mouse_buttons;
never executed: return QGuiApplicationPrivate::mouse_buttons;
0
706} -
707 -
708 -
709 -
710 -
711 -
712QPlatformNativeInterface *QGuiApplication::platformNativeInterface() -
713{ -
714 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); -
715 return pi ? pi->nativeInterface() : 0;
executed: return pi ? pi->nativeInterface() : 0;
Execution Count:1
1
716} -
717int QGuiApplication::exec() -
718{ -
719 -
720 QAccessible::setRootObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))); -
721 -
722 return QCoreApplication::exec();
executed: return QCoreApplication::exec();
Execution Count:39
39
723} -
724 -
725 -
726 -
727bool QGuiApplication::notify(QObject *object, QEvent *event) -
728{ -
729 -
730 if (event->type() == QEvent::KeyPress) {
evaluated: event->type() == QEvent::KeyPress
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:103939
7-103939
731 -
732 QWindow *w = qobject_cast<QWindow *>(object); -
733 QObject *focus = w ? w->focusObject() : 0;
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
734 if (!focus)
partially evaluated: !focus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
735 focus = object;
never executed: focus = object;
0
736 if (QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, static_cast<QKeyEvent *>(event)))
partially evaluated: QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, static_cast<QKeyEvent *>(event))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
737 return true;
never executed: return true;
0
738 }
executed: }
Execution Count:7
7
739 -
740 -
741 if (object->isWindowType())
evaluated: object->isWindowType()
TRUEFALSE
yes
Evaluation Count:640
yes
Evaluation Count:103306
640-103306
742 QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
executed: QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
Execution Count:640
640
743 return QCoreApplication::notify(object, event);
executed: return QCoreApplication::notify(object, event);
Execution Count:103946
103946
744} -
745 -
746 -
747 -
748bool QGuiApplication::event(QEvent *e) -
749{ -
750 if(e->type() == QEvent::LanguageChange) {
evaluated: e->type() == QEvent::LanguageChange
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:1704
52-1704
751 setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight); -
752 }
executed: }
Execution Count:52
52
753 return QCoreApplication::event(e);
executed: return QCoreApplication::event(e);
Execution Count:1756
1756
754} -
755 -
756 -
757 -
758 -
759bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) -
760{ -
761 return QCoreApplication::compressEvent(event, receiver, postedEvents);
executed: return QCoreApplication::compressEvent(event, receiver, postedEvents);
Execution Count:12256
12256
762} -
763 -
764void QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event) -
765{ -
766 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12941
0-12941
767 return;
never executed: return;
0
768 QPlatformWindow *platformWindow = window->handle(); -
769 if (!platformWindow)
evaluated: !platformWindow
TRUEFALSE
yes
Evaluation Count:223
yes
Evaluation Count:12718
223-12718
770 return;
executed: return;
Execution Count:223
223
771 -
772 if (event->spontaneous())
evaluated: event->spontaneous()
TRUEFALSE
yes
Evaluation Count:7113
yes
Evaluation Count:5605
5605-7113
773 return;
executed: return;
Execution Count:7113
7113
774 -
775 platformWindow->windowEvent(event); -
776}
executed: }
Execution Count:5605
5605
777 -
778bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) -
779{ -
780 return window->nativeEvent(eventType, message, result);
executed: return window->nativeEvent(eventType, message, result);
Execution Count:40010
40010
781} -
782 -
783void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e) -
784{ -
785 switch(e->type) { -
786 case QWindowSystemInterfacePrivate::FrameStrutMouse: -
787 case QWindowSystemInterfacePrivate::Mouse: -
788 QGuiApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e)); -
789 break;
executed: break;
Execution Count:238
238
790 case QWindowSystemInterfacePrivate::Wheel: -
791 QGuiApplicationPrivate::processWheelEvent(static_cast<QWindowSystemInterfacePrivate::WheelEvent *>(e)); -
792 break;
executed: break;
Execution Count:3
3
793 case QWindowSystemInterfacePrivate::Key: -
794 QGuiApplicationPrivate::processKeyEvent(static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e)); -
795 break;
executed: break;
Execution Count:62
62
796 case QWindowSystemInterfacePrivate::Touch: -
797 QGuiApplicationPrivate::processTouchEvent(static_cast<QWindowSystemInterfacePrivate::TouchEvent *>(e)); -
798 break;
executed: break;
Execution Count:24
24
799 case QWindowSystemInterfacePrivate::GeometryChange: -
800 QGuiApplicationPrivate::processGeometryChangeEvent(static_cast<QWindowSystemInterfacePrivate::GeometryChangeEvent*>(e)); -
801 break;
executed: break;
Execution Count:1039
1039
802 case QWindowSystemInterfacePrivate::Enter: -
803 QGuiApplicationPrivate::processEnterEvent(static_cast<QWindowSystemInterfacePrivate::EnterEvent *>(e)); -
804 break;
executed: break;
Execution Count:748
748
805 case QWindowSystemInterfacePrivate::Leave: -
806 QGuiApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e)); -
807 break;
executed: break;
Execution Count:547
547
808 case QWindowSystemInterfacePrivate::ActivatedWindow: -
809 QGuiApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e)); -
810 break;
executed: break;
Execution Count:1040
1040
811 case QWindowSystemInterfacePrivate::WindowStateChanged: -
812 QGuiApplicationPrivate::processWindowStateChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowStateChangedEvent *>(e)); -
813 break;
executed: break;
Execution Count:736
736
814 case QWindowSystemInterfacePrivate::Close: -
815 QGuiApplicationPrivate::processCloseEvent( -
816 static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e)); -
817 break;
never executed: break;
0
818 case QWindowSystemInterfacePrivate::ScreenOrientation: -
819 QGuiApplicationPrivate::reportScreenOrientationChange( -
820 static_cast<QWindowSystemInterfacePrivate::ScreenOrientationEvent *>(e)); -
821 break;
executed: break;
Execution Count:7
7
822 case QWindowSystemInterfacePrivate::ScreenGeometry: -
823 QGuiApplicationPrivate::reportGeometryChange( -
824 static_cast<QWindowSystemInterfacePrivate::ScreenGeometryEvent *>(e)); -
825 break;
never executed: break;
0
826 case QWindowSystemInterfacePrivate::ScreenAvailableGeometry: -
827 QGuiApplicationPrivate::reportAvailableGeometryChange( -
828 static_cast<QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *>(e)); -
829 break;
never executed: break;
0
830 case QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch: -
831 QGuiApplicationPrivate::reportLogicalDotsPerInchChange( -
832 static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e)); -
833 break;
never executed: break;
0
834 case QWindowSystemInterfacePrivate::ScreenRefreshRate: -
835 QGuiApplicationPrivate::reportRefreshRateChange( -
836 static_cast<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *>(e)); -
837 break;
never executed: break;
0
838 case QWindowSystemInterfacePrivate::ThemeChange: -
839 QGuiApplicationPrivate::processThemeChanged( -
840 static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e)); -
841 break;
never executed: break;
0
842 case QWindowSystemInterfacePrivate::Expose: -
843 QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e)); -
844 break;
executed: break;
Execution Count:1873
1873
845 case QWindowSystemInterfacePrivate::Tablet: -
846 QGuiApplicationPrivate::processTabletEvent( -
847 static_cast<QWindowSystemInterfacePrivate::TabletEvent *>(e)); -
848 break;
executed: break;
Execution Count:2
2
849 case QWindowSystemInterfacePrivate::TabletEnterProximity: -
850 QGuiApplicationPrivate::processTabletEnterProximityEvent( -
851 static_cast<QWindowSystemInterfacePrivate::TabletEnterProximityEvent *>(e)); -
852 break;
executed: break;
Execution Count:1
1
853 case QWindowSystemInterfacePrivate::TabletLeaveProximity: -
854 QGuiApplicationPrivate::processTabletLeaveProximityEvent( -
855 static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e)); -
856 break;
executed: break;
Execution Count:1
1
857 case QWindowSystemInterfacePrivate::PlatformPanel: -
858 QGuiApplicationPrivate::processPlatformPanelEvent( -
859 static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e)); -
860 break;
never executed: break;
0
861 case QWindowSystemInterfacePrivate::FileOpen: -
862 QGuiApplicationPrivate::processFileOpenEvent( -
863 static_cast<QWindowSystemInterfacePrivate::FileOpenEvent *>(e)); -
864 break;
never executed: break;
0
865 -
866 case QWindowSystemInterfacePrivate::ContextMenu: -
867 QGuiApplicationPrivate::processContextMenuEvent( -
868 static_cast<QWindowSystemInterfacePrivate::ContextMenuEvent *>(e)); -
869 break;
never executed: break;
0
870 -
871 default: -
872 QMessageLogger("kernel/qguiapplication.cpp", 1341, __PRETTY_FUNCTION__).warning() << "Unknown user input event type:" << e->type; -
873 break;
never executed: break;
0
874 } -
875}
executed: }
Execution Count:6321
6321
876 -
877void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e) -
878{ -
879 QEvent::Type type; -
880 -
881 Qt::MouseButtons stateChange = e->buttons ^ buttons; -
882 const bool frameStrut = e->type == QWindowSystemInterfacePrivate::FrameStrutMouse; -
883 if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition && (stateChange != Qt::NoButton)) {
evaluated: e->globalPos != QGuiApplicationPrivate::lastCursorPosition
TRUEFALSE
yes
Evaluation Count:123
yes
Evaluation Count:120
evaluated: (stateChange != Qt::NoButton)
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:115
8-123
884 QWindowSystemInterfacePrivate::MouseEvent * newMouseEvent = -
885 new QWindowSystemInterfacePrivate::MouseEvent(e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers); -
886 QWindowSystemInterfacePrivate::windowSystemEventQueue.prepend(newMouseEvent); -
887 stateChange = Qt::NoButton; -
888 }
executed: }
Execution Count:8
8
889 -
890 QWindow *window = e->window.data(); -
891 modifier_buttons = e->modifiers; -
892 -
893 QPointF localPoint = e->localPos; -
894 QPointF globalPoint = e->globalPos; -
895 -
896 if (e->nullWindow) {
evaluated: e->nullWindow
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:237
6-237
897 window = QGuiApplication::topLevelAt(globalPoint.toPoint()); -
898 if (window) {
evaluated: window
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
899 QPointF delta = globalPoint - globalPoint.toPoint(); -
900 localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta; -
901 }
executed: }
Execution Count:3
3
902 }
executed: }
Execution Count:6
6
903 -
904 Qt::MouseButton button = Qt::NoButton; -
905 bool doubleClick = false; -
906 -
907 if (QGuiApplicationPrivate::lastCursorPosition != globalPoint) {
evaluated: QGuiApplicationPrivate::lastCursorPosition != globalPoint
TRUEFALSE
yes
Evaluation Count:123
yes
Evaluation Count:120
120-123
908 type = frameStrut ? QEvent::NonClientAreaMouseMove : QEvent::MouseMove;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
909 QGuiApplicationPrivate::lastCursorPosition = globalPoint; -
910 if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance||
evaluated: qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance
TRUEFALSE
yes
Evaluation Count:121
yes
Evaluation Count:2
2-121
911 qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance)
evaluated: qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
912 mousePressButton = Qt::NoButton;
executed: mousePressButton = Qt::NoButton;
Execution Count:122
122
913 } else {
executed: }
Execution Count:123
123
914 for (int check = Qt::LeftButton; -
915 check <= int(Qt::MaxMouseButton);
partially evaluated: check <= int(Qt::MaxMouseButton)
TRUEFALSE
yes
Evaluation Count:182
no
Evaluation Count:0
0-182
916 check = check << 1) { -
917 if (check & stateChange) {
evaluated: check & stateChange
TRUEFALSE
yes
Evaluation Count:120
yes
Evaluation Count:62
62-120
918 button = Qt::MouseButton(check); -
919 break;
executed: break;
Execution Count:120
120
920 } -
921 }
executed: }
Execution Count:62
62
922 if (button == Qt::NoButton) {
partially evaluated: button == Qt::NoButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
0-120
923 -
924 return;
never executed: return;
0
925 } -
926 mouse_buttons = buttons = e->buttons; -
927 if (button & e->buttons) {
evaluated: button & e->buttons
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:60
60
928 ulong doubleClickInterval = static_cast<ulong>((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->mouseDoubleClickInterval()); -
929 doubleClick = e->timestamp - mousePressTime < doubleClickInterval && button == mousePressButton;
evaluated: e->timestamp - mousePressTime < doubleClickInterval
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:10
evaluated: button == mousePressButton
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:31
10-50
930 type = frameStrut ? QEvent::NonClientAreaMouseButtonPress : QEvent::MouseButtonPress;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
931 mousePressTime = e->timestamp; -
932 mousePressButton = button; -
933 const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint(); -
934 mousePressX = point.x(); -
935 mousePressY = point.y(); -
936 } else {
executed: }
Execution Count:60
60
937 type = frameStrut ? QEvent::NonClientAreaMouseButtonRelease : QEvent::MouseButtonRelease;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
938 }
executed: }
Execution Count:60
60
939 } -
940 -
941 if (!window)
evaluated: !window
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:240
3-240
942 return;
executed: return;
Execution Count:3
3
943 -
944 if (window->d_func()->blockedByModalWindow) {
evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:237
3-237
945 -
946 return;
executed: return;
Execution Count:3
3
947 } -
948 -
949 QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers); -
950 ev.setTimestamp(e->timestamp); -
951 -
952 if (const QScreen *screen = window->screen())
partially evaluated: const QScreen *screen = window->screen()
TRUEFALSE
yes
Evaluation Count:237
no
Evaluation Count:0
0-237
953 if (QPlatformCursor *cursor = screen->handle()->cursor())
partially evaluated: QPlatformCursor *cursor = screen->handle()->cursor()
TRUEFALSE
yes
Evaluation Count:237
no
Evaluation Count:0
0-237
954 cursor->pointerEvent(ev);
executed: cursor->pointerEvent(ev);
Execution Count:237
237
955 -
956 QGuiApplication::sendSpontaneousEvent(window, &ev); -
957 if (!e->synthetic && !ev.isAccepted()
evaluated: !e->synthetic
TRUEFALSE
yes
Evaluation Count:232
yes
Evaluation Count:5
evaluated: !ev.isAccepted()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:221
5-232
958 && !frameStrut
partially evaluated: !frameStrut
TRUEFALSE
yes
Evaluation Count:11
no
Evaluation Count:0
0-11
959 && (static_cast<QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)) {
evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:6
5-6
960 if (!m_fakeTouchDevice) {
evaluated: !m_fakeTouchDevice
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
1-4
961 m_fakeTouchDevice = new QTouchDevice; -
962 QWindowSystemInterface::registerTouchDevice(m_fakeTouchDevice); -
963 }
executed: }
Execution Count:1
1
964 QList<QWindowSystemInterface::TouchPoint> points; -
965 QWindowSystemInterface::TouchPoint point; -
966 point.id = 1; -
967 point.area = QRectF(globalPoint.x() - 2, globalPoint.y() - 2, 4, 4); -
968 -
969 -
970 -
971 -
972 if (type == QEvent::MouseButtonPress && button == Qt::LeftButton) {
evaluated: type == QEvent::MouseButtonPress
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
partially evaluated: button == Qt::LeftButton
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-3
973 point.state = Qt::TouchPointPressed; -
974 } else if (type == QEvent::MouseButtonRelease && button == Qt::LeftButton) {
executed: }
Execution Count:2
evaluated: type == QEvent::MouseButtonRelease
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
partially evaluated: button == Qt::LeftButton
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
975 point.state = Qt::TouchPointReleased; -
976 } else if (type == QEvent::MouseMove && (buttons & Qt::LeftButton)) {
executed: }
Execution Count:2
partially evaluated: type == QEvent::MouseMove
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: (buttons & Qt::LeftButton)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-2
977 point.state = Qt::TouchPointMoved; -
978 } else {
never executed: }
0
979 return;
executed: return;
Execution Count:1
1
980 } -
981 -
982 points << point; -
983 -
984 QEvent::Type type; -
985 QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::convertTouchPoints(points, &type); -
986 -
987 QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers); -
988 fake.synthetic = true; -
989 processTouchEvent(&fake); -
990 }
executed: }
Execution Count:4
4
991 if (doubleClick) {
evaluated: doubleClick
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:217
19-217
992 mousePressButton = Qt::NoButton; -
993 const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
994 QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint, -
995 button, buttons, e->modifiers); -
996 dblClickEvent.setTimestamp(e->timestamp); -
997 QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent); -
998 }
executed: }
Execution Count:19
19
999}
executed: }
Execution Count:236
236
1000 -
1001void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e) -
1002{ -
1003 -
1004 QWindow *window = e->window.data(); -
1005 QPointF globalPoint = e->globalPos; -
1006 QPointF localPoint = e->localPos; -
1007 -
1008 if (e->nullWindow) {
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1009 window = QGuiApplication::topLevelAt(globalPoint.toPoint()); -
1010 if (window) {
never evaluated: window
0
1011 QPointF delta = globalPoint - globalPoint.toPoint(); -
1012 localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta; -
1013 }
never executed: }
0
1014 }
never executed: }
0
1015 -
1016 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1017 return;
never executed: return;
0
1018 -
1019 QGuiApplicationPrivate::lastCursorPosition = globalPoint; -
1020 modifier_buttons = e->modifiers; -
1021 -
1022 if (window->d_func()->blockedByModalWindow) {
partially evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1023 -
1024 return;
never executed: return;
0
1025 } -
1026 -
1027 QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers); -
1028 ev.setTimestamp(e->timestamp); -
1029 QGuiApplication::sendSpontaneousEvent(window, &ev); -
1030 -
1031}
executed: }
Execution Count:3
3
1032 -
1033 -
1034 -
1035void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e) -
1036{ -
1037 QWindow *window = e->window.data(); -
1038 modifier_buttons = e->modifiers; -
1039 if (e->nullWindow)
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
1040 window = QGuiApplication::focusWindow();
never executed: window = QGuiApplication::focusWindow();
0
1041 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
1042 return;
never executed: return;
0
1043 if (window->d_func()->blockedByModalWindow) {
partially evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
1044 -
1045 return;
never executed: return;
0
1046 } -
1047 -
1048 QKeyEvent ev(e->keyType, e->key, e->modifiers, -
1049 e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, -
1050 e->unicode, e->repeat, e->repeatCount); -
1051 ev.setTimestamp(e->timestamp); -
1052 QGuiApplication::sendSpontaneousEvent(window, &ev); -
1053}
executed: }
Execution Count:62
62
1054 -
1055void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e) -
1056{ -
1057 if (!e->enter)
partially evaluated: !e->enter
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:748
0-748
1058 return;
never executed: return;
0
1059 if (e->enter.data()->d_func()->blockedByModalWindow) {
evaluated: e->enter.data()->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:49
yes
Evaluation Count:699
49-699
1060 -
1061 return;
executed: return;
Execution Count:49
49
1062 } -
1063 -
1064 currentMouseWindow = e->enter; -
1065 -
1066 QEnterEvent event(e->localPos, e->localPos, e->globalPos); -
1067 QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event); -
1068}
executed: }
Execution Count:699
699
1069 -
1070void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e) -
1071{ -
1072 if (!e->leave)
evaluated: !e->leave
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:537
10-537
1073 return;
executed: return;
Execution Count:10
10
1074 if (e->leave.data()->d_func()->blockedByModalWindow) {
evaluated: e->leave.data()->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:56
yes
Evaluation Count:481
56-481
1075 -
1076 return;
executed: return;
Execution Count:56
56
1077 } -
1078 -
1079 currentMouseWindow = 0; -
1080 -
1081 QEvent event(QEvent::Leave); -
1082 QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event); -
1083}
executed: }
Execution Count:481
481
1084 -
1085void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e) -
1086{ -
1087 QWindow *previous = QGuiApplicationPrivate::focus_window; -
1088 QWindow *newFocus = e->activated.data(); -
1089 -
1090 if (previous == newFocus)
evaluated: previous == newFocus
TRUEFALSE
yes
Evaluation Count:72
yes
Evaluation Count:968
72-968
1091 return;
executed: return;
Execution Count:72
72
1092 -
1093 QObject *previousFocusObject = previous ? previous->focusObject() : 0;
evaluated: previous
TRUEFALSE
yes
Evaluation Count:308
yes
Evaluation Count:660
308-660
1094 -
1095 if (previous) {
evaluated: previous
TRUEFALSE
yes
Evaluation Count:308
yes
Evaluation Count:660
308-660
1096 QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); -
1097 QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange); -
1098 }
executed: }
Execution Count:308
308
1099 -
1100 QGuiApplicationPrivate::focus_window = newFocus; -
1101 -
1102 if (previous) {
evaluated: previous
TRUEFALSE
yes
Evaluation Count:308
yes
Evaluation Count:660
308-660
1103 QFocusEvent focusOut(QEvent::FocusOut); -
1104 QCoreApplication::sendSpontaneousEvent(previous, &focusOut); -
1105 QObject::disconnect(previous, "2""focusObjectChanged(QObject*)", -
1106 (static_cast<QGuiApplication *>(QCoreApplication::instance())), "1""_q_updateFocusObject(QObject*)"); -
1107 } else {
executed: }
Execution Count:308
308
1108 QEvent appActivate(QEvent::ApplicationActivate); -
1109 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appActivate); -
1110 }
executed: }
Execution Count:660
660
1111 -
1112 if (QGuiApplicationPrivate::focus_window) {
evaluated: QGuiApplicationPrivate::focus_window
TRUEFALSE
yes
Evaluation Count:923
yes
Evaluation Count:45
45-923
1113 QFocusEvent focusIn(QEvent::FocusIn); -
1114 QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn); -
1115 QObject::connect(QGuiApplicationPrivate::focus_window, "2""focusObjectChanged(QObject*)", -
1116 (static_cast<QGuiApplication *>(QCoreApplication::instance())), "1""_q_updateFocusObject(QObject*)"); -
1117 } else {
executed: }
Execution Count:923
923
1118 QEvent appActivate(QEvent::ApplicationDeactivate); -
1119 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appActivate); -
1120 }
executed: }
Execution Count:45
45
1121 -
1122 if (self) {
partially evaluated: self
TRUEFALSE
yes
Evaluation Count:968
no
Evaluation Count:0
0-968
1123 self->notifyActiveWindowChange(previous); -
1124 -
1125 if (previousFocusObject != (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject())
evaluated: previousFocusObject != (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()
TRUEFALSE
yes
Evaluation Count:965
yes
Evaluation Count:3
3-965
1126 self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject());
executed: self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject());
Execution Count:965
965
1127 }
executed: }
Execution Count:968
968
1128 -
1129 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusWindowChanged(newFocus); -
1130}
executed: }
Execution Count:968
968
1131 -
1132void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse) -
1133{ -
1134 if (QWindow *window = wse->window.data()) {
evaluated: QWindow *window = wse->window.data()
TRUEFALSE
yes
Evaluation Count:735
yes
Evaluation Count:1
1-735
1135 QWindowStateChangeEvent e(window->windowState()); -
1136 window->d_func()->windowState = wse->newState; -
1137 QGuiApplication::sendSpontaneousEvent(window, &e); -
1138 }
executed: }
Execution Count:735
735
1139}
executed: }
Execution Count:736
736
1140 -
1141void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce) -
1142{ -
1143 if (self)
never evaluated: self
0
1144 self->notifyThemeChanged();
never executed: self->notifyThemeChanged();
0
1145 if (QWindow *window = tce->window.data()) {
never evaluated: QWindow *window = tce->window.data()
0
1146 QEvent e(QEvent::ThemeChange); -
1147 QGuiApplication::sendSpontaneousEvent(window, &e); -
1148 }
never executed: }
0
1149}
never executed: }
0
1150 -
1151void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e) -
1152{ -
1153 if (e->tlw.isNull())
evaluated: e->tlw.isNull()
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:1026
13-1026
1154 return;
executed: return;
Execution Count:13
13
1155 -
1156 QWindow *window = e->tlw.data(); -
1157 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1026
0-1026
1158 return;
never executed: return;
0
1159 -
1160 QRect newRect = e->newGeometry; -
1161 QRect cr = window->d_func()->geometry; -
1162 -
1163 bool isResize = cr.size() != newRect.size(); -
1164 bool isMove = cr.topLeft() != newRect.topLeft(); -
1165 -
1166 window->d_func()->geometry = newRect; -
1167 -
1168 if (isResize || window->d_func()->resizeEventPending) {
evaluated: isResize
TRUEFALSE
yes
Evaluation Count:597
yes
Evaluation Count:429
evaluated: window->d_func()->resizeEventPending
TRUEFALSE
yes
Evaluation Count:141
yes
Evaluation Count:288
141-597
1169 QResizeEvent e(newRect.size(), cr.size()); -
1170 QGuiApplication::sendSpontaneousEvent(window, &e); -
1171 -
1172 window->d_func()->resizeEventPending = false; -
1173 -
1174 if (cr.width() != newRect.width())
evaluated: cr.width() != newRect.width()
TRUEFALSE
yes
Evaluation Count:583
yes
Evaluation Count:155
155-583
1175 window->widthChanged(newRect.width());
executed: window->widthChanged(newRect.width());
Execution Count:583
583
1176 if (cr.height() != newRect.height())
evaluated: cr.height() != newRect.height()
TRUEFALSE
yes
Evaluation Count:585
yes
Evaluation Count:153
153-585
1177 window->heightChanged(newRect.height());
executed: window->heightChanged(newRect.height());
Execution Count:585
585
1178 }
executed: }
Execution Count:738
738
1179 -
1180 if (isMove) {
evaluated: isMove
TRUEFALSE
yes
Evaluation Count:691
yes
Evaluation Count:335
335-691
1181 -
1182 QMoveEvent e(newRect.topLeft(), cr.topLeft()); -
1183 QGuiApplication::sendSpontaneousEvent(window, &e); -
1184 -
1185 if (cr.x() != newRect.x())
evaluated: cr.x() != newRect.x()
TRUEFALSE
yes
Evaluation Count:675
yes
Evaluation Count:16
16-675
1186 window->xChanged(newRect.x());
executed: window->xChanged(newRect.x());
Execution Count:675
675
1187 if (cr.y() != newRect.y())
evaluated: cr.y() != newRect.y()
TRUEFALSE
yes
Evaluation Count:689
yes
Evaluation Count:2
2-689
1188 window->yChanged(newRect.y());
executed: window->yChanged(newRect.y());
Execution Count:689
689
1189 }
executed: }
Execution Count:691
691
1190}
executed: }
Execution Count:1026
1026
1191 -
1192void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e) -
1193{ -
1194 if (e->window.isNull())
never evaluated: e->window.isNull()
0
1195 return;
never executed: return;
0
1196 if (e->window.data()->d_func()->blockedByModalWindow) {
never evaluated: e->window.data()->d_func()->blockedByModalWindow
0
1197 -
1198 return;
never executed: return;
0
1199 } -
1200 -
1201 QCloseEvent event; -
1202 QGuiApplication::sendSpontaneousEvent(e->window.data(), &event); -
1203}
never executed: }
0
1204 -
1205void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e) -
1206{ -
1207 if (e->fileName.isEmpty())
never evaluated: e->fileName.isEmpty()
0
1208 return;
never executed: return;
0
1209 -
1210 QFileOpenEvent event(e->fileName); -
1211 QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &event); -
1212}
never executed: }
0
1213 -
1214void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e) -
1215{ -
1216 -
1217 QEvent::Type type = QEvent::TabletMove; -
1218 if (e->down != tabletState) {
partially evaluated: e->down != tabletState
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1219 type = e->down ? QEvent::TabletPress : QEvent::TabletRelease;
evaluated: e->down
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1220 tabletState = e->down; -
1221 }
executed: }
Execution Count:2
2
1222 -
1223 QWindow *window = e->window.data(); -
1224 modifier_buttons = e->modifiers; -
1225 -
1226 bool localValid = true; -
1227 -
1228 -
1229 -
1230 if (type == QEvent::TabletPress) {
evaluated: type == QEvent::TabletPress
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1231 if (e->nullWindow) {
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1232 window = QGuiApplication::topLevelAt(e->global.toPoint()); -
1233 localValid = false; -
1234 }
never executed: }
0
1235 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1236 return;
never executed: return;
0
1237 tabletPressTarget = window; -
1238 } else {
executed: }
Execution Count:1
1
1239 if (e->nullWindow) {
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1240 window = tabletPressTarget; -
1241 localValid = false; -
1242 }
never executed: }
0
1243 if (type == QEvent::TabletRelease)
partially evaluated: type == QEvent::TabletRelease
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1244 tabletPressTarget = 0;
executed: tabletPressTarget = 0;
Execution Count:1
1
1245 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1246 return;
never executed: return;
0
1247 }
executed: }
Execution Count:1
1
1248 QPointF local = e->local; -
1249 if (!localValid) {
partially evaluated: !localValid
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1250 QPointF delta = e->global - e->global.toPoint(); -
1251 local = window->mapFromGlobal(e->global.toPoint()) + delta; -
1252 }
never executed: }
0
1253 QTabletEvent ev(type, local, e->global, -
1254 e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt, -
1255 e->tangentialPressure, e->rotation, e->z, -
1256 e->modifiers, e->uid); -
1257 ev.setTimestamp(e->timestamp); -
1258 QGuiApplication::sendSpontaneousEvent(window, &ev); -
1259 -
1260 -
1261 -
1262}
executed: }
Execution Count:2
2
1263 -
1264void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e) -
1265{ -
1266 -
1267 QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(), -
1268 e->device, e->pointerType, 0, 0, 0, -
1269 0, 0, 0, -
1270 Qt::NoModifier, e->uid); -
1271 ev.setTimestamp(e->timestamp); -
1272 QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev); -
1273 -
1274 -
1275 -
1276}
executed: }
Execution Count:1
1
1277 -
1278void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e) -
1279{ -
1280 -
1281 QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(), -
1282 e->device, e->pointerType, 0, 0, 0, -
1283 0, 0, 0, -
1284 Qt::NoModifier, e->uid); -
1285 ev.setTimestamp(e->timestamp); -
1286 QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev); -
1287 -
1288 -
1289 -
1290}
executed: }
Execution Count:1
1
1291 -
1292void QGuiApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e) -
1293{ -
1294 if (!e->window)
never evaluated: !e->window
0
1295 return;
never executed: return;
0
1296 -
1297 if (e->window->d_func()->blockedByModalWindow) {
never evaluated: e->window->d_func()->blockedByModalWindow
0
1298 -
1299 return;
never executed: return;
0
1300 } -
1301 -
1302 QEvent ev(QEvent::PlatformPanel); -
1303 QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev); -
1304}
never executed: }
0
1305 -
1306 -
1307void QGuiApplicationPrivate::processContextMenuEvent(QWindowSystemInterfacePrivate::ContextMenuEvent *e) -
1308{ -
1309 -
1310 -
1311 if (!e->window || e->mouseTriggered || e->window->d_func()->blockedByModalWindow)
never evaluated: !e->window
never evaluated: e->mouseTriggered
never evaluated: e->window->d_func()->blockedByModalWindow
0
1312 return;
never executed: return;
0
1313 -
1314 QContextMenuEvent ev(QContextMenuEvent::Keyboard, e->pos, e->globalPos, e->modifiers); -
1315 QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev); -
1316}
never executed: }
0
1317 -
1318 -
1319__attribute__((visibility("default"))) uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k) -
1320{ -
1321 return qHash(k.device) + k.touchPointId;
executed: return qHash(k.device) + k.touchPointId;
Execution Count:50
50
1322} -
1323 -
1324__attribute__((visibility("default"))) bool operator==(const QGuiApplicationPrivate::ActiveTouchPointsKey &a, -
1325 const QGuiApplicationPrivate::ActiveTouchPointsKey &b) -
1326{ -
1327 return a.device == b.device 29
1328 && a.touchPointId == b.touchPointId;
executed: return a.device == b.device && a.touchPointId == b.touchPointId;
Execution Count:29
29
1329} -
1330 -
1331void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e) -
1332{ -
1333 QGuiApplicationPrivate *d = self; -
1334 modifier_buttons = e->modifiers; -
1335 -
1336 if (e->touchType == QEvent::TouchCancel) {
evaluated: e->touchType == QEvent::TouchCancel
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:25
3-25
1337 -
1338 -
1339 QTouchEvent touchEvent(QEvent::TouchCancel, e->device, e->modifiers); -
1340 touchEvent.setTimestamp(e->timestamp); -
1341 QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it -
1342 = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd(); -
1343 QSet<QWindow *> windowsNeedingCancel; -
1344 while (it != ite) {
evaluated: it != ite
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1345 QWindow *w = it->window.data(); -
1346 if (w)
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1347 windowsNeedingCancel.insert(w);
executed: windowsNeedingCancel.insert(w);
Execution Count:3
3
1348 ++it; -
1349 }
executed: }
Execution Count:3
3
1350 for (QSet<QWindow *>::const_iterator winIt = windowsNeedingCancel.constBegin(), -
1351 winItEnd = windowsNeedingCancel.constEnd(); winIt != winItEnd; ++winIt) {
evaluated: winIt != winItEnd
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1352 touchEvent.setWindow(*winIt); -
1353 QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent); -
1354 }
executed: }
Execution Count:3
3
1355 if (!self->synthesizedMousePoints.isEmpty() && !e->synthetic) {
evaluated: !self->synthesizedMousePoints.isEmpty()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
partially evaluated: !e->synthetic
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-2
1356 for (QHash<QWindow *, SynthesizedMouseData>::const_iterator synthIt = self->synthesizedMousePoints.constBegin(), -
1357 synthItEnd = self->synthesizedMousePoints.constEnd(); synthIt != synthItEnd; ++synthIt) {
evaluated: synthIt != synthItEnd
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1358 if (!synthIt->window)
partially evaluated: !synthIt->window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1359 continue;
never executed: continue;
0
1360 QWindowSystemInterfacePrivate::MouseEvent fake(synthIt->window.data(), -
1361 e->timestamp, -
1362 synthIt->pos, -
1363 synthIt->screenPos, -
1364 Qt::NoButton, -
1365 e->modifiers); -
1366 fake.synthetic = true; -
1367 processMouseEvent(&fake); -
1368 }
executed: }
Execution Count:1
1
1369 self->synthesizedMousePoints.clear(); -
1370 }
executed: }
Execution Count:1
1
1371 self->activeTouchPoints.clear(); -
1372 self->lastTouchType = e->touchType; -
1373 return;
executed: return;
Execution Count:3
3
1374 } -
1375 -
1376 -
1377 if (self->lastTouchType == QEvent::TouchCancel && e->touchType != QEvent::TouchBegin)
evaluated: self->lastTouchType == QEvent::TouchCancel
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:20
evaluated: e->touchType != QEvent::TouchBegin
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-20
1378 return;
executed: return;
Execution Count:2
2
1379 -
1380 self->lastTouchType = e->touchType; -
1381 -
1382 QWindow *window = e->window.data(); -
1383 typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; -
1384 QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents; -
1385 -
1386 for (int i = 0; i < e->points.count(); ++i) {
evaluated: i < e->points.count()
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:23
23-32
1387 QTouchEvent::TouchPoint touchPoint = e->points.at(i); -
1388 -
1389 -
1390 -
1391 touchPoint.d = touchPoint.d->detach(); -
1392 -
1393 -
1394 QPointer<QWindow> w; -
1395 QTouchEvent::TouchPoint previousTouchPoint; -
1396 ActiveTouchPointsKey touchInfoKey(e->device, touchPoint.id()); -
1397 ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey]; -
1398 switch (touchPoint.state()) { -
1399 case Qt::TouchPointPressed: -
1400 if (e->device->type() == QTouchDevice::TouchPad) {
partially evaluated: e->device->type() == QTouchDevice::TouchPad
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1401 -
1402 w = d->activeTouchPoints.isEmpty()
never evaluated: d->activeTouchPoints.isEmpty()
0
1403 ? QPointer<QWindow>() -
1404 : d->activeTouchPoints.constBegin().value().window; -
1405 }
never executed: }
0
1406 -
1407 if (!w) {
partially evaluated: !w
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
1408 -
1409 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1410 window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint());
never executed: window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint());
0
1411 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1412 continue;
never executed: continue;
0
1413 w = window; -
1414 }
executed: }
Execution Count:16
16
1415 -
1416 touchInfo.window = w; -
1417 touchPoint.d->startScreenPos = touchPoint.screenPos(); -
1418 touchPoint.d->lastScreenPos = touchPoint.screenPos(); -
1419 touchPoint.d->startNormalizedPos = touchPoint.normalizedPos(); -
1420 touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos(); -
1421 if (touchPoint.pressure() < qreal(0.))
evaluated: touchPoint.pressure() < qreal(0.)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:15
1-15
1422 touchPoint.d->pressure = qreal(1.);
executed: touchPoint.d->pressure = qreal(1.);
Execution Count:1
1
1423 -
1424 touchInfo.touchPoint = touchPoint; -
1425 break;
executed: break;
Execution Count:16
16
1426 -
1427 case Qt::TouchPointReleased: -
1428 w = touchInfo.window; -
1429 if (!w)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
1430 continue;
never executed: continue;
0
1431 -
1432 previousTouchPoint = touchInfo.touchPoint; -
1433 touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos(); -
1434 touchPoint.d->lastScreenPos = previousTouchPoint.screenPos(); -
1435 touchPoint.d->startPos = previousTouchPoint.startPos(); -
1436 touchPoint.d->lastPos = previousTouchPoint.pos(); -
1437 touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos(); -
1438 touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos(); -
1439 if (touchPoint.pressure() < qreal(0.))
partially evaluated: touchPoint.pressure() < qreal(0.)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
1440 touchPoint.d->pressure = qreal(0.);
never executed: touchPoint.d->pressure = qreal(0.);
0
1441 -
1442 break;
executed: break;
Execution Count:12
12
1443 -
1444 default: -
1445 w = touchInfo.window; -
1446 if (!w)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1447 continue;
never executed: continue;
0
1448 -
1449 previousTouchPoint = touchInfo.touchPoint; -
1450 touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos(); -
1451 touchPoint.d->lastScreenPos = previousTouchPoint.screenPos(); -
1452 touchPoint.d->startPos = previousTouchPoint.startPos(); -
1453 touchPoint.d->lastPos = previousTouchPoint.pos(); -
1454 touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos(); -
1455 touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos(); -
1456 if (touchPoint.pressure() < qreal(0.))
partially evaluated: touchPoint.pressure() < qreal(0.)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1457 touchPoint.d->pressure = qreal(1.);
never executed: touchPoint.d->pressure = qreal(1.);
0
1458 -
1459 -
1460 -
1461 if (touchPoint.state() != Qt::TouchPointStationary)
evaluated: touchPoint.state() != Qt::TouchPointStationary
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
1462 touchInfo.touchPoint = touchPoint;
executed: touchInfo.touchPoint = touchPoint;
Execution Count:3
3
1463 break;
executed: break;
Execution Count:4
4
1464 } -
1465 -
1466 qt_noop(); -
1467 -
1468 -
1469 touchPoint.d->sceneRect = touchPoint.screenRect(); -
1470 touchPoint.d->startScenePos = touchPoint.startScreenPos(); -
1471 touchPoint.d->lastScenePos = touchPoint.lastScreenPos(); -
1472 -
1473 StatesAndTouchPoints &maskAndPoints = windowsNeedingEvents[w.data()]; -
1474 maskAndPoints.first |= touchPoint.state(); -
1475 maskAndPoints.second.append(touchPoint); -
1476 }
executed: }
Execution Count:32
32
1477 -
1478 if (windowsNeedingEvents.isEmpty())
partially evaluated: windowsNeedingEvents.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23
0-23
1479 return;
never executed: return;
0
1480 -
1481 QHash<QWindow *, StatesAndTouchPoints>::ConstIterator it = windowsNeedingEvents.constBegin(); -
1482 const QHash<QWindow *, StatesAndTouchPoints>::ConstIterator end = windowsNeedingEvents.constEnd(); -
1483 for (; it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:23
23
1484 QWindow *w = it.key(); -
1485 -
1486 QEvent::Type eventType; -
1487 switch (it.value().first) { -
1488 case Qt::TouchPointPressed: -
1489 eventType = QEvent::TouchBegin; -
1490 break;
executed: break;
Execution Count:12
12
1491 case Qt::TouchPointReleased: -
1492 eventType = QEvent::TouchEnd; -
1493 break;
executed: break;
Execution Count:8
8
1494 case Qt::TouchPointStationary: -
1495 -
1496 continue;
never executed: continue;
0
1497 default: -
1498 eventType = QEvent::TouchUpdate; -
1499 break;
executed: break;
Execution Count:3
3
1500 } -
1501 -
1502 if (w->d_func()->blockedByModalWindow) {
partially evaluated: w->d_func()->blockedByModalWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23
0-23
1503 -
1504 continue;
never executed: continue;
0
1505 } -
1506 -
1507 QTouchEvent touchEvent(eventType, -
1508 e->device, -
1509 e->modifiers, -
1510 it.value().first, -
1511 it.value().second); -
1512 touchEvent.setTimestamp(e->timestamp); -
1513 touchEvent.setWindow(w); -
1514 -
1515 const int pointCount = touchEvent.touchPoints().count(); -
1516 for (int i = 0; i < pointCount; ++i) {
evaluated: i < pointCount
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:23
23-32
1517 QTouchEvent::TouchPoint &touchPoint = touchEvent._touchPoints[i]; -
1518 -
1519 -
1520 QRectF rect = touchPoint.screenRect(); -
1521 const QPointF screenPos = rect.center(); -
1522 const QPointF delta = screenPos - screenPos.toPoint(); -
1523 -
1524 rect.moveCenter(w->mapFromGlobal(screenPos.toPoint()) + delta); -
1525 touchPoint.d->rect = rect; -
1526 if (touchPoint.state() == Qt::TouchPointPressed) {
evaluated: touchPoint.state() == Qt::TouchPointPressed
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:16
16
1527 touchPoint.d->startPos = w->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta; -
1528 touchPoint.d->lastPos = w->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta; -
1529 }
executed: }
Execution Count:16
16
1530 }
executed: }
Execution Count:32
32
1531 -
1532 QGuiApplication::sendSpontaneousEvent(w, &touchEvent); -
1533 if (!e->synthetic && !touchEvent.isAccepted() && (static_cast<QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)) {
evaluated: !e->synthetic
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:4
evaluated: !touchEvent.isAccepted()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:13
evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-19
1534 -
1535 if (touchEvent.device()->type() != QTouchDevice::TouchPad) {
partially evaluated: touchEvent.device()->type() != QTouchDevice::TouchPad
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1536 Qt::MouseButtons b = eventType == QEvent::TouchEnd ? Qt::NoButton : Qt::LeftButton;
evaluated: eventType == QEvent::TouchEnd
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
1537 if (b == Qt::NoButton)
evaluated: b == Qt::NoButton
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
1538 self->synthesizedMousePoints.clear();
executed: self->synthesizedMousePoints.clear();
Execution Count:1
1
1539 -
1540 QList<QTouchEvent::TouchPoint> touchPoints = touchEvent.touchPoints(); -
1541 if (eventType == QEvent::TouchBegin)
evaluated: eventType == QEvent::TouchBegin
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
1542 m_fakeMouseSourcePointId = touchPoints.first().id();
executed: m_fakeMouseSourcePointId = touchPoints.first().id();
Execution Count:2
2
1543 -
1544 for (int i = 0; i < touchPoints.count(); ++i) {
partially evaluated: i < touchPoints.count()
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
1545 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i); -
1546 if (touchPoint.id() == m_fakeMouseSourcePointId) {
evaluated: touchPoint.id() == m_fakeMouseSourcePointId
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-4
1547 if (b != Qt::NoButton)
evaluated: b != Qt::NoButton
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
1548 self->synthesizedMousePoints.insert(w, SynthesizedMouseData( 3
1549 touchPoint.pos(), touchPoint.screenPos(), w));
executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w));
Execution Count:3
3
1550 QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp, -
1551 touchPoint.pos(), -
1552 touchPoint.screenPos(), -
1553 b, e->modifiers); -
1554 fake.synthetic = true; -
1555 processMouseEvent(&fake); -
1556 break;
executed: break;
Execution Count:4
4
1557 } -
1558 }
executed: }
Execution Count:2
2
1559 }
executed: }
Execution Count:4
4
1560 }
executed: }
Execution Count:4
4
1561 }
executed: }
Execution Count:23
23
1562 -
1563 -
1564 -
1565 -
1566 -
1567 for (int i = 0; i < e->points.count(); ++i) {
evaluated: i < e->points.count()
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:23
23-32
1568 QTouchEvent::TouchPoint touchPoint = e->points.at(i); -
1569 if (touchPoint.state() == Qt::TouchPointReleased)
evaluated: touchPoint.state() == Qt::TouchPointReleased
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:20
12-20
1570 d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id()));
executed: d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id()));
Execution Count:12
12
1571 }
executed: }
Execution Count:32
32
1572}
executed: }
Execution Count:23
23
1573 -
1574void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e) -
1575{ -
1576 -
1577 if (QCoreApplication::startingUp())
partially evaluated: QCoreApplication::startingUp()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1578 return;
never executed: return;
0
1579 -
1580 if (!e->screen)
partially evaluated: !e->screen
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1581 return;
never executed: return;
0
1582 -
1583 QScreen *s = e->screen.data(); -
1584 s->d_func()->orientation = e->orientation; -
1585 -
1586 updateFilteredScreenOrientation(s); -
1587}
executed: }
Execution Count:7
7
1588 -
1589void QGuiApplicationPrivate::updateFilteredScreenOrientation(QScreen *s) -
1590{ -
1591 Qt::ScreenOrientation o = s->d_func()->orientation; -
1592 if (o == Qt::PrimaryOrientation)
evaluated: o == Qt::PrimaryOrientation
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:8
2-8
1593 o = s->primaryOrientation();
executed: o = s->primaryOrientation();
Execution Count:2
2
1594 o = Qt::ScreenOrientation(o & s->orientationUpdateMask()); -
1595 if (o == Qt::PrimaryOrientation)
evaluated: o == Qt::PrimaryOrientation
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:6
4-6
1596 return;
executed: return;
Execution Count:4
4
1597 if (o == s->d_func()->filteredOrientation)
evaluated: o == s->d_func()->filteredOrientation
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
1598 return;
executed: return;
Execution Count:2
2
1599 s->d_func()->filteredOrientation = o; -
1600 reportScreenOrientationChange(s); -
1601}
executed: }
Execution Count:4
4
1602 -
1603void QGuiApplicationPrivate::reportScreenOrientationChange(QScreen *s) -
1604{ -
1605 s->orientationChanged(s->orientation()); -
1606 -
1607 QScreenOrientationChangeEvent event(s, s->orientation()); -
1608 QCoreApplication::sendEvent(QCoreApplication::instance(), &event); -
1609}
executed: }
Execution Count:4
4
1610 -
1611void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e) -
1612{ -
1613 -
1614 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
1615 return;
never executed: return;
0
1616 -
1617 if (!e->screen)
never evaluated: !e->screen
0
1618 return;
never executed: return;
0
1619 -
1620 QScreen *s = e->screen.data(); -
1621 s->d_func()->geometry = e->geometry; -
1622 -
1623 Qt::ScreenOrientation primaryOrientation = s->primaryOrientation(); -
1624 s->d_func()->updatePrimaryOrientation(); -
1625 -
1626 s->geometryChanged(s->geometry()); -
1627 s->physicalSizeChanged(s->physicalSize()); -
1628 s->physicalDotsPerInchChanged(s->physicalDotsPerInch()); -
1629 s->logicalDotsPerInchChanged(s->logicalDotsPerInch()); -
1630 for (QForeachContainer<__typeof__(s->virtualSiblings())> _container_(s->virtualSiblings()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QScreen* sibling = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
1631 sibling->virtualGeometryChanged(sibling->virtualGeometry());
never executed: sibling->virtualGeometryChanged(sibling->virtualGeometry());
0
1632 -
1633 if (s->primaryOrientation() != primaryOrientation)
never evaluated: s->primaryOrientation() != primaryOrientation
0
1634 s->primaryOrientationChanged(s->primaryOrientation());
never executed: s->primaryOrientationChanged(s->primaryOrientation());
0
1635 -
1636 if (s->d_func()->orientation == Qt::PrimaryOrientation)
never evaluated: s->d_func()->orientation == Qt::PrimaryOrientation
0
1637 updateFilteredScreenOrientation(s);
never executed: updateFilteredScreenOrientation(s);
0
1638}
never executed: }
0
1639 -
1640void QGuiApplicationPrivate::reportAvailableGeometryChange( -
1641 QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *e) -
1642{ -
1643 -
1644 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
1645 return;
never executed: return;
0
1646 -
1647 if (!e->screen)
never evaluated: !e->screen
0
1648 return;
never executed: return;
0
1649 -
1650 QScreen *s = e->screen.data(); -
1651 s->d_func()->availableGeometry = e->availableGeometry; -
1652 -
1653 for (QForeachContainer<__typeof__(s->virtualSiblings())> _container_(s->virtualSiblings()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QScreen* sibling = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
1654 sibling->virtualGeometryChanged(sibling->virtualGeometry());
never executed: sibling->virtualGeometryChanged(sibling->virtualGeometry());
0
1655}
never executed: }
0
1656 -
1657void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e) -
1658{ -
1659 -
1660 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
1661 return;
never executed: return;
0
1662 -
1663 if (!e->screen)
never evaluated: !e->screen
0
1664 return;
never executed: return;
0
1665 -
1666 QScreen *s = e->screen.data(); -
1667 s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY); -
1668 -
1669 s->logicalDotsPerInchChanged(s->logicalDotsPerInch()); -
1670}
never executed: }
0
1671 -
1672void QGuiApplicationPrivate::reportRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e) -
1673{ -
1674 -
1675 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
1676 return;
never executed: return;
0
1677 -
1678 if (!e->screen)
never evaluated: !e->screen
0
1679 return;
never executed: return;
0
1680 -
1681 QScreen *s = e->screen.data(); -
1682 s->d_func()->refreshRate = e->rate; -
1683 -
1684 s->refreshRateChanged(s->refreshRate()); -
1685}
never executed: }
0
1686 -
1687void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e) -
1688{ -
1689 if (!e->exposed)
evaluated: !e->exposed
TRUEFALSE
yes
Evaluation Count:37
yes
Evaluation Count:1836
37-1836
1690 return;
executed: return;
Execution Count:37
37
1691 -
1692 QWindow *window = e->exposed.data(); -
1693 QWindowPrivate *p = qt_window_private(window); -
1694 -
1695 if (!p->receivedExpose) {
evaluated: !p->receivedExpose
TRUEFALSE
yes
Evaluation Count:738
yes
Evaluation Count:1098
738-1098
1696 if (p->resizeEventPending) {
evaluated: p->resizeEventPending
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:685
53-685
1697 -
1698 QSize size = p->geometry.size(); -
1699 QResizeEvent e(size, size); -
1700 QGuiApplication::sendSpontaneousEvent(window, &e); -
1701 -
1702 p->resizeEventPending = false; -
1703 }
executed: }
Execution Count:53
53
1704 -
1705 p->receivedExpose = true; -
1706 }
executed: }
Execution Count:738
738
1707 -
1708 p->exposed = e->isExposed; -
1709 -
1710 QExposeEvent exposeEvent(e->region); -
1711 QCoreApplication::sendSpontaneousEvent(window, &exposeEvent); -
1712}
executed: }
Execution Count:1836
1836
1713 -
1714 -
1715 -
1716QPlatformDragQtResponse QGuiApplicationPrivate::processDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions) -
1717{ -
1718 static QPointer<QWindow> currentDragWindow; -
1719 static Qt::DropAction lastAcceptedDropAction = Qt::IgnoreAction; -
1720 QPlatformDrag *platformDrag = platformIntegration()->drag(); -
1721 if (!platformDrag) {
never evaluated: !platformDrag
0
1722 lastAcceptedDropAction = Qt::IgnoreAction; -
1723 return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
0
1724 } -
1725 -
1726 if (!dropData) {
never evaluated: !dropData
0
1727 if (currentDragWindow.data() == w)
never evaluated: currentDragWindow.data() == w
0
1728 currentDragWindow = 0;
never executed: currentDragWindow = 0;
0
1729 QDragLeaveEvent e; -
1730 QGuiApplication::sendEvent(w, &e); -
1731 lastAcceptedDropAction = Qt::IgnoreAction; -
1732 return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
0
1733 } -
1734 QDragMoveEvent me(p, supportedActions, dropData, -
1735 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); -
1736 -
1737 if (w != currentDragWindow) {
never evaluated: w != currentDragWindow
0
1738 lastAcceptedDropAction = Qt::IgnoreAction; -
1739 if (currentDragWindow) {
never evaluated: currentDragWindow
0
1740 QDragLeaveEvent e; -
1741 QGuiApplication::sendEvent(currentDragWindow, &e); -
1742 }
never executed: }
0
1743 currentDragWindow = w; -
1744 QDragEnterEvent e(p, supportedActions, dropData, -
1745 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); -
1746 QGuiApplication::sendEvent(w, &e); -
1747 if (e.isAccepted() && e.dropAction() != Qt::IgnoreAction)
never evaluated: e.isAccepted()
never evaluated: e.dropAction() != Qt::IgnoreAction
0
1748 lastAcceptedDropAction = e.dropAction();
never executed: lastAcceptedDropAction = e.dropAction();
0
1749 }
never executed: }
0
1750 -
1751 -
1752 if (lastAcceptedDropAction != Qt::IgnoreAction
never evaluated: lastAcceptedDropAction != Qt::IgnoreAction
0
1753 && (supportedActions & lastAcceptedDropAction)) {
never evaluated: (supportedActions & lastAcceptedDropAction)
0
1754 me.setDropAction(lastAcceptedDropAction); -
1755 me.accept(); -
1756 }
never executed: }
0
1757 QGuiApplication::sendEvent(w, &me); -
1758 lastAcceptedDropAction = me.isAccepted() ?
never evaluated: me.isAccepted()
0
1759 me.dropAction() : Qt::IgnoreAction; -
1760 return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
never executed: return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
0
1761} -
1762 -
1763QPlatformDropQtResponse QGuiApplicationPrivate::processDrop(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions) -
1764{ -
1765 QDropEvent de(p, supportedActions, dropData, -
1766 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); -
1767 QGuiApplication::sendEvent(w, &de); -
1768 -
1769 Qt::DropAction acceptedAction = de.isAccepted() ? de.dropAction() : Qt::IgnoreAction;
never evaluated: de.isAccepted()
0
1770 QPlatformDropQtResponse response(de.isAccepted(),acceptedAction); -
1771 return response;
never executed: return response;
0
1772} -
1773 -
1774 -
1775 -
1776 -
1777 -
1778 -
1779 -
1780QClipboard * QGuiApplication::clipboard() -
1781{ -
1782 if (QGuiApplicationPrivate::qt_clipboard == 0) {
evaluated: QGuiApplicationPrivate::qt_clipboard == 0
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:62
2-62
1783 if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))) {
partially evaluated: !(static_cast<QGuiApplication *>(QCoreApplication::instance()))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1784 QMessageLogger("kernel/qguiapplication.cpp", 2253, __PRETTY_FUNCTION__).warning("QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard"); -
1785 return 0;
never executed: return 0;
0
1786 } -
1787 QGuiApplicationPrivate::qt_clipboard = new QClipboard(0); -
1788 }
executed: }
Execution Count:2
2
1789 return QGuiApplicationPrivate::qt_clipboard;
executed: return QGuiApplicationPrivate::qt_clipboard;
Execution Count:64
64
1790} -
1791QPalette QGuiApplication::palette() -
1792{ -
1793 initPalette(); -
1794 return *QGuiApplicationPrivate::app_pal;
executed: return *QGuiApplicationPrivate::app_pal;
Execution Count:121950
121950
1795} -
1796 -
1797 -
1798 -
1799 -
1800 -
1801 -
1802void QGuiApplication::setPalette(const QPalette &pal) -
1803{ -
1804 if (QGuiApplicationPrivate::app_pal && pal.isCopyOf(*QGuiApplicationPrivate::app_pal))
never evaluated: QGuiApplicationPrivate::app_pal
never evaluated: pal.isCopyOf(*QGuiApplicationPrivate::app_pal)
0
1805 return;
never executed: return;
0
1806 if (!QGuiApplicationPrivate::app_pal)
never evaluated: !QGuiApplicationPrivate::app_pal
0
1807 QGuiApplicationPrivate::app_pal = new QPalette(pal);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(pal);
0
1808 else -
1809 *QGuiApplicationPrivate::app_pal = pal;
never executed: *QGuiApplicationPrivate::app_pal = pal;
0
1810 applicationResourceFlags |= ApplicationPaletteExplicitlySet; -
1811}
never executed: }
0
1812 -
1813 -
1814 -
1815 -
1816 -
1817 -
1818QFont QGuiApplication::font() -
1819{ -
1820 QMutexLocker locker(&applicationFontMutex); -
1821 initFontUnlocked(); -
1822 return *QGuiApplicationPrivate::app_font;
executed: return *QGuiApplicationPrivate::app_font;
Execution Count:806482
806482
1823} -
1824 -
1825 -
1826 -
1827 -
1828 -
1829 -
1830void QGuiApplication::setFont(const QFont &font) -
1831{ -
1832 QMutexLocker locker(&applicationFontMutex); -
1833 if (!QGuiApplicationPrivate::app_font)
evaluated: !QGuiApplicationPrivate::app_font
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:2
2-12
1834 QGuiApplicationPrivate::app_font = new QFont(font);
executed: QGuiApplicationPrivate::app_font = new QFont(font);
Execution Count:12
12
1835 else -
1836 *QGuiApplicationPrivate::app_font = font;
executed: *QGuiApplicationPrivate::app_font = font;
Execution Count:2
2
1837 applicationResourceFlags |= ApplicationFontExplicitlySet; -
1838}
executed: }
Execution Count:14
14
1839void QGuiApplicationPrivate::notifyLayoutDirectionChange() -
1840{ -
1841} -
1842 -
1843void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) -
1844{ -
1845} -
1846void QGuiApplication::setQuitOnLastWindowClosed(bool quit) -
1847{ -
1848 QCoreApplication::setQuitLockEnabled(quit); -
1849}
never executed: }
0
1850 -
1851 -
1852 -
1853bool QGuiApplication::quitOnLastWindowClosed() -
1854{ -
1855 return QCoreApplication::isQuitLockEnabled();
executed: return QCoreApplication::isQuitLockEnabled();
Execution Count:12
12
1856} -
1857void QGuiApplicationPrivate::emitLastWindowClosed() -
1858{ -
1859 if ((static_cast<QGuiApplication *>(QCoreApplication::instance())) && (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->in_exec) {
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))
TRUEFALSE
yes
Evaluation Count:961
no
Evaluation Count:0
evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->in_exec
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:945
0-961
1860 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->lastWindowClosed(); -
1861 }
executed: }
Execution Count:16
16
1862}
executed: }
Execution Count:961
961
1863 -
1864bool QGuiApplicationPrivate::shouldQuit() -
1865{ -
1866 -
1867 QWindowList list = QGuiApplication::topLevelWindows(); -
1868 for (int i = 0; i < list.size(); ++i) {
evaluated: i < list.size()
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:14
14-47
1869 QWindow *w = list.at(i); -
1870 if (w->isVisible() && !w->transientParent())
evaluated: w->isVisible()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:43
evaluated: !w->transientParent()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2-43
1871 return false;
executed: return false;
Execution Count:2
2
1872 }
executed: }
Execution Count:45
45
1873 return true;
executed: return true;
Execution Count:14
14
1874} -
1875bool QGuiApplication::isSessionRestored() const -
1876{ -
1877 const QGuiApplicationPrivate * const d = d_func(); -
1878 return d->is_session_restored;
never executed: return d->is_session_restored;
0
1879} -
1880 -
1881QString QGuiApplication::sessionId() const -
1882{ -
1883 const QGuiApplicationPrivate * const d = d_func(); -
1884 return d->session_id;
never executed: return d->session_id;
0
1885} -
1886 -
1887QString QGuiApplication::sessionKey() const -
1888{ -
1889 const QGuiApplicationPrivate * const d = d_func(); -
1890 return d->session_key;
never executed: return d->session_key;
0
1891} -
1892 -
1893bool QGuiApplication::isSavingSession() const -
1894{ -
1895 const QGuiApplicationPrivate * const d = d_func(); -
1896 return d->is_saving_session;
never executed: return d->is_saving_session;
0
1897} -
1898 -
1899void QGuiApplicationPrivate::commitData(QSessionManager& manager) -
1900{ -
1901 QGuiApplication * const q = q_func(); -
1902 is_saving_session = true; -
1903 q->commitDataRequest(manager); -
1904 if (manager.allowsInteraction()) {
never evaluated: manager.allowsInteraction()
0
1905 QWindowList done; -
1906 QWindowList list = QGuiApplication::topLevelWindows(); -
1907 bool cancelled = false; -
1908 for (int i = 0; !cancelled && i < list.size(); ++i) {
never evaluated: !cancelled
never evaluated: i < list.size()
0
1909 QWindow* w = list.at(i); -
1910 if (w->isVisible() && !done.contains(w)) {
never evaluated: w->isVisible()
never evaluated: !done.contains(w)
0
1911 cancelled = !w->close(); -
1912 if (!cancelled)
never evaluated: !cancelled
0
1913 done.append(w);
never executed: done.append(w);
0
1914 list = QGuiApplication::topLevelWindows(); -
1915 i = -1; -
1916 }
never executed: }
0
1917 }
never executed: }
0
1918 if (cancelled)
never evaluated: cancelled
0
1919 manager.cancel();
never executed: manager.cancel();
0
1920 }
never executed: }
0
1921 is_saving_session = false; -
1922}
never executed: }
0
1923 -
1924 -
1925void QGuiApplicationPrivate::saveState(QSessionManager &manager) -
1926{ -
1927 QGuiApplication * const q = q_func(); -
1928 is_saving_session = true; -
1929 q->saveStateRequest(manager); -
1930 is_saving_session = false; -
1931}
never executed: }
0
1932void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction) -
1933{ -
1934 if (layout_direction == direction || direction == Qt::LayoutDirectionAuto)
evaluated: layout_direction == direction
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:11
partially evaluated: direction == Qt::LayoutDirectionAuto
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-52
1935 return;
executed: return;
Execution Count:52
52
1936 -
1937 layout_direction = direction; -
1938 -
1939 QGuiApplicationPrivate::self->notifyLayoutDirectionChange(); -
1940}
executed: }
Execution Count:11
11
1941 -
1942Qt::LayoutDirection QGuiApplication::layoutDirection() -
1943{ -
1944 return layout_direction;
executed: return layout_direction;
Execution Count:407304
407304
1945} -
1946QCursor *QGuiApplication::overrideCursor() -
1947{ -
1948 return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty() ? 0 : &(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.first();
executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty() ? 0 : &(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.first();
Execution Count:3619
3619
1949} -
1950void QGuiApplication::changeOverrideCursor(const QCursor &cursor) -
1951{ -
1952 if ((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty())
never evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty()
0
1953 return;
never executed: return;
0
1954 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst(); -
1955 setOverrideCursor(cursor); -
1956}
never executed: }
0
1957 -
1958 -
1959 -
1960 -
1961static inline void applyCursor(QWindow *w, QCursor c) -
1962{ -
1963 if (const QScreen *screen = w->screen())
partially evaluated: const QScreen *screen = w->screen()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1964 if (QPlatformCursor *cursor = screen->handle()->cursor())
partially evaluated: QPlatformCursor *cursor = screen->handle()->cursor()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
1965 cursor->changeCursor(&c, w);
executed: cursor->changeCursor(&c, w);
Execution Count:4
4
1966}
executed: }
Execution Count:4
4
1967 -
1968static inline void applyCursor(const QList<QWindow *> &l, const QCursor &c) -
1969{ -
1970 for (int i = 0; i < l.size(); ++i) {
evaluated: i < l.size()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:2
2-6
1971 QWindow *w = l.at(i); -
1972 if (w->handle() && w->type() != Qt::Desktop)
evaluated: w->handle()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
evaluated: w->type() != Qt::Desktop
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2-4
1973 applyCursor(w, c);
executed: applyCursor(w, c);
Execution Count:2
2
1974 }
executed: }
Execution Count:6
6
1975}
executed: }
Execution Count:2
2
1976 -
1977static inline void applyWindowCursor(const QList<QWindow *> &l) -
1978{ -
1979 for (int i = 0; i < l.size(); ++i) {
evaluated: i < l.size()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:2
2-6
1980 QWindow *w = l.at(i); -
1981 if (w->handle() && w->type() != Qt::Desktop)
evaluated: w->handle()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
evaluated: w->type() != Qt::Desktop
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2-4
1982 applyCursor(w, w->cursor());
executed: applyCursor(w, w->cursor());
Execution Count:2
2
1983 }
executed: }
Execution Count:6
6
1984}
executed: }
Execution Count:2
2
1985void QGuiApplication::setOverrideCursor(const QCursor &cursor) -
1986{ -
1987 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.prepend(cursor); -
1988 applyCursor(QGuiApplicationPrivate::window_list, cursor); -
1989}
executed: }
Execution Count:2
2
1990void QGuiApplication::restoreOverrideCursor() -
1991{ -
1992 if ((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty())
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1993 return;
never executed: return;
0
1994 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst(); -
1995 if ((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.size() > 0) {
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.size() > 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1996 QCursor c((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.value(0)); -
1997 applyCursor(QGuiApplicationPrivate::window_list, c); -
1998 } else {
never executed: }
0
1999 applyWindowCursor(QGuiApplicationPrivate::window_list); -
2000 }
executed: }
Execution Count:2
2
2001} -
2002QStyleHints *QGuiApplication::styleHints() -
2003{ -
2004 if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints)
evaluated: !(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints
TRUEFALSE
yes
Evaluation Count:111
yes
Evaluation Count:4828
111-4828
2005 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints = new QStyleHints();
executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints = new QStyleHints();
Execution Count:111
111
2006 return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints;
executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints;
Execution Count:4939
4939
2007} -
2008void QGuiApplication::setDesktopSettingsAware(bool on) -
2009{ -
2010 QGuiApplicationPrivate::obey_desktop_settings = on; -
2011}
executed: }
Execution Count:1
1
2012 -
2013 -
2014 -
2015 -
2016 -
2017 -
2018 -
2019bool QGuiApplication::desktopSettingsAware() -
2020{ -
2021 return QGuiApplicationPrivate::obey_desktop_settings;
executed: return QGuiApplicationPrivate::obey_desktop_settings;
Execution Count:6667
6667
2022} -
2023QInputMethod *QGuiApplication::inputMethod() -
2024{ -
2025 if (!(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod)
evaluated: !(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod
TRUEFALSE
yes
Evaluation Count:276
yes
Evaluation Count:17812
276-17812
2026 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();
executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();
Execution Count:276
276
2027 return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;
executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;
Execution Count:18088
18088
2028} -
2029static const char * const move_xpm[] = { -
2030"11 20 3 1", -
2031". c None", -
2032"a c #FFFFFF", -
2033"X c #000000", -
2034"aa.........", -
2035"aXa........", -
2036"aXXa.......", -
2037"aXXXa......", -
2038"aXXXXa.....", -
2039"aXXXXXa....", -
2040"aXXXXXXa...", -
2041"aXXXXXXXa..", -
2042"aXXXXXXXXa.", -
2043"aXXXXXXXXXa", -
2044"aXXXXXXaaaa", -
2045"aXXXaXXa...", -
2046"aXXaaXXa...", -
2047"aXa..aXXa..", -
2048"aa...aXXa..", -
2049"a.....aXXa.", -
2050"......aXXa.", -
2051".......aXXa", -
2052".......aXXa", -
2053"........aa."}; -
2054 -
2055 -
2056 -
2057static const char * const copy_xpm[] = { -
2058"24 30 3 1", -
2059". c None", -
2060"a c #000000", -
2061"X c #FFFFFF", -
2062"XX......................", -
2063"XaX.....................", -
2064"XaaX....................", -
2065"XaaaX...................", -
2066"XaaaaX..................", -
2067"XaaaaaX.................", -
2068"XaaaaaaX................", -
2069"XaaaaaaaX...............", -
2070"XaaaaaaaaX..............", -
2071"XaaaaaaaaaX.............", -
2072"XaaaaaaXXXX.............", -
2073"XaaaXaaX................", -
2074"XaaXXaaX................", -
2075"XaX..XaaX...............", -
2076"XX...XaaX...............", -
2077"X.....XaaX..............", -
2078"......XaaX..............", -
2079".......XaaX.............", -
2080".......XaaX.............", -
2081"........XX...aaaaaaaaaaa", -
2082".............aXXXXXXXXXa", -
2083".............aXXXXXXXXXa", -
2084".............aXXXXaXXXXa", -
2085".............aXXXXaXXXXa", -
2086".............aXXaaaaaXXa", -
2087".............aXXXXaXXXXa", -
2088".............aXXXXaXXXXa", -
2089".............aXXXXXXXXXa", -
2090".............aXXXXXXXXXa", -
2091".............aaaaaaaaaaa"}; -
2092 -
2093 -
2094static const char * const link_xpm[] = { -
2095"24 30 3 1", -
2096". c None", -
2097"a c #000000", -
2098"X c #FFFFFF", -
2099"XX......................", -
2100"XaX.....................", -
2101"XaaX....................", -
2102"XaaaX...................", -
2103"XaaaaX..................", -
2104"XaaaaaX.................", -
2105"XaaaaaaX................", -
2106"XaaaaaaaX...............", -
2107"XaaaaaaaaX..............", -
2108"XaaaaaaaaaX.............", -
2109"XaaaaaaXXXX.............", -
2110"XaaaXaaX................", -
2111"XaaXXaaX................", -
2112"XaX..XaaX...............", -
2113"XX...XaaX...............", -
2114"X.....XaaX..............", -
2115"......XaaX..............", -
2116".......XaaX.............", -
2117".......XaaX.............", -
2118"........XX...aaaaaaaaaaa", -
2119".............aXXXXXXXXXa", -
2120".............aXXXaaaaXXa", -
2121".............aXXXXaaaXXa", -
2122".............aXXXaaaaXXa", -
2123".............aXXaaaXaXXa", -
2124".............aXXaaXXXXXa", -
2125".............aXXaXXXXXXa", -
2126".............aXXXaXXXXXa", -
2127".............aXXXXXXXXXa", -
2128".............aaaaaaaaaaa"}; -
2129 -
2130QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) -
2131{ -
2132 (void)cshape;; -
2133 return QPixmap();
never executed: return QPixmap();
0
2134} -
2135 -
2136void QGuiApplicationPrivate::notifyThemeChanged() -
2137{ -
2138 if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)) {
never evaluated: !(applicationResourceFlags & ApplicationPaletteExplicitlySet)
0
2139 clearPalette(); -
2140 initPalette(); -
2141 }
never executed: }
0
2142 if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
never evaluated: !(applicationResourceFlags & ApplicationFontExplicitlySet)
0
2143 QMutexLocker locker(&applicationFontMutex); -
2144 clearFontUnlocked(); -
2145 initFontUnlocked(); -
2146 }
never executed: }
0
2147}
never executed: }
0
2148 -
2149 -
2150void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag) -
2151{ -
2152 (void)drag; -
2153 -
2154}
never executed: }
0
2155 -
2156 -
2157const QDrawHelperGammaTables *QGuiApplicationPrivate::gammaTables() -
2158{ -
2159 QDrawHelperGammaTables *result = m_gammaTables.load(); -
2160 if (!result){
never evaluated: !result
0
2161 QDrawHelperGammaTables *tables = new QDrawHelperGammaTables(fontSmoothingGamma); -
2162 if (!m_gammaTables.testAndSetRelease(0, tables))
never evaluated: !m_gammaTables.testAndSetRelease(0, tables)
0
2163 delete tables;
never executed: delete tables;
0
2164 result = m_gammaTables.load(); -
2165 }
never executed: }
0
2166 return result;
never executed: return result;
0
2167} -
2168 -
2169void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object) -
2170{ -
2171 QGuiApplication * const q = q_func(); -
2172 -
2173 bool enabled = false; -
2174 if (object) {
evaluated: object
TRUEFALSE
yes
Evaluation Count:1462
yes
Evaluation Count:45
45-1462
2175 QInputMethodQueryEvent query(Qt::ImEnabled); -
2176 QGuiApplication::sendEvent(object, &query); -
2177 enabled = query.value(Qt::ImEnabled).toBool(); -
2178 }
executed: }
Execution Count:1462
1462
2179 -
2180 QPlatformInputContextPrivate::setInputMethodAccepted(enabled); -
2181 QPlatformInputContext *inputContext = platformIntegration()->inputContext(); -
2182 if (inputContext)
partially evaluated: inputContext
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1507
0-1507
2183 inputContext->setFocusObject(object);
never executed: inputContext->setFocusObject(object);
0
2184 q->focusObjectChanged(object); -
2185}
executed: }
Execution Count:1507
1507
2186 -
2187int QGuiApplicationPrivate::mouseEventCaps(QMouseEvent *event) -
2188{ -
2189 return event->caps;
never executed: return event->caps;
0
2190} -
2191 -
2192QVector2D QGuiApplicationPrivate::mouseEventVelocity(QMouseEvent *event) -
2193{ -
2194 return event->velocity;
never executed: return event->velocity;
0
2195} -
2196 -
2197void QGuiApplicationPrivate::setMouseEventCapsAndVelocity(QMouseEvent *event, int caps, const QVector2D &velocity) -
2198{ -
2199 event->caps = caps; -
2200 event->velocity = velocity; -
2201}
never executed: }
0
2202 -
2203void QGuiApplicationPrivate::setMouseEventCapsAndVelocity(QMouseEvent *event, QMouseEvent *other) -
2204{ -
2205 event->caps = other->caps; -
2206 event->velocity = other->velocity; -
2207}
never executed: }
0
2208 -
2209 -
2210 -
2211 -
2212 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial