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

Generated by Squish Coco Non-Commercial