Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | static void initResources() | - |
22 | { | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | extern int qInitResources_qstyle (); | - |
28 | do { extern int qInitResources_qstyle (); qInitResources_qstyle (); } while (0); executed: } Execution Count:215 partially evaluated: 0 no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
29 | | - |
30 | extern int qInitResources_qmessagebox (); | - |
31 | do { extern int qInitResources_qmessagebox (); qInitResources_qmessagebox (); } while (0); executed: } Execution Count:215 partially evaluated: 0 no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
32 | | - |
33 | } executed: } Execution Count:215 | 215 |
34 | | - |
35 | | - |
36 | | - |
37 | __attribute__((visibility("default"))) void qt_call_post_routines(); | - |
38 | | - |
39 | QApplicationPrivate *QApplicationPrivate::self = 0; | - |
40 | | - |
41 | static void initSystemPalette() | - |
42 | { | - |
43 | if (!QApplicationPrivate::sys_pal) { partially evaluated: !QApplicationPrivate::sys_pal yes Evaluation Count:214 | no Evaluation Count:0 |
| 0-214 |
44 | QPalette defaultPlatte; | - |
45 | if (QApplicationPrivate::app_style) partially evaluated: QApplicationPrivate::app_style yes Evaluation Count:214 | no Evaluation Count:0 |
| 0-214 |
46 | defaultPlatte = QApplicationPrivate::app_style->standardPalette(); executed: defaultPlatte = QApplicationPrivate::app_style->standardPalette(); Execution Count:214 | 214 |
47 | if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette()) { partially evaluated: const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette() no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
48 | QApplicationPrivate::setSystemPalette(themePalette->resolve(defaultPlatte)); | - |
49 | QApplicationPrivate::initializeWidgetPaletteHash(); | - |
50 | } else { | 0 |
51 | QApplicationPrivate::setSystemPalette(defaultPlatte); | - |
52 | } executed: } Execution Count:214 | 214 |
53 | } | - |
54 | } executed: } Execution Count:214 | 214 |
55 | | - |
56 | static void clearSystemPalette() | - |
57 | { | - |
58 | delete QApplicationPrivate::sys_pal; | - |
59 | QApplicationPrivate::sys_pal = 0; | - |
60 | } executed: } Execution Count:213 | 213 |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | bool QApplicationPrivate::autoSipEnabled = true; | - |
67 | | - |
68 | | - |
69 | QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, int flags) | - |
70 | : QGuiApplicationPrivate(argc, argv, flags) | - |
71 | { | - |
72 | application_type = QApplicationPrivate::Gui; | - |
73 | | - |
74 | | - |
75 | gestureManager = 0; | - |
76 | gestureWidget = 0; | - |
77 | | - |
78 | | - |
79 | if (!self) partially evaluated: !self yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
80 | self = this; executed: self = this; Execution Count:215 | 215 |
81 | } executed: } Execution Count:215 | 215 |
82 | | - |
83 | QApplicationPrivate::~QApplicationPrivate() | - |
84 | { | - |
85 | if (self == this) partially evaluated: self == this yes Evaluation Count:213 | no Evaluation Count:0 |
| 0-213 |
86 | self = 0; executed: self = 0; Execution Count:213 | 213 |
87 | } executed: } Execution Count:213 | 213 |
88 | void qt_init(QApplicationPrivate *priv, int type | - |
89 | ); | - |
90 | void qt_cleanup(); | - |
91 | | - |
92 | QStyle *QApplicationPrivate::app_style = 0; | - |
93 | QString QApplicationPrivate::styleOverride; | - |
94 | | - |
95 | | - |
96 | QString QApplicationPrivate::styleSheet; | - |
97 | | - |
98 | QPointer<QWidget> QApplicationPrivate::leaveAfterRelease = 0; | - |
99 | | - |
100 | int QApplicationPrivate::app_cspec = QApplication::NormalColor; | - |
101 | | - |
102 | QPalette *QApplicationPrivate::sys_pal = 0; | - |
103 | QPalette *QApplicationPrivate::set_pal = 0; | - |
104 | | - |
105 | QFont *QApplicationPrivate::sys_font = 0; | - |
106 | QFont *QApplicationPrivate::set_font = 0; | - |
107 | | - |
108 | QIcon *QApplicationPrivate::app_icon = 0; | - |
109 | QWidget *QApplicationPrivate::main_widget = 0; | - |
110 | QWidget *QApplicationPrivate::focus_widget = 0; | - |
111 | QWidget *QApplicationPrivate::hidden_focus_widget = 0; | - |
112 | QWidget *QApplicationPrivate::active_window = 0; | - |
113 | | - |
114 | int QApplicationPrivate::wheel_scroll_lines; | - |
115 | | - |
116 | bool qt_in_tab_key_event = false; | - |
117 | int qt_antialiasing_threshold = -1; | - |
118 | QSize QApplicationPrivate::app_strut = QSize(0,0); | - |
119 | int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; | - |
120 | bool QApplicationPrivate::widgetCount = false; | - |
121 | bool QApplicationPrivate::load_testability = false; | - |
122 | | - |
123 | | - |
124 | | - |
125 | | - |
126 | | - |
127 | bool qt_tabletChokeMouse = false; | - |
128 | | - |
129 | inline bool QApplicationPrivate::isAlien(QWidget *widget) | - |
130 | { | - |
131 | return widget && !widget->isWindow(); executed: return widget && !widget->isWindow(); Execution Count:3839 | 3839 |
132 | } | - |
133 | | - |
134 | bool __attribute__((visibility("default"))) qt_tab_all_widgets() | - |
135 | { | - |
136 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme() yes Evaluation Count:1768 | no Evaluation Count:0 |
| 0-1768 |
137 | return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool(); executed: return theme->themeHint(QPlatformTheme::TabAllWidgets).toBool(); Execution Count:1768 | 1768 |
138 | return true; never executed: return true; | 0 |
139 | } | - |
140 | | - |
141 | | - |
142 | | - |
143 | static PaletteHash *app_palettes() { static QGlobalStatic<PaletteHash > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { PaletteHash *x = new PaletteHash; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<PaletteHash > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } never executed: delete x; executed: return thisGlobalStatic.pointer.load(); Execution Count:85793 partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:136 |
evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:136 | yes Evaluation Count:85657 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:136 | no Evaluation Count:0 |
| 0-85793 |
144 | PaletteHash *qt_app_palettes_hash() | - |
145 | { | - |
146 | return app_palettes(); never executed: return app_palettes(); | 0 |
147 | } | - |
148 | | - |
149 | static FontHash *app_fonts() { static QGlobalStatic<FontHash > thisGlobalStatic = { { (0) }, false }; if (!thisGlobalStatic.pointer.load() && !thisGlobalStatic.destroyed) { FontHash *x = new FontHash; if (!thisGlobalStatic.pointer.testAndSetOrdered(0, x)) delete x; else static QGlobalStaticDeleter<FontHash > cleanup(thisGlobalStatic); } return thisGlobalStatic.pointer.load(); } never executed: delete x; executed: return thisGlobalStatic.pointer.load(); Execution Count:80659 partially evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) no Evaluation Count:0 | yes Evaluation Count:136 |
evaluated: !thisGlobalStatic.pointer.load() yes Evaluation Count:136 | yes Evaluation Count:80523 |
partially evaluated: !thisGlobalStatic.destroyed yes Evaluation Count:136 | no Evaluation Count:0 |
| 0-80659 |
150 | FontHash *qt_app_fonts_hash() | - |
151 | { | - |
152 | return app_fonts(); executed: return app_fonts(); Execution Count:215 | 215 |
153 | } | - |
154 | | - |
155 | QWidgetList *QApplicationPrivate::popupWidgets = 0; | - |
156 | | - |
157 | QDesktopWidget *qt_desktopWidget = 0; | - |
158 | | - |
159 | | - |
160 | | - |
161 | | - |
162 | void QApplicationPrivate::process_cmdline() | - |
163 | { | - |
164 | | - |
165 | if (!qt_is_gui_used || !argc) partially evaluated: !qt_is_gui_used no Evaluation Count:0 | yes Evaluation Count:215 |
evaluated: !argc yes Evaluation Count:59 | yes Evaluation Count:156 |
| 0-215 |
166 | return; executed: return; Execution Count:59 | 59 |
167 | | - |
168 | int i, j; | - |
169 | | - |
170 | j = 1; | - |
171 | for (i=1; i<argc; i++) { evaluated: i<argc yes Evaluation Count:3 | yes Evaluation Count:156 |
| 3-156 |
172 | if (argv[i] && *argv[i] != '-') { partially evaluated: argv[i] yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: *argv[i] != '-' no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
173 | argv[j++] = argv[i]; | - |
174 | continue; never executed: continue; | 0 |
175 | } | - |
176 | QByteArray arg = argv[i]; | - |
177 | arg = arg; | - |
178 | QString s; | - |
179 | if (arg == "-qdevel" || arg == "-qdebug") { partially evaluated: arg == "-qdevel" no Evaluation Count:0 | yes Evaluation Count:3 |
partially evaluated: arg == "-qdebug" no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
180 | | - |
181 | } else if (arg.indexOf("-style=", 0) != -1) { partially evaluated: arg.indexOf("-style=", 0) != -1 no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
182 | s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower()); | - |
183 | } else if (arg == "-style" && i < argc-1) { evaluated: arg == "-style" yes Evaluation Count:2 | yes Evaluation Count:1 |
partially evaluated: i < argc-1 yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
184 | s = QString::fromLocal8Bit(argv[++i]).toLower(); | - |
185 | | - |
186 | } else if (arg == "-stylesheet" && i < argc -1) { executed: } Execution Count:2 partially evaluated: arg == "-stylesheet" no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: i < argc -1 | 0-2 |
187 | styleSheet = QLatin1String("file:///"); | - |
188 | styleSheet.append(QString::fromLocal8Bit(argv[++i])); | - |
189 | } else if (arg.indexOf("-stylesheet=") != -1) { partially evaluated: arg.indexOf("-stylesheet=") != -1 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
190 | styleSheet = QLatin1String("file:///"); | - |
191 | styleSheet.append(QString::fromLocal8Bit(arg.right(arg.length() - 12))); | - |
192 | | - |
193 | } else if (qstrcmp(arg, "-widgetcount") == 0) { partially evaluated: qstrcmp(arg, "-widgetcount") == 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
194 | widgetCount = true; | - |
195 | } else if (qstrcmp(arg, "-testability") == 0) { partially evaluated: qstrcmp(arg, "-testability") == 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
196 | load_testability = true; | - |
197 | } else { | 0 |
198 | argv[j++] = argv[i]; | - |
199 | } executed: } Execution Count:1 | 1 |
200 | if (!s.isEmpty()) { evaluated: !s.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
201 | if (app_style) { partially evaluated: app_style no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
202 | delete app_style; | - |
203 | app_style = 0; | - |
204 | } | 0 |
205 | styleOverride = s; | - |
206 | } executed: } Execution Count:2 | 2 |
207 | } executed: } Execution Count:3 | 3 |
208 | | - |
209 | if(j < argc) { evaluated: j < argc yes Evaluation Count:2 | yes Evaluation Count:154 |
| 2-154 |
210 | argv[j] = 0; | - |
211 | argc = j; | - |
212 | } executed: } Execution Count:2 | 2 |
213 | } executed: } Execution Count:156 | 156 |
214 | QApplication::QApplication(int &argc, char **argv, int _internal) | - |
215 | | - |
216 | : QGuiApplication(*new QApplicationPrivate(argc, argv, _internal)) | - |
217 | { QApplicationPrivate * const d = d_func(); d->construct(); } executed: } Execution Count:215 | 215 |
218 | | - |
219 | | - |
220 | | - |
221 | | - |
222 | void QApplicationPrivate::construct() | - |
223 | { | - |
224 | initResources(); | - |
225 | | - |
226 | qt_is_gui_used = (application_type != QApplicationPrivate::Tty); | - |
227 | process_cmdline(); | - |
228 | | - |
229 | | - |
230 | qt_init(this, application_type); | - |
231 | initialize(); | - |
232 | eventDispatcher->startingUp(); | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | | - |
238 | | - |
239 | | - |
240 | if(load_testability) { partially evaluated: load_testability no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
241 | QLibrary testLib(QLatin1String("qttestability")); | - |
242 | if (testLib.load()) { never evaluated: testLib.load() | 0 |
243 | typedef void (*TasInitialize)(void); | - |
244 | TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); | - |
245 | if (initFunction) { never evaluated: initFunction | 0 |
246 | initFunction(); | - |
247 | } else { | 0 |
248 | QMessageLogger("kernel/qapplication.cpp", 569, __PRETTY_FUNCTION__).critical("Library qttestability resolve failed!"); | - |
249 | } | 0 |
250 | } else { | - |
251 | QMessageLogger("kernel/qapplication.cpp", 572, __PRETTY_FUNCTION__).critical("Library qttestability load failed!"); | - |
252 | } | 0 |
253 | } | - |
254 | | - |
255 | } executed: } Execution Count:215 | 215 |
256 | | - |
257 | | - |
258 | void qRegisterGuiStateMachine(); | - |
259 | void qUnregisterGuiStateMachine(); | - |
260 | | - |
261 | extern void qRegisterWidgetsVariant(); | - |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | | - |
268 | void QApplicationPrivate::initialize() | - |
269 | { | - |
270 | QWidgetPrivate::mapper = new QWidgetMapper; | - |
271 | QWidgetPrivate::allWidgets = new QWidgetSet; | - |
272 | | - |
273 | | - |
274 | qRegisterWidgetsVariant(); | - |
275 | | - |
276 | if (application_type != QApplicationPrivate::Tty) partially evaluated: application_type != QApplicationPrivate::Tty yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
277 | (void) QApplication::style(); executed: (void) QApplication::style(); Execution Count:215 | 215 |
278 | | - |
279 | | - |
280 | qRegisterGuiStateMachine(); | - |
281 | | - |
282 | | - |
283 | is_app_running = true; | - |
284 | | - |
285 | QApplication * const q = q_func(); | - |
286 | | - |
287 | if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0) partially evaluated: qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0 no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
288 | q->setAttribute(Qt::AA_NativeWindows); never executed: q->setAttribute(Qt::AA_NativeWindows); | 0 |
289 | QApplicationPrivate::wheel_scroll_lines = 3; | - |
290 | | - |
291 | | - |
292 | if (qt_is_gui_used) partially evaluated: qt_is_gui_used yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
293 | initializeMultitouch(); executed: initializeMultitouch(); Execution Count:215 | 215 |
294 | | - |
295 | if (QApplication::desktopSettingsAware()) partially evaluated: QApplication::desktopSettingsAware() yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
296 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme() yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
297 | QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); executed: QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); Execution Count:215 | 215 |
298 | } executed: } Execution Count:215 | 215 |
299 | QWidget *QApplication::activePopupWidget() | - |
300 | { | - |
301 | return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? | 7209 |
302 | QApplicationPrivate::popupWidgets->last() : 0; executed: return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->last() : 0; Execution Count:7209 | 7209 |
303 | } | - |
304 | QWidget *QApplication::activeModalWidget() | - |
305 | { | - |
306 | QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(modalWindow()); | - |
307 | return widgetWindow ? widgetWindow->widget() : 0; executed: return widgetWindow ? widgetWindow->widget() : 0; Execution Count:4182 | 4182 |
308 | } | - |
309 | | - |
310 | | - |
311 | | - |
312 | | - |
313 | | - |
314 | | - |
315 | QApplication::~QApplication() | - |
316 | { | - |
317 | QApplicationPrivate * const d = d_func(); | - |
318 | | - |
319 | | - |
320 | qt_call_post_routines(); | - |
321 | | - |
322 | | - |
323 | d->toolTipWakeUp.stop(); | - |
324 | d->toolTipFallAsleep.stop(); | - |
325 | | - |
326 | QApplicationPrivate::is_app_closing = true; | - |
327 | QApplicationPrivate::is_app_running = false; | - |
328 | | - |
329 | delete QWidgetPrivate::mapper; | - |
330 | QWidgetPrivate::mapper = 0; | - |
331 | | - |
332 | | - |
333 | if (QWidgetPrivate::allWidgets) { partially evaluated: QWidgetPrivate::allWidgets yes Evaluation Count:213 | no Evaluation Count:0 |
| 0-213 |
334 | QWidgetSet *mySet = QWidgetPrivate::allWidgets; | - |
335 | QWidgetPrivate::allWidgets = 0; | - |
336 | for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) { evaluated: it != mySet->constEnd() yes Evaluation Count:4292 | yes Evaluation Count:213 |
| 213-4292 |
337 | register QWidget *w = *it; | - |
338 | if (!w->parent()) evaluated: !w->parent() yes Evaluation Count:585 | yes Evaluation Count:3707 |
| 585-3707 |
339 | w->destroy(true, true); executed: w->destroy(true, true); Execution Count:585 | 585 |
340 | } executed: } Execution Count:4292 | 4292 |
341 | delete mySet; | - |
342 | } executed: } Execution Count:213 | 213 |
343 | | - |
344 | delete qt_desktopWidget; | - |
345 | qt_desktopWidget = 0; | - |
346 | | - |
347 | delete QApplicationPrivate::app_pal; | - |
348 | QApplicationPrivate::app_pal = 0; | - |
349 | clearSystemPalette(); | - |
350 | delete QApplicationPrivate::set_pal; | - |
351 | QApplicationPrivate::set_pal = 0; | - |
352 | app_palettes()->clear(); | - |
353 | | - |
354 | delete QApplicationPrivate::sys_font; | - |
355 | QApplicationPrivate::sys_font = 0; | - |
356 | delete QApplicationPrivate::set_font; | - |
357 | QApplicationPrivate::set_font = 0; | - |
358 | app_fonts()->clear(); | - |
359 | | - |
360 | delete QApplicationPrivate::app_style; | - |
361 | QApplicationPrivate::app_style = 0; | - |
362 | delete QApplicationPrivate::app_icon; | - |
363 | QApplicationPrivate::app_icon = 0; | - |
364 | | - |
365 | | - |
366 | if (qt_is_gui_used) partially evaluated: qt_is_gui_used yes Evaluation Count:213 | no Evaluation Count:0 |
| 0-213 |
367 | delete QDragManager::self(); executed: delete QDragManager::self(); Execution Count:213 | 213 |
368 | | - |
369 | | - |
370 | d->cleanupMultitouch(); | - |
371 | | - |
372 | qt_cleanup(); | - |
373 | | - |
374 | if (QApplicationPrivate::widgetCount) partially evaluated: QApplicationPrivate::widgetCount no Evaluation Count:0 | yes Evaluation Count:213 |
| 0-213 |
375 | QMessageLogger("kernel/qapplication.cpp", 745, __PRETTY_FUNCTION__).debug("Widgets left: %i Max widgets: %i \n", QWidgetPrivate::instanceCounter, QWidgetPrivate::maxInstances); never executed: QMessageLogger("kernel/qapplication.cpp", 745, __PRETTY_FUNCTION__).debug("Widgets left: %i Max widgets: %i \n", QWidgetPrivate::instanceCounter, QWidgetPrivate::maxInstances); | 0 |
376 | | - |
377 | QApplicationPrivate::obey_desktop_settings = true; | - |
378 | | - |
379 | QApplicationPrivate::app_strut = QSize(0, 0); | - |
380 | QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; | - |
381 | QApplicationPrivate::widgetCount = false; | - |
382 | | - |
383 | | - |
384 | | - |
385 | qUnregisterGuiStateMachine(); | - |
386 | | - |
387 | } executed: } Execution Count:213 | 213 |
388 | QWidget *QApplication::widgetAt(const QPoint &p) | - |
389 | { | - |
390 | QWidget *window = QApplication::topLevelAt(p); | - |
391 | if (!window) partially evaluated: !window no Evaluation Count:0 | yes Evaluation Count:111 |
| 0-111 |
392 | return 0; never executed: return 0; | 0 |
393 | | - |
394 | QWidget *child = 0; | - |
395 | | - |
396 | if (!window->testAttribute(Qt::WA_TransparentForMouseEvents)) partially evaluated: !window->testAttribute(Qt::WA_TransparentForMouseEvents) yes Evaluation Count:111 | no Evaluation Count:0 |
| 0-111 |
397 | child = window->childAt(window->mapFromGlobal(p)); executed: child = window->childAt(window->mapFromGlobal(p)); Execution Count:111 | 111 |
398 | | - |
399 | if (child) partially evaluated: child no Evaluation Count:0 | yes Evaluation Count:111 |
| 0-111 |
400 | return child; never executed: return child; | 0 |
401 | | - |
402 | if (window->testAttribute(Qt::WA_TransparentForMouseEvents)) { partially evaluated: window->testAttribute(Qt::WA_TransparentForMouseEvents) no Evaluation Count:0 | yes Evaluation Count:111 |
| 0-111 |
403 | | - |
404 | | - |
405 | | - |
406 | int x = p.x(); | - |
407 | int y = p.y(); | - |
408 | QRegion oldmask = window->mask(); | - |
409 | QPoint wpoint = window->mapFromGlobal(QPoint(x, y)); | - |
410 | QRegion newmask = (oldmask.isEmpty() ? QRegion(window->rect()) : oldmask) never evaluated: oldmask.isEmpty() | 0 |
411 | - QRegion(wpoint.x(), wpoint.y(), 1, 1); | - |
412 | window->setMask(newmask); | - |
413 | QWidget *recurse = 0; | - |
414 | if (QApplication::topLevelAt(p) != window) never evaluated: QApplication::topLevelAt(p) != window | 0 |
415 | recurse = widgetAt(x, y); never executed: recurse = widgetAt(x, y); | 0 |
416 | if (oldmask.isEmpty()) never evaluated: oldmask.isEmpty() | 0 |
417 | window->clearMask(); never executed: window->clearMask(); | 0 |
418 | else | - |
419 | window->setMask(oldmask); never executed: window->setMask(oldmask); | 0 |
420 | return recurse; never executed: return recurse; | 0 |
421 | } | - |
422 | return window; executed: return window; Execution Count:111 | 111 |
423 | } | - |
424 | bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) | - |
425 | { | - |
426 | if ((event->type() == QEvent::UpdateRequest evaluated: event->type() == QEvent::UpdateRequest yes Evaluation Count:5607 | yes Evaluation Count:36831 |
| 5607-36831 |
427 | || event->type() == QEvent::LayoutRequest evaluated: event->type() == QEvent::LayoutRequest yes Evaluation Count:18208 | yes Evaluation Count:18623 |
| 18208-18623 |
428 | || event->type() == QEvent::Resize partially evaluated: event->type() == QEvent::Resize no Evaluation Count:0 | yes Evaluation Count:18623 |
| 0-18623 |
429 | || event->type() == QEvent::Move partially evaluated: event->type() == QEvent::Move no Evaluation Count:0 | yes Evaluation Count:18623 |
| 0-18623 |
430 | || event->type() == QEvent::LanguageChange evaluated: event->type() == QEvent::LanguageChange yes Evaluation Count:1 | yes Evaluation Count:18622 |
| 1-18622 |
431 | || event->type() == QEvent::InputMethod)) { partially evaluated: event->type() == QEvent::InputMethod no Evaluation Count:0 | yes Evaluation Count:18622 |
| 0-18622 |
432 | for (QPostEventList::const_iterator it = postedEvents->constBegin(); it != postedEvents->constEnd(); ++it) { evaluated: it != postedEvents->constEnd() yes Evaluation Count:4065903 | yes Evaluation Count:16521 |
| 16521-4065903 |
433 | const QPostEvent &cur = *it; | - |
434 | if (cur.receiver != receiver || cur.event == 0 || cur.event->type() != event->type()) evaluated: cur.receiver != receiver yes Evaluation Count:4028100 | yes Evaluation Count:37803 |
evaluated: cur.event == 0 yes Evaluation Count:1923 | yes Evaluation Count:35880 |
evaluated: cur.event->type() != event->type() yes Evaluation Count:28585 | yes Evaluation Count:7295 |
| 1923-4028100 |
435 | continue; executed: continue; Execution Count:4058608 | 4058608 |
436 | if (cur.event->type() == QEvent::LayoutRequest evaluated: cur.event->type() == QEvent::LayoutRequest yes Evaluation Count:4542 | yes Evaluation Count:2753 |
| 2753-4542 |
437 | || cur.event->type() == QEvent::UpdateRequest) { partially evaluated: cur.event->type() == QEvent::UpdateRequest yes Evaluation Count:2753 | no Evaluation Count:0 |
| 0-2753 |
438 | ; | - |
439 | } else if (cur.event->type() == QEvent::Resize) { executed: } Execution Count:7295 never evaluated: cur.event->type() == QEvent::Resize | 0-7295 |
440 | ((QResizeEvent *)(cur.event))->s = ((QResizeEvent *)event)->s; | - |
441 | } else if (cur.event->type() == QEvent::Move) { never evaluated: cur.event->type() == QEvent::Move | 0 |
442 | ((QMoveEvent *)(cur.event))->p = ((QMoveEvent *)event)->p; | - |
443 | } else if (cur.event->type() == QEvent::LanguageChange) { never evaluated: cur.event->type() == QEvent::LanguageChange | 0 |
444 | ; | - |
445 | } else if ( cur.event->type() == QEvent::InputMethod ) { never evaluated: cur.event->type() == QEvent::InputMethod | 0 |
446 | *(QInputMethodEvent *)(cur.event) = *(QInputMethodEvent *)event; | - |
447 | } else { | 0 |
448 | continue; never executed: continue; | 0 |
449 | } | - |
450 | delete event; | - |
451 | return true; executed: return true; Execution Count:7295 | 7295 |
452 | } | - |
453 | return false; executed: return false; Execution Count:16521 | 16521 |
454 | } | - |
455 | return QGuiApplication::compressEvent(event, receiver, postedEvents); executed: return QGuiApplication::compressEvent(event, receiver, postedEvents); Execution Count:18622 | 18622 |
456 | } | - |
457 | void QApplication::setAutoSipEnabled(const bool enabled) | - |
458 | { | - |
459 | QApplicationPrivate::autoSipEnabled = enabled; | - |
460 | } | 0 |
461 | | - |
462 | bool QApplication::autoSipEnabled() const | - |
463 | { | - |
464 | return QApplicationPrivate::autoSipEnabled; executed: return QApplicationPrivate::autoSipEnabled; Execution Count:10 | 10 |
465 | } | - |
466 | | - |
467 | | - |
468 | | - |
469 | QString QApplication::styleSheet() const | - |
470 | { | - |
471 | return QApplicationPrivate::styleSheet; executed: return QApplicationPrivate::styleSheet; Execution Count:46368 | 46368 |
472 | } | - |
473 | | - |
474 | void QApplication::setStyleSheet(const QString& styleSheet) | - |
475 | { | - |
476 | QApplicationPrivate::styleSheet = styleSheet; | - |
477 | QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle*>(QApplicationPrivate::app_style); | - |
478 | if (styleSheet.isEmpty()) { evaluated: styleSheet.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:3 |
| 2-3 |
479 | if (!proxy) partially evaluated: !proxy no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
480 | return; | 0 |
481 | setStyle(proxy->base); | - |
482 | } else if (proxy) { partially evaluated: proxy no Evaluation Count:0 | yes Evaluation Count:3 |
executed: } Execution Count:2 | 0-3 |
483 | proxy->repolish((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
484 | } else { | 0 |
485 | QStyleSheetStyle *newProxy = new QStyleSheetStyle(QApplicationPrivate::app_style); | - |
486 | QApplicationPrivate::app_style->setParent(newProxy); | - |
487 | setStyle(newProxy); | - |
488 | } executed: } Execution Count:3 | 3 |
489 | } | - |
490 | QStyle *QApplication::style() | - |
491 | { | - |
492 | if (QApplicationPrivate::app_style) evaluated: QApplicationPrivate::app_style yes Evaluation Count:1508584 | yes Evaluation Count:214 |
| 214-1508584 |
493 | return QApplicationPrivate::app_style; executed: return QApplicationPrivate::app_style; Execution Count:1508584 | 1508584 |
494 | if (!qobject_cast<QApplication *>(QCoreApplication::instance())) { partially evaluated: !qobject_cast<QApplication *>(QCoreApplication::instance()) no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
495 | qt_noop(); | - |
496 | return 0; never executed: return 0; | 0 |
497 | } | - |
498 | | - |
499 | if (!QApplicationPrivate::app_style) { partially evaluated: !QApplicationPrivate::app_style yes Evaluation Count:214 | no Evaluation Count:0 |
| 0-214 |
500 | | - |
501 | | - |
502 | QString style; | - |
503 | | - |
504 | | - |
505 | | - |
506 | QString envStyle; | - |
507 | | - |
508 | if (!QApplicationPrivate::styleOverride.isEmpty()) { evaluated: !QApplicationPrivate::styleOverride.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:212 |
| 2-212 |
509 | style = QApplicationPrivate::styleOverride; | - |
510 | } else if (!envStyle.isEmpty()) { partially evaluated: !envStyle.isEmpty() no Evaluation Count:0 | yes Evaluation Count:212 |
executed: } Execution Count:2 | 0-212 |
511 | style = envStyle; | - |
512 | } else { | 0 |
513 | style = QApplicationPrivate::desktopStyleKey(); | - |
514 | } executed: } Execution Count:212 | 212 |
515 | | - |
516 | QStyle *&app_style = QApplicationPrivate::app_style; | - |
517 | app_style = QStyleFactory::create(style); | - |
518 | if (!app_style) { partially evaluated: !app_style no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
519 | QStringList styles = QStyleFactory::keys(); | - |
520 | for (int i = 0; i < styles.size(); ++i) { never evaluated: i < styles.size() | 0 |
521 | if ((app_style = QStyleFactory::create(styles.at(i)))) never evaluated: (app_style = QStyleFactory::create(styles.at(i))) | 0 |
522 | break; | 0 |
523 | } | 0 |
524 | } | 0 |
525 | if (!app_style) { partially evaluated: !app_style no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
526 | qt_noop(); | - |
527 | return 0; never executed: return 0; | 0 |
528 | } | - |
529 | } executed: } Execution Count:214 | 214 |
530 | | - |
531 | QApplicationPrivate::app_style->setParent((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
532 | | - |
533 | initSystemPalette(); | - |
534 | | - |
535 | if (QApplicationPrivate::set_pal) partially evaluated: QApplicationPrivate::set_pal no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
536 | QApplication::setPalette(*QApplicationPrivate::set_pal); never executed: QApplication::setPalette(*QApplicationPrivate::set_pal); | 0 |
537 | | - |
538 | | - |
539 | if (!QApplicationPrivate::styleSheet.isEmpty()) { partially evaluated: !QApplicationPrivate::styleSheet.isEmpty() no Evaluation Count:0 | yes Evaluation Count:214 |
| 0-214 |
540 | (static_cast<QApplication *>(QCoreApplication::instance()))->setStyleSheet(QApplicationPrivate::styleSheet); | - |
541 | } else | 0 |
542 | | - |
543 | QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); executed: QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); Execution Count:214 | 214 |
544 | | - |
545 | return QApplicationPrivate::app_style; executed: return QApplicationPrivate::app_style; Execution Count:214 | 214 |
546 | } | - |
547 | void QApplication::setStyle(QStyle *style) | - |
548 | { | - |
549 | if (!style || style == QApplicationPrivate::app_style) partially evaluated: !style no Evaluation Count:0 | yes Evaluation Count:96 |
evaluated: style == QApplicationPrivate::app_style yes Evaluation Count:31 | yes Evaluation Count:65 |
| 0-96 |
550 | return; executed: return; Execution Count:31 | 31 |
551 | | - |
552 | QWidgetList all = allWidgets(); | - |
553 | | - |
554 | | - |
555 | if (QApplicationPrivate::app_style) { evaluated: QApplicationPrivate::app_style yes Evaluation Count:64 | yes Evaluation Count:1 |
| 1-64 |
556 | if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { partially evaluated: QApplicationPrivate::is_app_running yes Evaluation Count:64 | no Evaluation Count:0 |
partially evaluated: !QApplicationPrivate::is_app_closing yes Evaluation Count:64 | no Evaluation Count:0 |
| 0-64 |
557 | for (QWidgetList::ConstIterator it = all.constBegin(); it != all.constEnd(); ++it) { evaluated: it != all.constEnd() yes Evaluation Count:3239 | yes Evaluation Count:64 |
| 64-3239 |
558 | register QWidget *w = *it; | - |
559 | if (!(w->windowType() == Qt::Desktop) && evaluated: !(w->windowType() == Qt::Desktop) yes Evaluation Count:3117 | yes Evaluation Count:122 |
| 122-3117 |
560 | w->testAttribute(Qt::WA_WState_Polished)) { evaluated: w->testAttribute(Qt::WA_WState_Polished) yes Evaluation Count:2958 | yes Evaluation Count:159 |
| 159-2958 |
561 | QApplicationPrivate::app_style->unpolish(w); | - |
562 | } executed: } Execution Count:2958 | 2958 |
563 | } executed: } Execution Count:3239 | 3239 |
564 | } executed: } Execution Count:64 | 64 |
565 | QApplicationPrivate::app_style->unpolish((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
566 | } executed: } Execution Count:64 | 64 |
567 | | - |
568 | QStyle *old = QApplicationPrivate::app_style; | - |
569 | | - |
570 | | - |
571 | if (!QApplicationPrivate::styleSheet.isEmpty() && !qobject_cast<QStyleSheetStyle *>(style)) { evaluated: !QApplicationPrivate::styleSheet.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:62 |
partially evaluated: !qobject_cast<QStyleSheetStyle *>(style) no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-62 |
572 | | - |
573 | QStyleSheetStyle *newProxy = new QStyleSheetStyle(style); | - |
574 | style->setParent(newProxy); | - |
575 | QApplicationPrivate::app_style = newProxy; | - |
576 | } else | 0 |
577 | | - |
578 | QApplicationPrivate::app_style = style; executed: QApplicationPrivate::app_style = style; Execution Count:65 | 65 |
579 | QApplicationPrivate::app_style->setParent((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
580 | | - |
581 | | - |
582 | | - |
583 | | - |
584 | if (QApplicationPrivate::set_pal) { partially evaluated: QApplicationPrivate::set_pal no Evaluation Count:0 | yes Evaluation Count:65 |
| 0-65 |
585 | QApplication::setPalette(*QApplicationPrivate::set_pal); | - |
586 | } else if (QApplicationPrivate::sys_pal) { evaluated: QApplicationPrivate::sys_pal yes Evaluation Count:64 | yes Evaluation Count:1 |
| 0-64 |
587 | QApplicationPrivate::initializeWidgetPaletteHash(); | - |
588 | QApplicationPrivate::setPalette_helper(*QApplicationPrivate::sys_pal, 0, false); | - |
589 | } else if (!QApplicationPrivate::sys_pal) { executed: } Execution Count:64 partially evaluated: !QApplicationPrivate::sys_pal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-64 |
590 | | - |
591 | QApplicationPrivate::setSystemPalette(QApplicationPrivate::app_style->standardPalette()); | - |
592 | } executed: } Execution Count:1 | 1 |
593 | | - |
594 | | - |
595 | QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); | - |
596 | | - |
597 | | - |
598 | if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { evaluated: QApplicationPrivate::is_app_running yes Evaluation Count:64 | yes Evaluation Count:1 |
partially evaluated: !QApplicationPrivate::is_app_closing yes Evaluation Count:64 | no Evaluation Count:0 |
| 0-64 |
599 | for (QWidgetList::ConstIterator it1 = all.constBegin(); it1 != all.constEnd(); ++it1) { evaluated: it1 != all.constEnd() yes Evaluation Count:3239 | yes Evaluation Count:64 |
| 64-3239 |
600 | register QWidget *w = *it1; | - |
601 | if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished)) { evaluated: w->windowType() != Qt::Desktop yes Evaluation Count:3117 | yes Evaluation Count:122 |
evaluated: w->testAttribute(Qt::WA_WState_Polished) yes Evaluation Count:2958 | yes Evaluation Count:159 |
| 122-3117 |
602 | if (w->style() == QApplicationPrivate::app_style) partially evaluated: w->style() == QApplicationPrivate::app_style yes Evaluation Count:2958 | no Evaluation Count:0 |
| 0-2958 |
603 | QApplicationPrivate::app_style->polish(w); executed: QApplicationPrivate::app_style->polish(w); Execution Count:2958 | 2958 |
604 | | - |
605 | else | - |
606 | w->setStyleSheet(w->styleSheet()); never executed: w->setStyleSheet(w->styleSheet()); | 0 |
607 | | - |
608 | } | - |
609 | } executed: } Execution Count:3239 | 3239 |
610 | | - |
611 | for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) { evaluated: it2 != all.constEnd() yes Evaluation Count:3239 | yes Evaluation Count:64 |
| 64-3239 |
612 | register QWidget *w = *it2; | - |
613 | if (w->windowType() != Qt::Desktop && !w->testAttribute(Qt::WA_SetStyle)) { evaluated: w->windowType() != Qt::Desktop yes Evaluation Count:3117 | yes Evaluation Count:122 |
evaluated: !w->testAttribute(Qt::WA_SetStyle) yes Evaluation Count:3116 | yes Evaluation Count:1 |
| 1-3117 |
614 | QEvent e(QEvent::StyleChange); | - |
615 | QApplication::sendEvent(w, &e); | - |
616 | w->update(); | - |
617 | } executed: } Execution Count:3116 | 3116 |
618 | } executed: } Execution Count:3239 | 3239 |
619 | } executed: } Execution Count:64 | 64 |
620 | | - |
621 | | - |
622 | if (QStyleSheetStyle *oldProxy = qobject_cast<QStyleSheetStyle *>(old)) { evaluated: QStyleSheetStyle *oldProxy = qobject_cast<QStyleSheetStyle *>(old) yes Evaluation Count:2 | yes Evaluation Count:63 |
| 2-63 |
623 | oldProxy->deref(); | - |
624 | } else executed: } Execution Count:2 | 2 |
625 | | - |
626 | if (old && old->parent() == (static_cast<QApplication *>(QCoreApplication::instance()))) { evaluated: old yes Evaluation Count:62 | yes Evaluation Count:1 |
evaluated: old->parent() == (static_cast<QApplication *>(QCoreApplication::instance())) yes Evaluation Count:59 | yes Evaluation Count:3 |
| 1-62 |
627 | delete old; | - |
628 | } executed: } Execution Count:59 | 59 |
629 | | - |
630 | if (QApplicationPrivate::focus_widget) { evaluated: QApplicationPrivate::focus_widget yes Evaluation Count:3 | yes Evaluation Count:62 |
| 3-62 |
631 | QFocusEvent in(QEvent::FocusIn, Qt::OtherFocusReason); | - |
632 | QApplication::sendEvent(QApplicationPrivate::focus_widget->style(), &in); | - |
633 | QApplicationPrivate::focus_widget->update(); | - |
634 | } executed: } Execution Count:3 | 3 |
635 | } executed: } Execution Count:65 | 65 |
636 | QStyle* QApplication::setStyle(const QString& style) | - |
637 | { | - |
638 | QStyle *s = QStyleFactory::create(style); | - |
639 | if (!s) partially evaluated: !s no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
640 | return 0; never executed: return 0; | 0 |
641 | | - |
642 | setStyle(s); | - |
643 | return s; executed: return s; Execution Count:1 | 1 |
644 | } | - |
645 | | - |
646 | | - |
647 | | - |
648 | | - |
649 | | - |
650 | | - |
651 | | - |
652 | int QApplication::colorSpec() | - |
653 | { | - |
654 | return QApplicationPrivate::app_cspec; never executed: return QApplicationPrivate::app_cspec; | 0 |
655 | } | - |
656 | void QApplication::setColorSpec(int spec) | - |
657 | { | - |
658 | if ((static_cast<QApplication *>(QCoreApplication::instance()))) never evaluated: (static_cast<QApplication *>(QCoreApplication::instance())) | 0 |
659 | QMessageLogger("kernel/qapplication.cpp", 1222, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " | 0 |
660 | "called before the QApplication object is created"); never executed: QMessageLogger("kernel/qapplication.cpp", 1222, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " "called before the QApplication object is created"); | 0 |
661 | QApplicationPrivate::app_cspec = spec; | - |
662 | } | 0 |
663 | QSize QApplication::globalStrut() | - |
664 | { | - |
665 | return QApplicationPrivate::app_strut; executed: return QApplicationPrivate::app_strut; Execution Count:241925 | 241925 |
666 | } | - |
667 | | - |
668 | void QApplication::setGlobalStrut(const QSize& strut) | - |
669 | { | - |
670 | QApplicationPrivate::app_strut = strut; | - |
671 | } | 0 |
672 | QPalette QApplication::palette(const QWidget* w) | - |
673 | { | - |
674 | PaletteHash *hash = app_palettes(); | - |
675 | if (w && hash && hash->size()) { partially evaluated: w yes Evaluation Count:85005 | no Evaluation Count:0 |
partially evaluated: hash yes Evaluation Count:85005 | no Evaluation Count:0 |
evaluated: hash->size() yes Evaluation Count:846 | yes Evaluation Count:84159 |
| 0-85005 |
676 | QHash<QByteArray, QPalette>::ConstIterator it = hash->constFind(w->metaObject()->className()); | - |
677 | if (it != hash->constEnd()) evaluated: it != hash->constEnd() yes Evaluation Count:6 | yes Evaluation Count:840 |
| 6-840 |
678 | return *it; executed: return *it; Execution Count:6 | 6 |
679 | for (it = hash->constBegin(); it != hash->constEnd(); ++it) { evaluated: it != hash->constEnd() yes Evaluation Count:840 | yes Evaluation Count:840 |
| 840 |
680 | if (w->inherits(it.key())) partially evaluated: w->inherits(it.key()) no Evaluation Count:0 | yes Evaluation Count:840 |
| 0-840 |
681 | return it.value(); never executed: return it.value(); | 0 |
682 | } executed: } Execution Count:840 | 840 |
683 | } executed: } Execution Count:840 | 840 |
684 | return palette(); executed: return palette(); Execution Count:84999 | 84999 |
685 | } | - |
686 | QPalette QApplication::palette(const char *className) | - |
687 | { | - |
688 | if (!QApplicationPrivate::app_pal) partially evaluated: !QApplicationPrivate::app_pal no Evaluation Count:0 | yes Evaluation Count:291 |
| 0-291 |
689 | palette(); never executed: palette(); | 0 |
690 | PaletteHash *hash = app_palettes(); | - |
691 | if (className && hash && hash->size()) { partially evaluated: className yes Evaluation Count:291 | no Evaluation Count:0 |
partially evaluated: hash yes Evaluation Count:291 | no Evaluation Count:0 |
partially evaluated: hash->size() no Evaluation Count:0 | yes Evaluation Count:291 |
| 0-291 |
692 | QHash<QByteArray, QPalette>::ConstIterator it = hash->constFind(className); | - |
693 | if (it != hash->constEnd()) never evaluated: it != hash->constEnd() | 0 |
694 | return *it; never executed: return *it; | 0 |
695 | } | 0 |
696 | return *QApplicationPrivate::app_pal; executed: return *QApplicationPrivate::app_pal; Execution Count:291 | 291 |
697 | } | - |
698 | | - |
699 | void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash) | - |
700 | { | - |
701 | QPalette pal = palette; | - |
702 | | - |
703 | if (QApplicationPrivate::app_style) partially evaluated: QApplicationPrivate::app_style yes Evaluation Count:284 | no Evaluation Count:0 |
| 0-284 |
704 | QApplicationPrivate::app_style->polish(pal); executed: QApplicationPrivate::app_style->polish(pal); Execution Count:284 | 284 |
705 | | - |
706 | bool all = false; | - |
707 | PaletteHash *hash = app_palettes(); | - |
708 | if (!className) { evaluated: !className yes Evaluation Count:282 | yes Evaluation Count:2 |
| 2-282 |
709 | if (QApplicationPrivate::app_pal && pal.isCopyOf(*QApplicationPrivate::app_pal)) evaluated: QApplicationPrivate::app_pal yes Evaluation Count:67 | yes Evaluation Count:215 |
evaluated: pal.isCopyOf(*QApplicationPrivate::app_pal) yes Evaluation Count:65 | yes Evaluation Count:2 |
| 2-215 |
710 | return; executed: return; Execution Count:65 | 65 |
711 | if (!QApplicationPrivate::app_pal) evaluated: !QApplicationPrivate::app_pal yes Evaluation Count:215 | yes Evaluation Count:2 |
| 2-215 |
712 | QApplicationPrivate::app_pal = new QPalette(pal); executed: QApplicationPrivate::app_pal = new QPalette(pal); Execution Count:215 | 215 |
713 | else | - |
714 | *QApplicationPrivate::app_pal = pal; executed: *QApplicationPrivate::app_pal = pal; Execution Count:2 | 2 |
715 | if (hash && hash->size()) { partially evaluated: hash yes Evaluation Count:217 | no Evaluation Count:0 |
evaluated: hash->size() yes Evaluation Count:1 | yes Evaluation Count:216 |
| 0-217 |
716 | all = true; | - |
717 | if (clearWidgetPaletteHash) partially evaluated: clearWidgetPaletteHash yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
718 | hash->clear(); executed: hash->clear(); Execution Count:1 | 1 |
719 | } executed: } Execution Count:1 | 1 |
720 | } else if (hash) { executed: } Execution Count:217 partially evaluated: hash yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-217 |
721 | hash->insert(className, pal); | - |
722 | } executed: } Execution Count:2 | 2 |
723 | | - |
724 | if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { evaluated: QApplicationPrivate::is_app_running yes Evaluation Count:218 | yes Evaluation Count:1 |
partially evaluated: !QApplicationPrivate::is_app_closing yes Evaluation Count:218 | no Evaluation Count:0 |
| 0-218 |
725 | | - |
726 | QEvent e(QEvent::ApplicationPaletteChange); | - |
727 | QApplication::sendEvent(QApplication::instance(), &e); | - |
728 | | - |
729 | QWidgetList wids = QApplication::allWidgets(); | - |
730 | for (QWidgetList::ConstIterator it = wids.constBegin(); it != wids.constEnd(); ++it) { evaluated: it != wids.constEnd() yes Evaluation Count:71 | yes Evaluation Count:218 |
| 71-218 |
731 | register QWidget *w = *it; | - |
732 | if (all || (!className && w->isWindow()) || w->inherits(className)) evaluated: all yes Evaluation Count:27 | yes Evaluation Count:44 |
evaluated: !className yes Evaluation Count:28 | yes Evaluation Count:16 |
evaluated: w->isWindow() yes Evaluation Count:5 | yes Evaluation Count:23 |
evaluated: w->inherits(className) yes Evaluation Count:1 | yes Evaluation Count:38 |
| 1-44 |
733 | QApplication::sendEvent(w, &e); executed: QApplication::sendEvent(w, &e); Execution Count:33 | 33 |
734 | } executed: } Execution Count:71 | 71 |
735 | | - |
736 | | - |
737 | | - |
738 | QList<QGraphicsScene *> &scenes = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->scene_list; | - |
739 | for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin(); | - |
740 | it != scenes.constEnd(); ++it) { partially evaluated: it != scenes.constEnd() no Evaluation Count:0 | yes Evaluation Count:218 |
| 0-218 |
741 | QApplication::sendEvent(*it, &e); | - |
742 | } | 0 |
743 | | - |
744 | } executed: } Execution Count:218 | 218 |
745 | if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) { evaluated: !className yes Evaluation Count:217 | yes Evaluation Count:2 |
partially evaluated: !QApplicationPrivate::sys_pal no Evaluation Count:0 | yes Evaluation Count:217 |
evaluated: !palette.isCopyOf(*QApplicationPrivate::sys_pal) yes Evaluation Count:1 | yes Evaluation Count:216 |
| 0-217 |
746 | if (!QApplicationPrivate::set_pal) partially evaluated: !QApplicationPrivate::set_pal yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
747 | QApplicationPrivate::set_pal = new QPalette(palette); executed: QApplicationPrivate::set_pal = new QPalette(palette); Execution Count:1 | 1 |
748 | else | - |
749 | *QApplicationPrivate::set_pal = palette; never executed: *QApplicationPrivate::set_pal = palette; | 0 |
750 | } | - |
751 | } executed: } Execution Count:219 | 219 |
752 | void QApplication::setPalette(const QPalette &palette, const char* className) | - |
753 | { | - |
754 | QApplicationPrivate::setPalette_helper(palette, className, true); | - |
755 | } executed: } Execution Count:220 | 220 |
756 | | - |
757 | | - |
758 | | - |
759 | void QApplicationPrivate::setSystemPalette(const QPalette &pal) | - |
760 | { | - |
761 | QPalette adjusted; | - |
762 | adjusted = pal; | - |
763 | | - |
764 | | - |
765 | if (!sys_pal) partially evaluated: !sys_pal yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
766 | sys_pal = new QPalette(adjusted); executed: sys_pal = new QPalette(adjusted); Execution Count:215 | 215 |
767 | else | - |
768 | *sys_pal = adjusted; never executed: *sys_pal = adjusted; | 0 |
769 | | - |
770 | | - |
771 | if (!QApplicationPrivate::set_pal) partially evaluated: !QApplicationPrivate::set_pal yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
772 | QApplication::setPalette(*sys_pal); executed: QApplication::setPalette(*sys_pal); Execution Count:215 | 215 |
773 | } executed: } Execution Count:215 | 215 |
774 | | - |
775 | | - |
776 | | - |
777 | | - |
778 | | - |
779 | | - |
780 | QFont QApplication::font() | - |
781 | { | - |
782 | return QGuiApplication::font(); executed: return QGuiApplication::font(); Execution Count:159229 | 159229 |
783 | } | - |
784 | QFont QApplication::font(const QWidget *widget) | - |
785 | { | - |
786 | FontHash *hash = app_fonts(); | - |
787 | | - |
788 | if (widget && hash && hash->size()) { partially evaluated: widget yes Evaluation Count:79780 | no Evaluation Count:0 |
partially evaluated: hash yes Evaluation Count:79780 | no Evaluation Count:0 |
evaluated: hash->size() yes Evaluation Count:1565 | yes Evaluation Count:78215 |
| 0-79780 |
789 | QHash<QByteArray, QFont>::ConstIterator it = | - |
790 | hash->constFind(widget->metaObject()->className()); | - |
791 | if (it != hash->constEnd()) evaluated: it != hash->constEnd() yes Evaluation Count:6 | yes Evaluation Count:1559 |
| 6-1559 |
792 | return it.value(); executed: return it.value(); Execution Count:6 | 6 |
793 | for (it = hash->constBegin(); it != hash->constEnd(); ++it) { evaluated: it != hash->constEnd() yes Evaluation Count:1559 | yes Evaluation Count:1559 |
| 1559 |
794 | if (widget->inherits(it.key())) partially evaluated: widget->inherits(it.key()) no Evaluation Count:0 | yes Evaluation Count:1559 |
| 0-1559 |
795 | return it.value(); never executed: return it.value(); | 0 |
796 | } executed: } Execution Count:1559 | 1559 |
797 | } executed: } Execution Count:1559 | 1559 |
798 | return font(); executed: return font(); Execution Count:79774 | 79774 |
799 | } | - |
800 | QFont QApplication::font(const char *className) | - |
801 | { | - |
802 | FontHash *hash = app_fonts(); | - |
803 | if (className && hash && hash->size()) { partially evaluated: className yes Evaluation Count:434 | no Evaluation Count:0 |
partially evaluated: hash yes Evaluation Count:434 | no Evaluation Count:0 |
evaluated: hash->size() yes Evaluation Count:2 | yes Evaluation Count:432 |
| 0-434 |
804 | QHash<QByteArray, QFont>::ConstIterator it = hash->constFind(className); | - |
805 | if (it != hash->constEnd()) partially evaluated: it != hash->constEnd() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
806 | return *it; never executed: return *it; | 0 |
807 | } executed: } Execution Count:2 | 2 |
808 | return font(); executed: return font(); Execution Count:434 | 434 |
809 | } | - |
810 | void QApplication::setFont(const QFont &font, const char *className) | - |
811 | { | - |
812 | bool all = false; | - |
813 | FontHash *hash = app_fonts(); | - |
814 | if (!className) { evaluated: !className yes Evaluation Count:15 | yes Evaluation Count:2 |
| 2-15 |
815 | QGuiApplication::setFont(font); | - |
816 | if (hash && hash->size()) { partially evaluated: hash yes Evaluation Count:15 | no Evaluation Count:0 |
partially evaluated: hash->size() no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
817 | all = true; | - |
818 | hash->clear(); | - |
819 | } | 0 |
820 | } else if (hash) { executed: } Execution Count:15 partially evaluated: hash yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-15 |
821 | hash->insert(className, font); | - |
822 | } executed: } Execution Count:2 | 2 |
823 | if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { evaluated: QApplicationPrivate::is_app_running yes Evaluation Count:11 | yes Evaluation Count:6 |
partially evaluated: !QApplicationPrivate::is_app_closing yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
824 | | - |
825 | QEvent e(QEvent::ApplicationFontChange); | - |
826 | QApplication::sendEvent(QApplication::instance(), &e); | - |
827 | | - |
828 | QWidgetList wids = QApplication::allWidgets(); | - |
829 | for (QWidgetList::ConstIterator it = wids.constBegin(); it != wids.constEnd(); ++it) { evaluated: it != wids.constEnd() yes Evaluation Count:21 | yes Evaluation Count:11 |
| 11-21 |
830 | register QWidget *w = *it; | - |
831 | if (all || (!className && w->isWindow()) || w->inherits(className)) partially evaluated: all no Evaluation Count:0 | yes Evaluation Count:21 |
evaluated: !className yes Evaluation Count:7 | yes Evaluation Count:14 |
partially evaluated: w->isWindow() yes Evaluation Count:7 | no Evaluation Count:0 |
evaluated: w->inherits(className) yes Evaluation Count:1 | yes Evaluation Count:13 |
| 0-21 |
832 | sendEvent(w, &e); executed: sendEvent(w, &e); Execution Count:8 | 8 |
833 | } executed: } Execution Count:21 | 21 |
834 | | - |
835 | | - |
836 | | - |
837 | QList<QGraphicsScene *> &scenes = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->scene_list; | - |
838 | for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin(); | - |
839 | it != scenes.constEnd(); ++it) { partially evaluated: it != scenes.constEnd() no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
840 | QApplication::sendEvent(*it, &e); | - |
841 | } | 0 |
842 | | - |
843 | } executed: } Execution Count:11 | 11 |
844 | if (!className && (!QApplicationPrivate::sys_font || !font.isCopyOf(*QApplicationPrivate::sys_font))) { evaluated: !className yes Evaluation Count:15 | yes Evaluation Count:2 |
partially evaluated: !QApplicationPrivate::sys_font yes Evaluation Count:15 | no Evaluation Count:0 |
never evaluated: !font.isCopyOf(*QApplicationPrivate::sys_font) | 0-15 |
845 | if (!QApplicationPrivate::set_font) evaluated: !QApplicationPrivate::set_font yes Evaluation Count:14 | yes Evaluation Count:1 |
| 1-14 |
846 | QApplicationPrivate::set_font = new QFont(font); executed: QApplicationPrivate::set_font = new QFont(font); Execution Count:14 | 14 |
847 | else | - |
848 | *QApplicationPrivate::set_font = font; executed: *QApplicationPrivate::set_font = font; Execution Count:1 | 1 |
849 | } | - |
850 | } executed: } Execution Count:17 | 17 |
851 | | - |
852 | | - |
853 | | - |
854 | void QApplicationPrivate::setSystemFont(const QFont &font) | - |
855 | { | - |
856 | if (!sys_font) never evaluated: !sys_font | 0 |
857 | sys_font = new QFont(font); never executed: sys_font = new QFont(font); | 0 |
858 | else | - |
859 | *sys_font = font; never executed: *sys_font = font; | 0 |
860 | | - |
861 | if (!QApplicationPrivate::set_font) never evaluated: !QApplicationPrivate::set_font | 0 |
862 | QApplication::setFont(*sys_font); never executed: QApplication::setFont(*sys_font); | 0 |
863 | } | 0 |
864 | | - |
865 | | - |
866 | | - |
867 | QString QApplicationPrivate::desktopStyleKey() | - |
868 | { | - |
869 | | - |
870 | | - |
871 | if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme() yes Evaluation Count:217 | no Evaluation Count:0 |
| 0-217 |
872 | const QStringList availableKeys = QStyleFactory::keys(); | - |
873 | for (QForeachContainer<__typeof__(theme->themeHint(QPlatformTheme::StyleNames).toStringList())> _container_(theme->themeHint(QPlatformTheme::StyleNames).toStringList()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &style = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
874 | if (availableKeys.contains(style, Qt::CaseInsensitive)) evaluated: availableKeys.contains(style, Qt::CaseInsensitive) yes Evaluation Count:217 | yes Evaluation Count:434 |
| 217-434 |
875 | return style; executed: return style; Execution Count:217 | 217 |
876 | } | 0 |
877 | return QString(); never executed: return QString(); | 0 |
878 | } | - |
879 | | - |
880 | | - |
881 | | - |
882 | | - |
883 | | - |
884 | | - |
885 | | - |
886 | QIcon QApplication::windowIcon() | - |
887 | { | - |
888 | return QApplicationPrivate::app_icon ? *QApplicationPrivate::app_icon : QIcon(); executed: return QApplicationPrivate::app_icon ? *QApplicationPrivate::app_icon : QIcon(); Execution Count:3019 | 3019 |
889 | } | - |
890 | | - |
891 | void QApplication::setWindowIcon(const QIcon &icon) | - |
892 | { | - |
893 | if (!QApplicationPrivate::app_icon) evaluated: !QApplicationPrivate::app_icon yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
894 | QApplicationPrivate::app_icon = new QIcon(); executed: QApplicationPrivate::app_icon = new QIcon(); Execution Count:1 | 1 |
895 | *QApplicationPrivate::app_icon = icon; | - |
896 | if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) { partially evaluated: QApplicationPrivate::is_app_running yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: !QApplicationPrivate::is_app_closing yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
897 | QEvent e(QEvent::ApplicationWindowIconChange); | - |
898 | QWidgetList all = QApplication::allWidgets(); | - |
899 | for (QWidgetList::ConstIterator it = all.constBegin(); it != all.constEnd(); ++it) { evaluated: it != all.constEnd() yes Evaluation Count:58 | yes Evaluation Count:2 |
| 2-58 |
900 | register QWidget *w = *it; | - |
901 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:10 | yes Evaluation Count:48 |
| 10-48 |
902 | sendEvent(w, &e); executed: sendEvent(w, &e); Execution Count:10 | 10 |
903 | } executed: } Execution Count:58 | 58 |
904 | } executed: } Execution Count:2 | 2 |
905 | } executed: } Execution Count:2 | 2 |
906 | QWidgetList QApplication::topLevelWidgets() | - |
907 | { | - |
908 | QWidgetList list; | - |
909 | QWidgetList all = allWidgets(); | - |
910 | | - |
911 | for (QWidgetList::ConstIterator it = all.constBegin(); it != all.constEnd(); ++it) { evaluated: it != all.constEnd() yes Evaluation Count:72686 | yes Evaluation Count:4379 |
| 4379-72686 |
912 | QWidget *w = *it; | - |
913 | if (w->isWindow() && w->windowType() != Qt::Desktop) evaluated: w->isWindow() yes Evaluation Count:18796 | yes Evaluation Count:53890 |
evaluated: w->windowType() != Qt::Desktop yes Evaluation Count:10079 | yes Evaluation Count:8717 |
| 8717-53890 |
914 | list.append(w); executed: list.append(w); Execution Count:10079 | 10079 |
915 | } executed: } Execution Count:72686 | 72686 |
916 | return list; executed: return list; Execution Count:4379 | 4379 |
917 | } | - |
918 | QWidgetList QApplication::allWidgets() | - |
919 | { | - |
920 | if (QWidgetPrivate::allWidgets) evaluated: QWidgetPrivate::allWidgets yes Evaluation Count:4677 | yes Evaluation Count:2 |
| 2-4677 |
921 | return QWidgetPrivate::allWidgets->toList(); executed: return QWidgetPrivate::allWidgets->toList(); Execution Count:4677 | 4677 |
922 | return QWidgetList(); executed: return QWidgetList(); Execution Count:2 | 2 |
923 | } | - |
924 | QWidget *QApplication::focusWidget() | - |
925 | { | - |
926 | return QApplicationPrivate::focus_widget; executed: return QApplicationPrivate::focus_widget; Execution Count:476713 | 476713 |
927 | } | - |
928 | | - |
929 | void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) | - |
930 | { | - |
931 | | - |
932 | if (focus && focus->window()->graphicsProxyWidget()) evaluated: focus yes Evaluation Count:1672 | yes Evaluation Count:1635 |
partially evaluated: focus->window()->graphicsProxyWidget() no Evaluation Count:0 | yes Evaluation Count:1672 |
| 0-1672 |
933 | return; | 0 |
934 | | - |
935 | | - |
936 | hidden_focus_widget = 0; | - |
937 | | - |
938 | if (focus != focus_widget) { evaluated: focus != focus_widget yes Evaluation Count:3020 | yes Evaluation Count:287 |
| 287-3020 |
939 | if (focus && focus->isHidden()) { evaluated: focus yes Evaluation Count:1672 | yes Evaluation Count:1348 |
evaluated: focus->isHidden() yes Evaluation Count:9 | yes Evaluation Count:1663 |
| 9-1672 |
940 | hidden_focus_widget = focus; | - |
941 | return; executed: return; Execution Count:9 | 9 |
942 | } | - |
943 | | - |
944 | if (focus && (reason == Qt::BacktabFocusReason || reason == Qt::TabFocusReason) evaluated: focus yes Evaluation Count:1663 | yes Evaluation Count:1348 |
evaluated: reason == Qt::BacktabFocusReason yes Evaluation Count:15 | yes Evaluation Count:1648 |
evaluated: reason == Qt::TabFocusReason yes Evaluation Count:48 | yes Evaluation Count:1600 |
| 15-1663 |
945 | && qt_in_tab_key_event) evaluated: qt_in_tab_key_event yes Evaluation Count:47 | yes Evaluation Count:16 |
| 16-47 |
946 | focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); executed: focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); Execution Count:47 | 47 |
947 | else if (focus && reason == Qt::ShortcutFocusReason) { evaluated: focus yes Evaluation Count:1616 | yes Evaluation Count:1348 |
evaluated: reason == Qt::ShortcutFocusReason yes Evaluation Count:2 | yes Evaluation Count:1614 |
| 2-1616 |
948 | focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); | - |
949 | } executed: } Execution Count:2 | 2 |
950 | QWidget *prev = focus_widget; | - |
951 | focus_widget = focus; | - |
952 | | - |
953 | if(focus_widget) evaluated: focus_widget yes Evaluation Count:1663 | yes Evaluation Count:1348 |
| 1348-1663 |
954 | focus_widget->d_func()->setFocus_sys(); executed: focus_widget->d_func()->setFocus_sys(); Execution Count:1663 | 1663 |
955 | | - |
956 | if (reason != Qt::NoFocusReason) { evaluated: reason != Qt::NoFocusReason yes Evaluation Count:3008 | yes Evaluation Count:3 |
| 3-3008 |
957 | | - |
958 | | - |
959 | if (prev) { evaluated: prev yes Evaluation Count:1662 | yes Evaluation Count:1346 |
| 1346-1662 |
960 | | - |
961 | | - |
962 | | - |
963 | | - |
964 | | - |
965 | | - |
966 | QFocusEvent out(QEvent::FocusOut, reason); | - |
967 | QPointer<QWidget> that = prev; | - |
968 | QApplication::sendEvent(prev, &out); | - |
969 | if (that) partially evaluated: that yes Evaluation Count:1662 | no Evaluation Count:0 |
| 0-1662 |
970 | QApplication::sendEvent(that->style(), &out); executed: QApplication::sendEvent(that->style(), &out); Execution Count:1662 | 1662 |
971 | } executed: } Execution Count:1662 | 1662 |
972 | if(focus && QApplicationPrivate::focus_widget == focus) { evaluated: focus yes Evaluation Count:1660 | yes Evaluation Count:1348 |
partially evaluated: QApplicationPrivate::focus_widget == focus yes Evaluation Count:1660 | no Evaluation Count:0 |
| 0-1660 |
973 | QFocusEvent in(QEvent::FocusIn, reason); | - |
974 | QPointer<QWidget> that = focus; | - |
975 | QApplication::sendEvent(focus, &in); | - |
976 | if (that) partially evaluated: that yes Evaluation Count:1660 | no Evaluation Count:0 |
| 0-1660 |
977 | QApplication::sendEvent(that->style(), &in); executed: QApplication::sendEvent(that->style(), &in); Execution Count:1660 | 1660 |
978 | } executed: } Execution Count:1660 | 1660 |
979 | (static_cast<QApplication *>(QCoreApplication::instance()))->focusChanged(prev, focus_widget); | - |
980 | } executed: } Execution Count:3008 | 3008 |
981 | } executed: } Execution Count:3011 | 3011 |
982 | } executed: } Execution Count:3298 | 3298 |
983 | QWidget *QApplication::activeWindow() | - |
984 | { | - |
985 | return QApplicationPrivate::active_window; executed: return QApplicationPrivate::active_window; Execution Count:573032 | 573032 |
986 | } | - |
987 | | - |
988 | | - |
989 | | - |
990 | | - |
991 | | - |
992 | | - |
993 | | - |
994 | QFontMetrics QApplication::fontMetrics() | - |
995 | { | - |
996 | return desktop()->fontMetrics(); never executed: return desktop()->fontMetrics(); | 0 |
997 | } | - |
998 | void QApplication::closeAllWindows() | - |
999 | { | - |
1000 | bool did_close = true; | - |
1001 | QWidget *w; | - |
1002 | while ((w = activeModalWidget()) && did_close) { evaluated: (w = activeModalWidget()) yes Evaluation Count:3 | yes Evaluation Count:4 |
partially evaluated: did_close yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-4 |
1003 | if (!w->isVisible() || w->data->is_closing) partially evaluated: !w->isVisible() no Evaluation Count:0 | yes Evaluation Count:3 |
partially evaluated: w->data->is_closing no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
1004 | break; | 0 |
1005 | did_close = w->close(); | - |
1006 | } executed: } Execution Count:3 | 3 |
1007 | QWidgetList list = QApplication::topLevelWidgets(); | - |
1008 | for (int i = 0; did_close && i < list.size(); ++i) { partially evaluated: did_close yes Evaluation Count:41 | no Evaluation Count:0 |
evaluated: i < list.size() yes Evaluation Count:37 | yes Evaluation Count:4 |
| 0-41 |
1009 | w = list.at(i); | - |
1010 | if (w->isVisible() evaluated: w->isVisible() yes Evaluation Count:11 | yes Evaluation Count:26 |
| 11-26 |
1011 | && w->windowType() != Qt::Desktop partially evaluated: w->windowType() != Qt::Desktop yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
1012 | && !w->data->is_closing) { evaluated: !w->data->is_closing yes Evaluation Count:9 | yes Evaluation Count:2 |
| 2-9 |
1013 | did_close = w->close(); | - |
1014 | list = QApplication::topLevelWidgets(); | - |
1015 | i = -1; | - |
1016 | } executed: } Execution Count:9 | 9 |
1017 | } executed: } Execution Count:37 | 37 |
1018 | } executed: } Execution Count:4 | 4 |
1019 | void QApplication::aboutQt() | - |
1020 | { | - |
1021 | | - |
1022 | QMessageBox::aboutQt(activeWindow()); | - |
1023 | | - |
1024 | } | 0 |
1025 | bool QApplication::event(QEvent *e) | - |
1026 | { | - |
1027 | QApplicationPrivate * const d = d_func(); | - |
1028 | if(e->type() == QEvent::Close) { partially evaluated: e->type() == QEvent::Close no Evaluation Count:0 | yes Evaluation Count:2068 |
| 0-2068 |
1029 | QCloseEvent *ce = static_cast<QCloseEvent*>(e); | - |
1030 | ce->accept(); | - |
1031 | closeAllWindows(); | - |
1032 | | - |
1033 | QWidgetList list = topLevelWidgets(); | - |
1034 | for (int i = 0; i < list.size(); ++i) { never evaluated: i < list.size() | 0 |
1035 | QWidget *w = list.at(i); | - |
1036 | if (w->isVisible() && !(w->windowType() == Qt::Desktop) && !(w->windowType() == Qt::Popup) && never evaluated: w->isVisible() never evaluated: !(w->windowType() == Qt::Desktop) never evaluated: !(w->windowType() == Qt::Popup) | 0 |
1037 | (!(w->windowType() == Qt::Dialog) || !w->parentWidget())) { never evaluated: !(w->windowType() == Qt::Dialog) never evaluated: !w->parentWidget() | 0 |
1038 | ce->ignore(); | - |
1039 | break; | 0 |
1040 | } | - |
1041 | } | 0 |
1042 | if (ce->isAccepted()) { never evaluated: ce->isAccepted() | 0 |
1043 | return true; never executed: return true; | 0 |
1044 | } | - |
1045 | | - |
1046 | } else if (e->type() == QEvent::LocaleChange) { partially evaluated: e->type() == QEvent::LocaleChange no Evaluation Count:0 | yes Evaluation Count:2068 |
| 0-2068 |
1047 | | - |
1048 | | - |
1049 | QWidgetList list = topLevelWidgets(); | - |
1050 | for (int i = 0; i < list.size(); ++i) { never evaluated: i < list.size() | 0 |
1051 | QWidget *w = list.at(i); | - |
1052 | if (!(w->windowType() == Qt::Desktop)) { never evaluated: !(w->windowType() == Qt::Desktop) | 0 |
1053 | if (!w->testAttribute(Qt::WA_SetLocale)) never evaluated: !w->testAttribute(Qt::WA_SetLocale) | 0 |
1054 | w->d_func()->setLocale_helper(QLocale(), true); never executed: w->d_func()->setLocale_helper(QLocale(), true); | 0 |
1055 | } | 0 |
1056 | } | 0 |
1057 | | - |
1058 | } else if (e->type() == QEvent::Timer) { evaluated: e->type() == QEvent::Timer yes Evaluation Count:25 | yes Evaluation Count:2043 |
| 0-2043 |
1059 | QTimerEvent *te = static_cast<QTimerEvent*>(e); | - |
1060 | qt_noop(); | - |
1061 | if (te->timerId() == d->toolTipWakeUp.timerId()) { evaluated: te->timerId() == d->toolTipWakeUp.timerId() yes Evaluation Count:4 | yes Evaluation Count:21 |
| 4-21 |
1062 | d->toolTipWakeUp.stop(); | - |
1063 | if (d->toolTipWidget) { evaluated: d->toolTipWidget yes Evaluation Count:3 | yes Evaluation Count:1 |
| 1-3 |
1064 | QWidget *w = d->toolTipWidget->window(); | - |
1065 | | - |
1066 | | - |
1067 | | - |
1068 | bool showToolTip = w->testAttribute(Qt::WA_AlwaysShowToolTips); | - |
1069 | while (w && !showToolTip) { evaluated: w yes Evaluation Count:3 | yes Evaluation Count:3 |
partially evaluated: !showToolTip yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
1070 | showToolTip = w->isActiveWindow(); | - |
1071 | w = w->parentWidget(); | - |
1072 | w = w ? w->window() : 0; partially evaluated: w no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
1073 | } executed: } Execution Count:3 | 3 |
1074 | if (showToolTip) { partially evaluated: showToolTip yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
1075 | QHelpEvent e(QEvent::ToolTip, d->toolTipPos, d->toolTipGlobalPos); | - |
1076 | QApplication::sendEvent(d->toolTipWidget, &e); | - |
1077 | if (e.isAccepted()) evaluated: e.isAccepted() yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
1078 | d->toolTipFallAsleep.start(2000, this); executed: d->toolTipFallAsleep.start(2000, this); Execution Count:2 | 2 |
1079 | } executed: } Execution Count:3 | 3 |
1080 | } executed: } Execution Count:3 | 3 |
1081 | } else if (te->timerId() == d->toolTipFallAsleep.timerId()) { executed: } Execution Count:4 evaluated: te->timerId() == d->toolTipFallAsleep.timerId() yes Evaluation Count:1 | yes Evaluation Count:20 |
| 1-20 |
1082 | d->toolTipFallAsleep.stop(); | - |
1083 | } executed: } Execution Count:1 | 1 |
1084 | } | - |
1085 | | - |
1086 | if(e->type() == QEvent::LanguageChange) { partially evaluated: e->type() == QEvent::LanguageChange no Evaluation Count:0 | yes Evaluation Count:2068 |
| 0-2068 |
1087 | QWidgetList list = topLevelWidgets(); | - |
1088 | for (int i = 0; i < list.size(); ++i) { never evaluated: i < list.size() | 0 |
1089 | QWidget *w = list.at(i); | - |
1090 | if (!(w->windowType() == Qt::Desktop)) never evaluated: !(w->windowType() == Qt::Desktop) | 0 |
1091 | postEvent(w, new QEvent(QEvent::LanguageChange)); never executed: postEvent(w, new QEvent(QEvent::LanguageChange)); | 0 |
1092 | } | 0 |
1093 | } | 0 |
1094 | | - |
1095 | return QGuiApplication::event(e); executed: return QGuiApplication::event(e); Execution Count:2068 | 2068 |
1096 | } | - |
1097 | void QApplicationPrivate::notifyLayoutDirectionChange() | - |
1098 | { | - |
1099 | QWidgetList list = QApplication::topLevelWidgets(); | - |
1100 | for (int i = 0; i < list.size(); ++i) { evaluated: i < list.size() yes Evaluation Count:154 | yes Evaluation Count:11 |
| 11-154 |
1101 | QWidget *w = list.at(i); | - |
1102 | QEvent ev(QEvent::ApplicationLayoutDirectionChange); | - |
1103 | QCoreApplication::sendEvent(w, &ev); | - |
1104 | } executed: } Execution Count:154 | 154 |
1105 | } executed: } Execution Count:11 | 11 |
1106 | void QApplication::setActiveWindow(QWidget* act) | - |
1107 | { | - |
1108 | QWidget* window = act?act->window():0; evaluated: act yes Evaluation Count:1893 | yes Evaluation Count:1393 |
| 1393-1893 |
1109 | | - |
1110 | if (QApplicationPrivate::active_window == window) evaluated: QApplicationPrivate::active_window == window yes Evaluation Count:235 | yes Evaluation Count:3051 |
| 235-3051 |
1111 | return; executed: return; Execution Count:235 | 235 |
1112 | | - |
1113 | | - |
1114 | if (window && window->graphicsProxyWidget()) { evaluated: window yes Evaluation Count:1700 | yes Evaluation Count:1351 |
partially evaluated: window->graphicsProxyWidget() no Evaluation Count:0 | yes Evaluation Count:1700 |
| 0-1700 |
1115 | | - |
1116 | return; | 0 |
1117 | } | - |
1118 | | - |
1119 | | - |
1120 | QWidgetList toBeActivated; | - |
1121 | QWidgetList toBeDeactivated; | - |
1122 | | - |
1123 | if (QApplicationPrivate::active_window) { evaluated: QApplicationPrivate::active_window yes Evaluation Count:1699 | yes Evaluation Count:1352 |
| 1352-1699 |
1124 | if (style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window)) { partially evaluated: style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window) no Evaluation Count:0 | yes Evaluation Count:1699 |
| 0-1699 |
1125 | QWidgetList list = topLevelWidgets(); | - |
1126 | for (int i = 0; i < list.size(); ++i) { never evaluated: i < list.size() | 0 |
1127 | QWidget *w = list.at(i); | - |
1128 | if (w->isVisible() && w->isActiveWindow()) never evaluated: w->isVisible() never evaluated: w->isActiveWindow() | 0 |
1129 | toBeDeactivated.append(w); never executed: toBeDeactivated.append(w); | 0 |
1130 | } | 0 |
1131 | } else { | 0 |
1132 | toBeDeactivated.append(QApplicationPrivate::active_window); | - |
1133 | } executed: } Execution Count:1699 | 1699 |
1134 | } | - |
1135 | | - |
1136 | if (QApplicationPrivate::focus_widget) { evaluated: QApplicationPrivate::focus_widget yes Evaluation Count:433 | yes Evaluation Count:2618 |
| 433-2618 |
1137 | if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled)) evaluated: QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled) yes Evaluation Count:229 | yes Evaluation Count:204 |
| 204-229 |
1138 | (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); executed: (static_cast<QApplication *>(QCoreApplication::instance()))->inputMethod()->commit(); Execution Count:229 | 229 |
1139 | | - |
1140 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, Qt::ActiveWindowFocusReason); | - |
1141 | QApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange); | - |
1142 | } executed: } Execution Count:433 | 433 |
1143 | | - |
1144 | QApplicationPrivate::active_window = window; | - |
1145 | | - |
1146 | if (QApplicationPrivate::active_window) { evaluated: QApplicationPrivate::active_window yes Evaluation Count:1700 | yes Evaluation Count:1351 |
| 1351-1700 |
1147 | if (style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window)) { partially evaluated: style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window) no Evaluation Count:0 | yes Evaluation Count:1700 |
| 0-1700 |
1148 | QWidgetList list = topLevelWidgets(); | - |
1149 | for (int i = 0; i < list.size(); ++i) { never evaluated: i < list.size() | 0 |
1150 | QWidget *w = list.at(i); | - |
1151 | if (w->isVisible() && w->isActiveWindow()) never evaluated: w->isVisible() never evaluated: w->isActiveWindow() | 0 |
1152 | toBeActivated.append(w); never executed: toBeActivated.append(w); | 0 |
1153 | } | 0 |
1154 | } else { | 0 |
1155 | toBeActivated.append(QApplicationPrivate::active_window); | - |
1156 | } executed: } Execution Count:1700 | 1700 |
1157 | | - |
1158 | } | - |
1159 | | - |
1160 | | - |
1161 | QEvent activationChange(QEvent::ActivationChange); | - |
1162 | QEvent windowActivate(QEvent::WindowActivate); | - |
1163 | QEvent windowDeactivate(QEvent::WindowDeactivate); | - |
1164 | | - |
1165 | for (int i = 0; i < toBeActivated.size(); ++i) { evaluated: i < toBeActivated.size() yes Evaluation Count:1700 | yes Evaluation Count:3051 |
| 1700-3051 |
1166 | QWidget *w = toBeActivated.at(i); | - |
1167 | sendSpontaneousEvent(w, &windowActivate); | - |
1168 | sendSpontaneousEvent(w, &activationChange); | - |
1169 | } executed: } Execution Count:1700 | 1700 |
1170 | | - |
1171 | for(int i = 0; i < toBeDeactivated.size(); ++i) { evaluated: i < toBeDeactivated.size() yes Evaluation Count:1699 | yes Evaluation Count:3051 |
| 1699-3051 |
1172 | QWidget *w = toBeDeactivated.at(i); | - |
1173 | sendSpontaneousEvent(w, &windowDeactivate); | - |
1174 | sendSpontaneousEvent(w, &activationChange); | - |
1175 | } executed: } Execution Count:1699 | 1699 |
1176 | | - |
1177 | if (QApplicationPrivate::popupWidgets == 0) { evaluated: QApplicationPrivate::popupWidgets == 0 yes Evaluation Count:3039 | yes Evaluation Count:12 |
| 12-3039 |
1178 | | - |
1179 | if (!QApplicationPrivate::active_window && QApplicationPrivate::focus_widget) { evaluated: !QApplicationPrivate::active_window yes Evaluation Count:1339 | yes Evaluation Count:1700 |
evaluated: QApplicationPrivate::focus_widget yes Evaluation Count:196 | yes Evaluation Count:1143 |
| 196-1700 |
1180 | QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); | - |
1181 | } else if (QApplicationPrivate::active_window) { executed: } Execution Count:196 evaluated: QApplicationPrivate::active_window yes Evaluation Count:1700 | yes Evaluation Count:1143 |
| 196-1700 |
1182 | QWidget *w = QApplicationPrivate::active_window->focusWidget(); | - |
1183 | if (w && w->isVisible() ) evaluated: w yes Evaluation Count:266 | yes Evaluation Count:1434 |
evaluated: w->isVisible() yes Evaluation Count:262 | yes Evaluation Count:4 |
| 4-1434 |
1184 | w->setFocus(Qt::ActiveWindowFocusReason); executed: w->setFocus(Qt::ActiveWindowFocusReason); Execution Count:262 | 262 |
1185 | else { | - |
1186 | w = QApplicationPrivate::focusNextPrevChild_helper(QApplicationPrivate::active_window, true); | - |
1187 | if (w) { evaluated: w yes Evaluation Count:228 | yes Evaluation Count:1210 |
| 228-1210 |
1188 | w->setFocus(Qt::ActiveWindowFocusReason); | - |
1189 | } else { executed: } Execution Count:228 | 228 |
1190 | | - |
1191 | w = QApplicationPrivate::focus_widget; | - |
1192 | if (!w && QApplicationPrivate::active_window->focusPolicy() != Qt::NoFocus) evaluated: !w yes Evaluation Count:1062 | yes Evaluation Count:148 |
evaluated: QApplicationPrivate::active_window->focusPolicy() != Qt::NoFocus yes Evaluation Count:775 | yes Evaluation Count:287 |
| 148-1062 |
1193 | QApplicationPrivate::setFocusWidget(QApplicationPrivate::active_window, Qt::ActiveWindowFocusReason); executed: QApplicationPrivate::setFocusWidget(QApplicationPrivate::active_window, Qt::ActiveWindowFocusReason); Execution Count:775 | 775 |
1194 | else if (!QApplicationPrivate::active_window->isAncestorOf(w)) partially evaluated: !QApplicationPrivate::active_window->isAncestorOf(w) yes Evaluation Count:435 | no Evaluation Count:0 |
| 0-435 |
1195 | QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); executed: QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); Execution Count:435 | 435 |
1196 | } | - |
1197 | } | - |
1198 | } | - |
1199 | } | - |
1200 | } executed: } Execution Count:3051 | 3051 |
1201 | | - |
1202 | | - |
1203 | | - |
1204 | | - |
1205 | | - |
1206 | | - |
1207 | QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next) | - |
1208 | { | - |
1209 | uint focus_flag = qt_tab_all_widgets() ? Qt::TabFocus : Qt::StrongFocus; partially evaluated: qt_tab_all_widgets() yes Evaluation Count:1752 | no Evaluation Count:0 |
| 0-1752 |
1210 | | - |
1211 | QWidget *f = toplevel->focusWidget(); | - |
1212 | if (!f) evaluated: !f yes Evaluation Count:1438 | yes Evaluation Count:314 |
| 314-1438 |
1213 | f = toplevel; executed: f = toplevel; Execution Count:1438 | 1438 |
1214 | | - |
1215 | QWidget *w = f; | - |
1216 | QWidget *test = f->d_func()->focus_next; | - |
1217 | while (test && test != f) { partially evaluated: test yes Evaluation Count:12192 | no Evaluation Count:0 |
evaluated: test != f yes Evaluation Count:10707 | yes Evaluation Count:1485 |
| 0-12192 |
1218 | if ((test->focusPolicy() & focus_flag) == focus_flag evaluated: (test->focusPolicy() & focus_flag) == focus_flag yes Evaluation Count:2046 | yes Evaluation Count:8661 |
| 2046-8661 |
1219 | && !(test->d_func()->extra && test->d_func()->extra->focus_proxy) evaluated: test->d_func()->extra yes Evaluation Count:1080 | yes Evaluation Count:966 |
evaluated: test->d_func()->extra->focus_proxy yes Evaluation Count:653 | yes Evaluation Count:427 |
| 427-1080 |
1220 | && test->isVisibleTo(toplevel) && test->isEnabled() evaluated: test->isVisibleTo(toplevel) yes Evaluation Count:677 | yes Evaluation Count:716 |
evaluated: test->isEnabled() yes Evaluation Count:674 | yes Evaluation Count:3 |
| 3-716 |
1221 | && !(w->windowType() == Qt::SubWindow && !w->isAncestorOf(test)) evaluated: w->windowType() == Qt::SubWindow yes Evaluation Count:184 | yes Evaluation Count:490 |
evaluated: !w->isAncestorOf(test) yes Evaluation Count:177 | yes Evaluation Count:7 |
| 7-490 |
1222 | && (toplevel->windowType() != Qt::SubWindow || toplevel->isAncestorOf(test))) { evaluated: toplevel->windowType() != Qt::SubWindow yes Evaluation Count:266 | yes Evaluation Count:231 |
evaluated: toplevel->isAncestorOf(test) yes Evaluation Count:17 | yes Evaluation Count:214 |
| 17-266 |
1223 | w = test; | - |
1224 | if (next) evaluated: next yes Evaluation Count:267 | yes Evaluation Count:16 |
| 16-267 |
1225 | break; executed: break; Execution Count:267 | 267 |
1226 | } executed: } Execution Count:16 | 16 |
1227 | test = test->d_func()->focus_next; | - |
1228 | } executed: } Execution Count:10440 | 10440 |
1229 | if (w == f) { evaluated: w == f yes Evaluation Count:1473 | yes Evaluation Count:279 |
| 279-1473 |
1230 | if (qt_in_tab_key_event) { evaluated: qt_in_tab_key_event yes Evaluation Count:13 | yes Evaluation Count:1460 |
| 13-1460 |
1231 | w->window()->setAttribute(Qt::WA_KeyboardFocusChange); | - |
1232 | w->update(); | - |
1233 | } executed: } Execution Count:13 | 13 |
1234 | return 0; executed: return 0; Execution Count:1473 | 1473 |
1235 | } | - |
1236 | return w; executed: return w; Execution Count:279 | 279 |
1237 | } | - |
1238 | void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, const QPointF &globalPosF) | - |
1239 | { | - |
1240 | const QPoint globalPos = globalPosF.toPoint(); | - |
1241 | QWidget* w ; | - |
1242 | if ((!enter && !leave) || (enter == leave)) evaluated: !enter yes Evaluation Count:518 | yes Evaluation Count:1834 |
partially evaluated: !leave no Evaluation Count:0 | yes Evaluation Count:518 |
evaluated: (enter == leave) yes Evaluation Count:181 | yes Evaluation Count:2171 |
| 0-2171 |
1243 | return; executed: return; Execution Count:181 | 181 |
1244 | | - |
1245 | | - |
1246 | | - |
1247 | QWidgetList leaveList; | - |
1248 | QWidgetList enterList; | - |
1249 | | - |
1250 | bool sameWindow = leave && enter && leave->window() == enter->window(); evaluated: leave yes Evaluation Count:737 | yes Evaluation Count:1434 |
evaluated: enter yes Evaluation Count:219 | yes Evaluation Count:518 |
partially evaluated: leave->window() == enter->window() yes Evaluation Count:219 | no Evaluation Count:0 |
| 0-1434 |
1251 | if (leave && !sameWindow) { evaluated: leave yes Evaluation Count:737 | yes Evaluation Count:1434 |
evaluated: !sameWindow yes Evaluation Count:518 | yes Evaluation Count:219 |
| 219-1434 |
1252 | w = leave; | - |
1253 | do { | - |
1254 | leaveList.append(w); | - |
1255 | } while (!w->isWindow() && (w = w->parentWidget())); executed: } Execution Count:650 evaluated: !w->isWindow() yes Evaluation Count:132 | yes Evaluation Count:518 |
partially evaluated: (w = w->parentWidget()) yes Evaluation Count:132 | no Evaluation Count:0 |
| 0-650 |
1256 | } executed: } Execution Count:518 | 518 |
1257 | if (enter && !sameWindow) { evaluated: enter yes Evaluation Count:1653 | yes Evaluation Count:518 |
evaluated: !sameWindow yes Evaluation Count:1434 | yes Evaluation Count:219 |
| 219-1653 |
1258 | w = enter; | - |
1259 | do { | - |
1260 | enterList.prepend(w); | - |
1261 | } while (!w->isWindow() && (w = w->parentWidget())); executed: } Execution Count:2652 evaluated: !w->isWindow() yes Evaluation Count:1218 | yes Evaluation Count:1434 |
partially evaluated: (w = w->parentWidget()) yes Evaluation Count:1218 | no Evaluation Count:0 |
| 0-2652 |
1262 | } executed: } Execution Count:1434 | 1434 |
1263 | if (sameWindow) { evaluated: sameWindow yes Evaluation Count:219 | yes Evaluation Count:1952 |
| 219-1952 |
1264 | int enterDepth = 0; | - |
1265 | int leaveDepth = 0; | - |
1266 | w = enter; | - |
1267 | while (!w->isWindow() && (w = w->parentWidget())) evaluated: !w->isWindow() yes Evaluation Count:330 | yes Evaluation Count:219 |
partially evaluated: (w = w->parentWidget()) yes Evaluation Count:330 | no Evaluation Count:0 |
| 0-330 |
1268 | enterDepth++; executed: enterDepth++; Execution Count:330 | 330 |
1269 | w = leave; | - |
1270 | while (!w->isWindow() && (w = w->parentWidget())) evaluated: !w->isWindow() yes Evaluation Count:451 | yes Evaluation Count:219 |
partially evaluated: (w = w->parentWidget()) yes Evaluation Count:451 | no Evaluation Count:0 |
| 0-451 |
1271 | leaveDepth++; executed: leaveDepth++; Execution Count:451 | 451 |
1272 | QWidget* wenter = enter; | - |
1273 | QWidget* wleave = leave; | - |
1274 | while (enterDepth > leaveDepth) { evaluated: enterDepth > leaveDepth yes Evaluation Count:130 | yes Evaluation Count:219 |
| 130-219 |
1275 | wenter = wenter->parentWidget(); | - |
1276 | enterDepth--; | - |
1277 | } executed: } Execution Count:130 | 130 |
1278 | while (leaveDepth > enterDepth) { evaluated: leaveDepth > enterDepth yes Evaluation Count:251 | yes Evaluation Count:219 |
| 219-251 |
1279 | wleave = wleave->parentWidget(); | - |
1280 | leaveDepth--; | - |
1281 | } executed: } Execution Count:251 | 251 |
1282 | while (!wenter->isWindow() && wenter != wleave) { evaluated: !wenter->isWindow() yes Evaluation Count:136 | yes Evaluation Count:148 |
evaluated: wenter != wleave yes Evaluation Count:65 | yes Evaluation Count:71 |
| 65-148 |
1283 | wenter = wenter->parentWidget(); | - |
1284 | wleave = wleave->parentWidget(); | - |
1285 | } executed: } Execution Count:65 | 65 |
1286 | | - |
1287 | w = leave; | - |
1288 | while (w != wleave) { evaluated: w != wleave yes Evaluation Count:316 | yes Evaluation Count:219 |
| 219-316 |
1289 | leaveList.append(w); | - |
1290 | w = w->parentWidget(); | - |
1291 | } executed: } Execution Count:316 | 316 |
1292 | w = enter; | - |
1293 | while (w != wenter) { evaluated: w != wenter yes Evaluation Count:195 | yes Evaluation Count:219 |
| 195-219 |
1294 | enterList.prepend(w); | - |
1295 | w = w->parentWidget(); | - |
1296 | } executed: } Execution Count:195 | 195 |
1297 | } executed: } Execution Count:219 | 219 |
1298 | | - |
1299 | QEvent leaveEvent(QEvent::Leave); | - |
1300 | for (int i = 0; i < leaveList.size(); ++i) { evaluated: i < leaveList.size() yes Evaluation Count:966 | yes Evaluation Count:2171 |
| 966-2171 |
1301 | w = leaveList.at(i); | - |
1302 | if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { evaluated: !QApplication::activeModalWidget() yes Evaluation Count:939 | yes Evaluation Count:27 |
evaluated: QApplicationPrivate::tryModalHelper(w, 0) yes Evaluation Count:25 | yes Evaluation Count:2 |
| 2-939 |
1303 | QApplication::sendEvent(w, &leaveEvent); | - |
1304 | if (w->testAttribute(Qt::WA_Hover) && evaluated: w->testAttribute(Qt::WA_Hover) yes Evaluation Count:6 | yes Evaluation Count:958 |
| 6-958 |
1305 | (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { partially evaluated: !QApplication::activePopupWidget() yes Evaluation Count:6 | no Evaluation Count:0 |
never evaluated: QApplication::activePopupWidget() == w->window() | 0-6 |
1306 | qt_noop(); | - |
1307 | QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos), | - |
1308 | QApplication::keyboardModifiers()); | - |
1309 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->notify_helper(w, &he); | - |
1310 | } executed: } Execution Count:6 | 6 |
1311 | } executed: } Execution Count:964 | 964 |
1312 | } executed: } Execution Count:966 | 966 |
1313 | if (!enterList.isEmpty()) { evaluated: !enterList.isEmpty() yes Evaluation Count:1530 | yes Evaluation Count:641 |
| 641-1530 |
1314 | const QPoint windowPos = enterList.front()->window()->mapFromGlobal(globalPos); | - |
1315 | for (int i = 0; i < enterList.size(); ++i) { evaluated: i < enterList.size() yes Evaluation Count:2847 | yes Evaluation Count:1530 |
| 1530-2847 |
1316 | w = enterList.at(i); | - |
1317 | if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) { evaluated: !QApplication::activeModalWidget() yes Evaluation Count:2758 | yes Evaluation Count:89 |
partially evaluated: QApplicationPrivate::tryModalHelper(w, 0) yes Evaluation Count:89 | no Evaluation Count:0 |
| 0-2758 |
1318 | const QPointF localPos = w->mapFromGlobal(globalPos); | - |
1319 | QEnterEvent enterEvent(localPos, windowPos, globalPosF); | - |
1320 | QApplication::sendEvent(w, &enterEvent); | - |
1321 | if (w->testAttribute(Qt::WA_Hover) && evaluated: w->testAttribute(Qt::WA_Hover) yes Evaluation Count:26 | yes Evaluation Count:2821 |
| 26-2821 |
1322 | (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { evaluated: !QApplication::activePopupWidget() yes Evaluation Count:25 | yes Evaluation Count:1 |
partially evaluated: QApplication::activePopupWidget() == w->window() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-25 |
1323 | QHoverEvent he(QEvent::HoverEnter, localPos, QPoint(-1, -1), | - |
1324 | QApplication::keyboardModifiers()); | - |
1325 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->notify_helper(w, &he); | - |
1326 | } executed: } Execution Count:25 | 25 |
1327 | } executed: } Execution Count:2847 | 2847 |
1328 | } executed: } Execution Count:2847 | 2847 |
1329 | } executed: } Execution Count:1530 | 1530 |
1330 | | - |
1331 | | - |
1332 | | - |
1333 | | - |
1334 | const bool enterOnAlien = (enter && (isAlien(enter) || enter->testAttribute(Qt::WA_DontShowOnScreen))); evaluated: enter yes Evaluation Count:1653 | yes Evaluation Count:518 |
evaluated: isAlien(enter) yes Evaluation Count:1042 | yes Evaluation Count:611 |
partially evaluated: enter->testAttribute(Qt::WA_DontShowOnScreen) no Evaluation Count:0 | yes Evaluation Count:611 |
| 0-1653 |
1335 | | - |
1336 | | - |
1337 | QWidget *parentOfLeavingCursor = 0; | - |
1338 | for (int i = 0; i < leaveList.size(); ++i) { evaluated: i < leaveList.size() yes Evaluation Count:966 | yes Evaluation Count:1653 |
| 966-1653 |
1339 | w = leaveList.at(i); | - |
1340 | if (!isAlien(w)) evaluated: !isAlien(w) yes Evaluation Count:518 | yes Evaluation Count:448 |
| 448-518 |
1341 | break; executed: break; Execution Count:518 | 518 |
1342 | if (w->testAttribute(Qt::WA_SetCursor)) { evaluated: w->testAttribute(Qt::WA_SetCursor) yes Evaluation Count:48 | yes Evaluation Count:400 |
| 48-400 |
1343 | QWidget *parent = w->parentWidget(); | - |
1344 | while (parent && parent->d_func()->data.in_destructor) partially evaluated: parent yes Evaluation Count:50 | no Evaluation Count:0 |
evaluated: parent->d_func()->data.in_destructor yes Evaluation Count:2 | yes Evaluation Count:48 |
| 0-50 |
1345 | parent = parent->parentWidget(); executed: parent = parent->parentWidget(); Execution Count:2 | 2 |
1346 | parentOfLeavingCursor = parent; | - |
1347 | | - |
1348 | | - |
1349 | } executed: } Execution Count:48 | 48 |
1350 | } executed: } Execution Count:448 | 448 |
1351 | | - |
1352 | if (parentOfLeavingCursor && (!enterOnAlien evaluated: parentOfLeavingCursor yes Evaluation Count:48 | yes Evaluation Count:2123 |
evaluated: !enterOnAlien yes Evaluation Count:5 | yes Evaluation Count:43 |
| 5-2123 |
1353 | || parentOfLeavingCursor->effectiveWinId() != enter->effectiveWinId())) { partially evaluated: parentOfLeavingCursor->effectiveWinId() != enter->effectiveWinId() no Evaluation Count:0 | yes Evaluation Count:43 |
| 0-43 |
1354 | | - |
1355 | if (!parentOfLeavingCursor->window()->graphicsProxyWidget()) partially evaluated: !parentOfLeavingCursor->window()->graphicsProxyWidget() yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
1356 | | - |
1357 | { | - |
1358 | if (enter == QApplication::desktop()) { partially evaluated: enter == QApplication::desktop() no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
1359 | qt_qpa_set_cursor(enter, true); | - |
1360 | } else { | 0 |
1361 | qt_qpa_set_cursor(parentOfLeavingCursor, true); | - |
1362 | } executed: } Execution Count:5 | 5 |
1363 | } | - |
1364 | } executed: } Execution Count:5 | 5 |
1365 | if (enterOnAlien) { evaluated: enterOnAlien yes Evaluation Count:1042 | yes Evaluation Count:1129 |
| 1042-1129 |
1366 | QWidget *cursorWidget = enter; | - |
1367 | while (!cursorWidget->isWindow() && !cursorWidget->isEnabled()) partially evaluated: !cursorWidget->isWindow() yes Evaluation Count:1042 | no Evaluation Count:0 |
partially evaluated: !cursorWidget->isEnabled() no Evaluation Count:0 | yes Evaluation Count:1042 |
| 0-1042 |
1368 | cursorWidget = cursorWidget->parentWidget(); never executed: cursorWidget = cursorWidget->parentWidget(); | 0 |
1369 | | - |
1370 | if (!cursorWidget) partially evaluated: !cursorWidget no Evaluation Count:0 | yes Evaluation Count:1042 |
| 0-1042 |
1371 | return; | 0 |
1372 | | - |
1373 | | - |
1374 | if (cursorWidget->window()->graphicsProxyWidget()) { partially evaluated: cursorWidget->window()->graphicsProxyWidget() no Evaluation Count:0 | yes Evaluation Count:1042 |
| 0-1042 |
1375 | QWidgetPrivate::nearestGraphicsProxyWidget(cursorWidget)->setCursor(cursorWidget->cursor()); | - |
1376 | } else | 0 |
1377 | | - |
1378 | { | - |
1379 | qt_qpa_set_cursor(cursorWidget, true); | - |
1380 | } executed: } Execution Count:1042 | 1042 |
1381 | } | - |
1382 | | - |
1383 | } executed: } Execution Count:2171 | 2171 |
1384 | | - |
1385 | | - |
1386 | __attribute__((visibility("default"))) bool qt_tryModalHelper(QWidget *widget, QWidget **rettop) | - |
1387 | { | - |
1388 | return QApplicationPrivate::tryModalHelper(widget, rettop); never executed: return QApplicationPrivate::tryModalHelper(widget, rettop); | 0 |
1389 | } | - |
1390 | | - |
1391 | | - |
1392 | | - |
1393 | | - |
1394 | bool QApplicationPrivate::isBlockedByModal(QWidget *widget) | - |
1395 | { | - |
1396 | widget = widget->window(); | - |
1397 | QWindow *window = widget->windowHandle(); | - |
1398 | return window && self->isWindowBlocked(window); executed: return window && self->isWindowBlocked(window); Execution Count:153 | 153 |
1399 | } | - |
1400 | | - |
1401 | bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const | - |
1402 | { | - |
1403 | QWindow *unused = 0; | - |
1404 | if (!window) { partially evaluated: !window no Evaluation Count:0 | yes Evaluation Count:633 |
| 0-633 |
1405 | QMessageLogger("kernel/qapplication.cpp", 2232, __PRETTY_FUNCTION__).warning().nospace() << "window == 0 passed."; | - |
1406 | return false; never executed: return false; | 0 |
1407 | } | - |
1408 | if (!blockingWindow) partially evaluated: !blockingWindow yes Evaluation Count:633 | no Evaluation Count:0 |
| 0-633 |
1409 | blockingWindow = &unused; executed: blockingWindow = &unused; Execution Count:633 | 633 |
1410 | | - |
1411 | if (modalWindowList.isEmpty()) { evaluated: modalWindowList.isEmpty() yes Evaluation Count:34 | yes Evaluation Count:599 |
| 34-599 |
1412 | *blockingWindow = 0; | - |
1413 | return false; executed: return false; Execution Count:34 | 34 |
1414 | } | - |
1415 | QWidget *popupWidget = QApplication::activePopupWidget(); | - |
1416 | QWindow *popupWindow = popupWidget ? popupWidget->windowHandle() : 0; partially evaluated: popupWidget no Evaluation Count:0 | yes Evaluation Count:599 |
| 0-599 |
1417 | if (popupWindow == window) { partially evaluated: popupWindow == window no Evaluation Count:0 | yes Evaluation Count:599 |
| 0-599 |
1418 | *blockingWindow = 0; | - |
1419 | return false; never executed: return false; | 0 |
1420 | } | - |
1421 | | - |
1422 | for (int i = 0; i < modalWindowList.count(); ++i) { evaluated: i < modalWindowList.count() yes Evaluation Count:599 | yes Evaluation Count:4 |
| 4-599 |
1423 | QWindow *modalWindow = modalWindowList.at(i); | - |
1424 | | - |
1425 | { | - |
1426 | | - |
1427 | QWindow *w = window; | - |
1428 | while (w) { evaluated: w yes Evaluation Count:599 | yes Evaluation Count:270 |
| 270-599 |
1429 | if (w == modalWindow) { evaluated: w == modalWindow yes Evaluation Count:329 | yes Evaluation Count:270 |
| 270-329 |
1430 | *blockingWindow = 0; | - |
1431 | return false; executed: return false; Execution Count:329 | 329 |
1432 | } | - |
1433 | QWindow *p = w->parent(); | - |
1434 | if (!p) partially evaluated: !p yes Evaluation Count:270 | no Evaluation Count:0 |
| 0-270 |
1435 | p = w->transientParent(); executed: p = w->transientParent(); Execution Count:270 | 270 |
1436 | w = p; | - |
1437 | } executed: } Execution Count:270 | 270 |
1438 | | - |
1439 | | - |
1440 | | - |
1441 | const QPlatformWindow *platWin = window->handle(); | - |
1442 | const QPlatformWindow *modalPlatWin = modalWindow->handle(); | - |
1443 | if (platWin && modalPlatWin && platWin->isEmbedded(modalPlatWin)) evaluated: platWin yes Evaluation Count:164 | yes Evaluation Count:106 |
partially evaluated: modalPlatWin yes Evaluation Count:164 | no Evaluation Count:0 |
partially evaluated: platWin->isEmbedded(modalPlatWin) no Evaluation Count:0 | yes Evaluation Count:164 |
| 0-164 |
1444 | return false; never executed: return false; | 0 |
1445 | } | - |
1446 | | - |
1447 | Qt::WindowModality windowModality = modalWindow->modality(); | - |
1448 | QWidgetWindow *modalWidgetWindow = qobject_cast<QWidgetWindow *>(modalWindow); | - |
1449 | if (windowModality == Qt::NonModal) { partially evaluated: windowModality == Qt::NonModal no Evaluation Count:0 | yes Evaluation Count:270 |
| 0-270 |
1450 | | - |
1451 | | - |
1452 | | - |
1453 | | - |
1454 | QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : 0; never evaluated: modalWidgetWindow | 0 |
1455 | while (m && !m->testAttribute(Qt::WA_GroupLeader)) { never evaluated: !m->testAttribute(Qt::WA_GroupLeader) | 0 |
1456 | m = m->parentWidget(); | - |
1457 | if (m) | 0 |
1458 | m = m->window(); never executed: m = m->window(); | 0 |
1459 | } | 0 |
1460 | windowModality = (m && m->testAttribute(Qt::WA_GroupLeader)) never evaluated: m->testAttribute(Qt::WA_GroupLeader) | 0 |
1461 | ? Qt::WindowModal | - |
1462 | : Qt::ApplicationModal; | - |
1463 | } | 0 |
1464 | | - |
1465 | switch (windowModality) { | - |
1466 | case Qt::ApplicationModal: | - |
1467 | { | - |
1468 | QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(window); | - |
1469 | QWidget *groupLeaderForWidget = widgetWindow ? widgetWindow->widget() : 0; partially evaluated: widgetWindow yes Evaluation Count:266 | no Evaluation Count:0 |
| 0-266 |
1470 | while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader)) evaluated: groupLeaderForWidget yes Evaluation Count:275 | yes Evaluation Count:266 |
partially evaluated: !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader) yes Evaluation Count:275 | no Evaluation Count:0 |
| 0-275 |
1471 | groupLeaderForWidget = groupLeaderForWidget->parentWidget(); executed: groupLeaderForWidget = groupLeaderForWidget->parentWidget(); Execution Count:275 | 275 |
1472 | | - |
1473 | if (groupLeaderForWidget) { partially evaluated: groupLeaderForWidget no Evaluation Count:0 | yes Evaluation Count:266 |
| 0-266 |
1474 | | - |
1475 | QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : 0; never evaluated: modalWidgetWindow | 0 |
1476 | while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader)) never evaluated: m != groupLeaderForWidget never evaluated: !m->testAttribute(Qt::WA_GroupLeader) | 0 |
1477 | m = m->parentWidget(); never executed: m = m->parentWidget(); | 0 |
1478 | if (m == groupLeaderForWidget) { never evaluated: m == groupLeaderForWidget | 0 |
1479 | *blockingWindow = m->windowHandle(); | - |
1480 | return true; never executed: return true; | 0 |
1481 | } | - |
1482 | } else if (modalWindow != window) { partially evaluated: modalWindow != window yes Evaluation Count:266 | no Evaluation Count:0 |
| 0-266 |
1483 | *blockingWindow = modalWindow; | - |
1484 | return true; executed: return true; Execution Count:266 | 266 |
1485 | } | - |
1486 | break; | 0 |
1487 | } | - |
1488 | case Qt::WindowModal: | - |
1489 | { | - |
1490 | QWindow *w = window; | - |
1491 | do { | - |
1492 | QWindow *m = modalWindow; | - |
1493 | do { | - |
1494 | if (m == w) { partially evaluated: m == w no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1495 | *blockingWindow = m; | - |
1496 | return true; never executed: return true; | 0 |
1497 | } | - |
1498 | QWindow *p = m->parent(); | - |
1499 | if (!p) partially evaluated: !p yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
1500 | p = m->transientParent(); executed: p = m->transientParent(); Execution Count:4 | 4 |
1501 | m = p; | - |
1502 | } while (m); executed: } Execution Count:4 partially evaluated: m no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1503 | QWindow *p = w->parent(); | - |
1504 | if (!p) partially evaluated: !p yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
1505 | p = w->transientParent(); executed: p = w->transientParent(); Execution Count:4 | 4 |
1506 | w = p; | - |
1507 | } while (w); executed: } Execution Count:4 partially evaluated: w no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1508 | break; executed: break; Execution Count:4 | 4 |
1509 | } | - |
1510 | default: | - |
1511 | qt_noop(); | - |
1512 | break; | 0 |
1513 | } | - |
1514 | } executed: } Execution Count:4 | 4 |
1515 | *blockingWindow = 0; | - |
1516 | return false; executed: return false; Execution Count:4 | 4 |
1517 | } | - |
1518 | | - |
1519 | | - |
1520 | | - |
1521 | | - |
1522 | | - |
1523 | | - |
1524 | bool QApplicationPrivate::tryModalHelper(QWidget *widget, QWidget **rettop) | - |
1525 | { | - |
1526 | QWidget *top = QApplication::activeModalWidget(); | - |
1527 | if (rettop) evaluated: rettop yes Evaluation Count:3 | yes Evaluation Count:146 |
| 3-146 |
1528 | *rettop = top; executed: *rettop = top; Execution Count:3 | 3 |
1529 | | - |
1530 | | - |
1531 | if (QApplication::activePopupWidget()) partially evaluated: QApplication::activePopupWidget() no Evaluation Count:0 | yes Evaluation Count:149 |
| 0-149 |
1532 | return true; never executed: return true; | 0 |
1533 | | - |
1534 | return !isBlockedByModal(widget->window()); executed: return !isBlockedByModal(widget->window()); Execution Count:149 | 149 |
1535 | } | - |
1536 | | - |
1537 | | - |
1538 | | - |
1539 | | - |
1540 | QWidget *QApplicationPrivate::pickMouseReceiver(QWidget *candidate, const QPoint &windowPos, | - |
1541 | QPoint *pos, QEvent::Type type, | - |
1542 | Qt::MouseButtons buttons, QWidget *buttonDown, | - |
1543 | QWidget *alienWidget) | - |
1544 | { | - |
1545 | qt_noop(); | - |
1546 | | - |
1547 | QWidget *mouseGrabber = QWidget::mouseGrabber(); | - |
1548 | if (((type == QEvent::MouseMove && buttons) || (type == QEvent::MouseButtonRelease)) evaluated: type == QEvent::MouseMove yes Evaluation Count:407 | yes Evaluation Count:14 |
partially evaluated: buttons no Evaluation Count:0 | yes Evaluation Count:407 |
evaluated: (type == QEvent::MouseButtonRelease) yes Evaluation Count:7 | yes Evaluation Count:414 |
| 0-414 |
1549 | && !buttonDown && !mouseGrabber) { partially evaluated: !buttonDown no Evaluation Count:0 | yes Evaluation Count:7 |
never evaluated: !mouseGrabber | 0-7 |
1550 | return 0; never executed: return 0; | 0 |
1551 | } | - |
1552 | | - |
1553 | if (alienWidget && alienWidget->internalWinId()) partially evaluated: alienWidget yes Evaluation Count:421 | no Evaluation Count:0 |
evaluated: alienWidget->internalWinId() yes Evaluation Count:8 | yes Evaluation Count:413 |
| 0-421 |
1554 | alienWidget = 0; executed: alienWidget = 0; Execution Count:8 | 8 |
1555 | | - |
1556 | QWidget *receiver = candidate; | - |
1557 | | - |
1558 | if (!mouseGrabber) evaluated: !mouseGrabber yes Evaluation Count:406 | yes Evaluation Count:15 |
| 15-406 |
1559 | mouseGrabber = (buttonDown && !isBlockedByModal(buttonDown)) ? buttonDown : alienWidget; evaluated: buttonDown yes Evaluation Count:4 | yes Evaluation Count:402 |
partially evaluated: !isBlockedByModal(buttonDown) yes Evaluation Count:4 | no Evaluation Count:0 |
executed: mouseGrabber = (buttonDown && !isBlockedByModal(buttonDown)) ? buttonDown : alienWidget; Execution Count:406 | 0-406 |
1560 | | - |
1561 | if (mouseGrabber && mouseGrabber != candidate) { evaluated: mouseGrabber yes Evaluation Count:419 | yes Evaluation Count:2 |
partially evaluated: mouseGrabber != candidate yes Evaluation Count:419 | no Evaluation Count:0 |
| 0-419 |
1562 | receiver = mouseGrabber; | - |
1563 | *pos = receiver->mapFromGlobal(candidate->mapToGlobal(windowPos)); | - |
1564 | | - |
1565 | | - |
1566 | | - |
1567 | } executed: } Execution Count:419 | 419 |
1568 | | - |
1569 | return receiver; executed: return receiver; Execution Count:421 | 421 |
1570 | | - |
1571 | } | - |
1572 | | - |
1573 | | - |
1574 | | - |
1575 | | - |
1576 | bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event, | - |
1577 | QWidget *alienWidget, QWidget *nativeWidget, | - |
1578 | QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver, | - |
1579 | bool spontaneous) | - |
1580 | { | - |
1581 | qt_noop(); | - |
1582 | qt_noop(); | - |
1583 | qt_noop(); | - |
1584 | qt_noop(); | - |
1585 | | - |
1586 | if (alienWidget && !isAlien(alienWidget)) evaluated: alienWidget yes Evaluation Count:678 | yes Evaluation Count:13 |
evaluated: !isAlien(alienWidget) yes Evaluation Count:104 | yes Evaluation Count:574 |
| 13-678 |
1587 | alienWidget = 0; executed: alienWidget = 0; Execution Count:104 | 104 |
1588 | | - |
1589 | QPointer<QWidget> receiverGuard = receiver; | - |
1590 | QPointer<QWidget> nativeGuard = nativeWidget; | - |
1591 | QPointer<QWidget> alienGuard = alienWidget; | - |
1592 | QPointer<QWidget> activePopupWidget = QApplication::activePopupWidget(); | - |
1593 | | - |
1594 | const bool graphicsWidget = nativeWidget->testAttribute(Qt::WA_DontShowOnScreen); | - |
1595 | | - |
1596 | bool widgetUnderMouse = QRectF(receiver->rect()).contains(event->localPos()); | - |
1597 | | - |
1598 | | - |
1599 | | - |
1600 | | - |
1601 | if (leaveAfterRelease && !*buttonDown && !event->buttons()) evaluated: leaveAfterRelease yes Evaluation Count:3 | yes Evaluation Count:688 |
evaluated: !*buttonDown yes Evaluation Count:1 | yes Evaluation Count:2 |
partially evaluated: !event->buttons() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-688 |
1602 | leaveAfterRelease = 0; executed: leaveAfterRelease = 0; Execution Count:1 | 1 |
1603 | | - |
1604 | if (*buttonDown) { evaluated: *buttonDown yes Evaluation Count:14 | yes Evaluation Count:677 |
| 14-677 |
1605 | if (!graphicsWidget) { partially evaluated: !graphicsWidget yes Evaluation Count:14 | no Evaluation Count:0 |
| 0-14 |
1606 | | - |
1607 | | - |
1608 | if ((alienWidget || !receiver->internalWinId()) && !leaveAfterRelease && !QWidget::mouseGrabber()) evaluated: alienWidget yes Evaluation Count:10 | yes Evaluation Count:4 |
partially evaluated: !receiver->internalWinId() yes Evaluation Count:4 | no Evaluation Count:0 |
evaluated: !leaveAfterRelease yes Evaluation Count:12 | yes Evaluation Count:2 |
evaluated: !QWidget::mouseGrabber() yes Evaluation Count:2 | yes Evaluation Count:10 |
| 0-12 |
1609 | leaveAfterRelease = *buttonDown; executed: leaveAfterRelease = *buttonDown; Execution Count:2 | 2 |
1610 | if (event->type() == QEvent::MouseButtonRelease && !event->buttons()) evaluated: event->type() == QEvent::MouseButtonRelease yes Evaluation Count:7 | yes Evaluation Count:7 |
partially evaluated: !event->buttons() yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
1611 | *buttonDown = 0; executed: *buttonDown = 0; Execution Count:7 | 7 |
1612 | } executed: } Execution Count:14 | 14 |
1613 | } else if (lastMouseReceiver && widgetUnderMouse) { evaluated: lastMouseReceiver yes Evaluation Count:671 | yes Evaluation Count:6 |
evaluated: widgetUnderMouse yes Evaluation Count:661 | yes Evaluation Count:10 |
executed: } Execution Count:14 | 6-671 |
1614 | | - |
1615 | | - |
1616 | | - |
1617 | | - |
1618 | if ((alienWidget && alienWidget != lastMouseReceiver) evaluated: alienWidget yes Evaluation Count:562 | yes Evaluation Count:99 |
evaluated: alienWidget != lastMouseReceiver yes Evaluation Count:119 | yes Evaluation Count:443 |
| 99-562 |
1619 | || (isAlien(lastMouseReceiver) && !alienWidget)) { evaluated: isAlien(lastMouseReceiver) yes Evaluation Count:539 | yes Evaluation Count:3 |
evaluated: !alienWidget yes Evaluation Count:96 | yes Evaluation Count:443 |
| 3-539 |
1620 | if (activePopupWidget) { partially evaluated: activePopupWidget no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
1621 | if (!QWidget::mouseGrabber()) never evaluated: !QWidget::mouseGrabber() | 0 |
1622 | dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver, event->screenPos()); never executed: dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver, event->screenPos()); | 0 |
1623 | } else { | 0 |
1624 | dispatchEnterLeave(receiver, lastMouseReceiver, event->screenPos()); | - |
1625 | } executed: } Execution Count:215 | 215 |
1626 | | - |
1627 | } | - |
1628 | } executed: } Execution Count:661 | 661 |
1629 | const bool wasLeaveAfterRelease = leaveAfterRelease != 0; | - |
1630 | bool result; | - |
1631 | if (spontaneous) partially evaluated: spontaneous yes Evaluation Count:691 | no Evaluation Count:0 |
| 0-691 |
1632 | result = QApplication::sendSpontaneousEvent(receiver, event); executed: result = QApplication::sendSpontaneousEvent(receiver, event); Execution Count:691 | 691 |
1633 | else | - |
1634 | result = QApplication::sendEvent(receiver, event); never executed: result = QApplication::sendEvent(receiver, event); | 0 |
1635 | | - |
1636 | if (!graphicsWidget && leaveAfterRelease && event->type() == QEvent::MouseButtonRelease partially evaluated: !graphicsWidget yes Evaluation Count:691 | no Evaluation Count:0 |
evaluated: leaveAfterRelease yes Evaluation Count:3 | yes Evaluation Count:688 |
evaluated: event->type() == QEvent::MouseButtonRelease yes Evaluation Count:1 | yes Evaluation Count:2 |
| 0-691 |
1637 | && !event->buttons() && QWidget::mouseGrabber() != leaveAfterRelease) { partially evaluated: !event->buttons() yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: QWidget::mouseGrabber() != leaveAfterRelease yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1638 | | - |
1639 | | - |
1640 | | - |
1641 | QWidget *enter = 0; | - |
1642 | if (nativeGuard) partially evaluated: nativeGuard yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1643 | enter = alienGuard ? alienWidget : nativeWidget; partially evaluated: alienGuard yes Evaluation Count:1 | no Evaluation Count:0 |
executed: enter = alienGuard ? alienWidget : nativeWidget; Execution Count:1 | 0-1 |
1644 | else | - |
1645 | enter = QApplication::widgetAt(event->globalPos()); never executed: enter = QApplication::widgetAt(event->globalPos()); | 0 |
1646 | dispatchEnterLeave(enter, leaveAfterRelease, event->screenPos()); | - |
1647 | leaveAfterRelease = 0; | - |
1648 | lastMouseReceiver = enter; | - |
1649 | } else if (!wasLeaveAfterRelease) { executed: } Execution Count:1 evaluated: !wasLeaveAfterRelease yes Evaluation Count:687 | yes Evaluation Count:3 |
| 1-687 |
1650 | if (activePopupWidget) { evaluated: activePopupWidget yes Evaluation Count:22 | yes Evaluation Count:665 |
| 22-665 |
1651 | if (!QWidget::mouseGrabber()) partially evaluated: !QWidget::mouseGrabber() yes Evaluation Count:22 | no Evaluation Count:0 |
| 0-22 |
1652 | lastMouseReceiver = alienGuard ? alienWidget : (nativeGuard ? nativeWidget : 0); evaluated: alienGuard yes Evaluation Count:9 | yes Evaluation Count:13 |
executed: lastMouseReceiver = alienGuard ? alienWidget : (nativeGuard ? nativeWidget : 0); Execution Count:22 | 9-22 |
1653 | } else { executed: } Execution Count:22 | 22 |
1654 | lastMouseReceiver = receiverGuard ? receiver : QApplication::widgetAt(event->globalPos()); partially evaluated: receiverGuard yes Evaluation Count:665 | no Evaluation Count:0 |
| 0-665 |
1655 | } executed: } Execution Count:665 | 665 |
1656 | } | - |
1657 | | - |
1658 | return result; executed: return result; Execution Count:691 | 691 |
1659 | } | - |
1660 | | - |
1661 | | - |
1662 | | - |
1663 | | - |
1664 | | - |
1665 | | - |
1666 | | - |
1667 | extern QPointer<QWidget> qt_last_mouse_receiver; | - |
1668 | extern QWidget *qt_button_down; | - |
1669 | void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) | - |
1670 | { | - |
1671 | | - |
1672 | if (!widget || widget->isWindow()) partially evaluated: !widget no Evaluation Count:0 | yes Evaluation Count:25443 |
evaluated: widget->isWindow() yes Evaluation Count:5053 | yes Evaluation Count:20390 |
| 0-25443 |
1673 | return; executed: return; Execution Count:5053 | 5053 |
1674 | const bool widgetInShow = widget->isVisible() && !widget->data->in_destructor; evaluated: widget->isVisible() yes Evaluation Count:8634 | yes Evaluation Count:11756 |
evaluated: !widget->data->in_destructor yes Evaluation Count:8015 | yes Evaluation Count:619 |
| 619-11756 |
1675 | if (!widgetInShow && widget != qt_last_mouse_receiver) evaluated: !widgetInShow yes Evaluation Count:12375 | yes Evaluation Count:8015 |
evaluated: widget != qt_last_mouse_receiver yes Evaluation Count:11439 | yes Evaluation Count:936 |
| 936-12375 |
1676 | return; executed: return; Execution Count:11439 | 11439 |
1677 | | - |
1678 | if (widgetInShow && widget->parentWidget()->data->in_show) evaluated: widgetInShow yes Evaluation Count:8015 | yes Evaluation Count:936 |
evaluated: widget->parentWidget()->data->in_show yes Evaluation Count:6628 | yes Evaluation Count:1387 |
| 936-8015 |
1679 | return; executed: return; Execution Count:6628 | 6628 |
1680 | | - |
1681 | QWidget *mouseGrabber = QWidget::mouseGrabber(); | - |
1682 | if (mouseGrabber && mouseGrabber != widget) partially evaluated: mouseGrabber no Evaluation Count:0 | yes Evaluation Count:2323 |
never evaluated: mouseGrabber != widget | 0-2323 |
1683 | return; | 0 |
1684 | | - |
1685 | QWidget *tlw = widget->window(); | - |
1686 | if (tlw->data->in_destructor || tlw->data->is_closing) evaluated: tlw->data->in_destructor yes Evaluation Count:745 | yes Evaluation Count:1578 |
evaluated: tlw->data->is_closing yes Evaluation Count:11 | yes Evaluation Count:1567 |
| 11-1578 |
1687 | return; executed: return; Execution Count:756 | 756 |
1688 | | - |
1689 | if (widgetInShow && (!qt_last_mouse_receiver || qt_last_mouse_receiver->window() != tlw)) evaluated: widgetInShow yes Evaluation Count:1385 | yes Evaluation Count:182 |
evaluated: !qt_last_mouse_receiver yes Evaluation Count:753 | yes Evaluation Count:632 |
evaluated: qt_last_mouse_receiver->window() != tlw yes Evaluation Count:336 | yes Evaluation Count:296 |
| 182-1385 |
1690 | return; executed: return; Execution Count:1089 | 1089 |
1691 | | - |
1692 | const QPoint globalPos(QCursor::pos()); | - |
1693 | QPoint windowPos = tlw->mapFromGlobal(globalPos); | - |
1694 | | - |
1695 | | - |
1696 | | - |
1697 | | - |
1698 | QWidget *widgetUnderCursor = tlw->d_func()->childAt_helper(windowPos, widget->data->in_destructor); | - |
1699 | if (!widgetUnderCursor) evaluated: !widgetUnderCursor yes Evaluation Count:127 | yes Evaluation Count:351 |
| 127-351 |
1700 | widgetUnderCursor = tlw; executed: widgetUnderCursor = tlw; Execution Count:127 | 127 |
1701 | QPoint pos = widgetUnderCursor->mapFrom(tlw, windowPos); | - |
1702 | | - |
1703 | if (widgetInShow && widgetUnderCursor != widget && !widget->isAncestorOf(widgetUnderCursor)) evaluated: widgetInShow yes Evaluation Count:296 | yes Evaluation Count:182 |
evaluated: widgetUnderCursor != widget yes Evaluation Count:266 | yes Evaluation Count:30 |
evaluated: !widget->isAncestorOf(widgetUnderCursor) yes Evaluation Count:223 | yes Evaluation Count:43 |
| 30-296 |
1704 | return; executed: return; Execution Count:223 | 223 |
1705 | | - |
1706 | if (widget->data->in_destructor && qt_button_down == widget) evaluated: widget->data->in_destructor yes Evaluation Count:65 | yes Evaluation Count:190 |
partially evaluated: qt_button_down == widget no Evaluation Count:0 | yes Evaluation Count:65 |
| 0-190 |
1707 | qt_button_down = 0; never executed: qt_button_down = 0; | 0 |
1708 | | - |
1709 | | - |
1710 | QMouseEvent e(QEvent::MouseMove, pos, windowPos, globalPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier); | - |
1711 | sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver); | - |
1712 | | - |
1713 | } executed: } Execution Count:255 | 255 |
1714 | QDesktopWidget *QApplication::desktop() | - |
1715 | { | - |
1716 | if (!qt_desktopWidget || evaluated: !qt_desktopWidget yes Evaluation Count:106 | yes Evaluation Count:4575 |
| 106-4575 |
1717 | !(qt_desktopWidget->windowType() == Qt::Desktop)) { partially evaluated: !(qt_desktopWidget->windowType() == Qt::Desktop) no Evaluation Count:0 | yes Evaluation Count:4575 |
| 0-4575 |
1718 | qt_desktopWidget = new QDesktopWidget(); | - |
1719 | } executed: } Execution Count:106 | 106 |
1720 | return qt_desktopWidget; executed: return qt_desktopWidget; Execution Count:4681 | 4681 |
1721 | } | - |
1722 | | - |
1723 | | - |
1724 | | - |
1725 | | - |
1726 | | - |
1727 | | - |
1728 | | - |
1729 | void QApplication::setStartDragTime(int ms) | - |
1730 | { | - |
1731 | (void)ms; | - |
1732 | } | 0 |
1733 | int QApplication::startDragTime() | - |
1734 | { | - |
1735 | return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->startDragTime(); never executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->startDragTime(); | 0 |
1736 | } | - |
1737 | | - |
1738 | | - |
1739 | | - |
1740 | | - |
1741 | | - |
1742 | | - |
1743 | | - |
1744 | void QApplication::setStartDragDistance(int l) | - |
1745 | { | - |
1746 | (void)l;; | - |
1747 | } | 0 |
1748 | int QApplication::startDragDistance() | - |
1749 | { | - |
1750 | return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->startDragDistance(); executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->startDragDistance(); Execution Count:9 | 9 |
1751 | } | - |
1752 | int QApplication::exec() | - |
1753 | { | - |
1754 | return QGuiApplication::exec(); executed: return QGuiApplication::exec(); Execution Count:39 | 39 |
1755 | } | - |
1756 | | - |
1757 | bool QApplicationPrivate::shouldQuit() | - |
1758 | { | - |
1759 | | - |
1760 | | - |
1761 | | - |
1762 | QWidgetList list = QApplication::topLevelWidgets(); | - |
1763 | for (int i = 0; i < list.size(); ++i) { evaluated: i < list.size() yes Evaluation Count:24 | yes Evaluation Count:15 |
| 15-24 |
1764 | QWidget *w = list.at(i); | - |
1765 | if (w->isVisible() && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose)) evaluated: w->isVisible() yes Evaluation Count:2 | yes Evaluation Count:22 |
evaluated: !w->parentWidget() yes Evaluation Count:1 | yes Evaluation Count:1 |
partially evaluated: w->testAttribute(Qt::WA_QuitOnClose) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-22 |
1766 | return false; never executed: return false; | 0 |
1767 | } executed: } Execution Count:24 | 24 |
1768 | return QGuiApplicationPrivate::shouldQuit(); executed: return QGuiApplicationPrivate::shouldQuit(); Execution Count:15 | 15 |
1769 | } | - |
1770 | | - |
1771 | static inline void closeAllPopups() | - |
1772 | { | - |
1773 | | - |
1774 | | - |
1775 | int maxiter = 1024; | - |
1776 | QWidget *popup; | - |
1777 | while ((popup = QApplication::activePopupWidget()) && maxiter--) partially evaluated: (popup = QApplication::activePopupWidget()) no Evaluation Count:0 | yes Evaluation Count:44 |
never evaluated: maxiter-- | 0-44 |
1778 | popup->close(); never executed: popup->close(); | 0 |
1779 | } executed: } Execution Count:44 | 44 |
1780 | | - |
1781 | | - |
1782 | | - |
1783 | bool QApplication::notify(QObject *receiver, QEvent *e) | - |
1784 | { | - |
1785 | QApplicationPrivate * const d = d_func(); | - |
1786 | | - |
1787 | if (QApplicationPrivate::is_app_closing) evaluated: QApplicationPrivate::is_app_closing yes Evaluation Count:620 | yes Evaluation Count:662029 |
| 620-662029 |
1788 | return true; executed: return true; Execution Count:620 | 620 |
1789 | | - |
1790 | if (receiver == 0) { partially evaluated: receiver == 0 no Evaluation Count:0 | yes Evaluation Count:662029 |
| 0-662029 |
1791 | QMessageLogger("kernel/qapplication.cpp", 2710, __PRETTY_FUNCTION__).warning("QApplication::notify: Unexpected null receiver"); | - |
1792 | return true; never executed: return true; | 0 |
1793 | } | - |
1794 | | - |
1795 | | - |
1796 | | - |
1797 | | - |
1798 | | - |
1799 | if (receiver->isWindowType()) evaluated: receiver->isWindowType() yes Evaluation Count:22801 | yes Evaluation Count:639230 |
| 22801-639230 |
1800 | QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(receiver), e); executed: QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(receiver), e); Execution Count:22801 | 22801 |
1801 | | - |
1802 | if(e->spontaneous()) { evaluated: e->spontaneous() yes Evaluation Count:63529 | yes Evaluation Count:598502 |
| 63529-598502 |
1803 | | - |
1804 | | - |
1805 | | - |
1806 | | - |
1807 | switch (e->type()) { | - |
1808 | case QEvent::MouseButtonPress: | - |
1809 | { | - |
1810 | QMouseEvent *me = static_cast<QMouseEvent*>(e); | - |
1811 | QApplicationPrivate::modifier_buttons = me->modifiers(); | - |
1812 | QApplicationPrivate::mouse_buttons |= me->button(); | - |
1813 | break; executed: break; Execution Count:5296 | 5296 |
1814 | } | - |
1815 | case QEvent::MouseButtonRelease: | - |
1816 | { | - |
1817 | QMouseEvent *me = static_cast<QMouseEvent*>(e); | - |
1818 | QApplicationPrivate::modifier_buttons = me->modifiers(); | - |
1819 | QApplicationPrivate::mouse_buttons &= ~me->button(); | - |
1820 | break; executed: break; Execution Count:5256 | 5256 |
1821 | } | - |
1822 | case QEvent::KeyPress: | - |
1823 | case QEvent::KeyRelease: | - |
1824 | case QEvent::MouseMove: | - |
1825 | | - |
1826 | case QEvent::Wheel: | - |
1827 | | - |
1828 | case QEvent::TouchBegin: | - |
1829 | case QEvent::TouchUpdate: | - |
1830 | case QEvent::TouchEnd: | - |
1831 | | - |
1832 | case QEvent::TabletMove: | - |
1833 | case QEvent::TabletPress: | - |
1834 | case QEvent::TabletRelease: | - |
1835 | | - |
1836 | { | - |
1837 | QInputEvent *ie = static_cast<QInputEvent*>(e); | - |
1838 | QApplicationPrivate::modifier_buttons = ie->modifiers(); | - |
1839 | break; executed: break; Execution Count:11817 | 11817 |
1840 | } | - |
1841 | default: | - |
1842 | break; executed: break; Execution Count:41160 | 41160 |
1843 | } | - |
1844 | } executed: } Execution Count:63529 | 63529 |
1845 | | - |
1846 | | - |
1847 | | - |
1848 | if (d->gestureManager) { evaluated: d->gestureManager yes Evaluation Count:532491 | yes Evaluation Count:129541 |
| 129541-532491 |
1849 | switch (e->type()) { | - |
1850 | case QEvent::Paint: | - |
1851 | case QEvent::MetaCall: | - |
1852 | case QEvent::DeferredDelete: | - |
1853 | case QEvent::DragEnter: case QEvent::DragMove: case QEvent::DragLeave: | - |
1854 | case QEvent::Drop: case QEvent::DragResponse: | - |
1855 | case QEvent::ChildAdded: case QEvent::ChildPolished: | - |
1856 | case QEvent::ChildRemoved: | - |
1857 | case QEvent::UpdateRequest: | - |
1858 | case QEvent::UpdateLater: | - |
1859 | case QEvent::LocaleChange: | - |
1860 | case QEvent::Style: | - |
1861 | case QEvent::IconDrag: | - |
1862 | case QEvent::StyleChange: | - |
1863 | case QEvent::GraphicsSceneDragEnter: | - |
1864 | case QEvent::GraphicsSceneDragMove: | - |
1865 | case QEvent::GraphicsSceneDragLeave: | - |
1866 | case QEvent::GraphicsSceneDrop: | - |
1867 | case QEvent::DynamicPropertyChange: | - |
1868 | case QEvent::NetworkReplyUpdated: | - |
1869 | break; executed: break; Execution Count:158382 | 158382 |
1870 | default: | - |
1871 | if (receiver->isWidgetType()) { evaluated: receiver->isWidgetType() yes Evaluation Count:335546 | yes Evaluation Count:38563 |
| 38563-335546 |
1872 | if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e)) evaluated: d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e) yes Evaluation Count:12 | yes Evaluation Count:335534 |
| 12-335534 |
1873 | return true; executed: return true; Execution Count:12 | 12 |
1874 | } else { executed: } Execution Count:335534 | 335534 |
1875 | | - |
1876 | | - |
1877 | | - |
1878 | if (d->gestureManager->filterEvent(receiver, e)) partially evaluated: d->gestureManager->filterEvent(receiver, e) no Evaluation Count:0 | yes Evaluation Count:38563 |
| 0-38563 |
1879 | return true; never executed: return true; | 0 |
1880 | } executed: } Execution Count:38563 | 38563 |
1881 | } | - |
1882 | } executed: } Execution Count:532479 | 532479 |
1883 | | - |
1884 | | - |
1885 | switch (e->type()) { | - |
1886 | case QEvent::ApplicationDeactivate: | - |
1887 | | - |
1888 | | - |
1889 | closeAllPopups(); | - |
1890 | break; executed: break; Execution Count:44 | 44 |
1891 | case QEvent::Wheel: | - |
1892 | case QEvent::ActivationChange: | - |
1893 | case QEvent::KeyPress: | - |
1894 | case QEvent::KeyRelease: | - |
1895 | case QEvent::FocusOut: | - |
1896 | case QEvent::FocusIn: | - |
1897 | case QEvent::MouseButtonPress: | - |
1898 | case QEvent::MouseButtonRelease: | - |
1899 | case QEvent::MouseButtonDblClick: | - |
1900 | d->toolTipFallAsleep.stop(); | - |
1901 | | - |
1902 | case QEvent::Leave: code before this statement executed: case QEvent::Leave: Execution Count:35569 | 35569 |
1903 | d->toolTipWakeUp.stop(); | - |
1904 | default: | - |
1905 | break; executed: break; Execution Count:661974 | 661974 |
1906 | } | - |
1907 | | - |
1908 | bool res = false; | - |
1909 | if (!receiver->isWidgetType()) { evaluated: !receiver->isWidgetType() yes Evaluation Count:74987 | yes Evaluation Count:587029 |
| 74987-587029 |
1910 | res = d->notify_helper(receiver, e); | - |
1911 | } else switch (e->type()) { executed: } Execution Count:74982 | 74982 |
1912 | case QEvent::ShortcutOverride: | - |
1913 | case QEvent::KeyPress: | - |
1914 | case QEvent::KeyRelease: | - |
1915 | { | - |
1916 | bool isWidget = receiver->isWidgetType(); | - |
1917 | bool isGraphicsWidget = false; | - |
1918 | | - |
1919 | isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver); partially evaluated: !isWidget no Evaluation Count:0 | yes Evaluation Count:16196 |
never evaluated: qobject_cast<QGraphicsWidget *>(receiver) | 0-16196 |
1920 | | - |
1921 | if (!isWidget && !isGraphicsWidget) { partially evaluated: !isWidget no Evaluation Count:0 | yes Evaluation Count:16196 |
never evaluated: !isGraphicsWidget | 0-16196 |
1922 | res = d->notify_helper(receiver, e); | - |
1923 | break; | 0 |
1924 | } | - |
1925 | | - |
1926 | QKeyEvent* key = static_cast<QKeyEvent*>(e); | - |
1927 | if (key->type()==QEvent::KeyPress) { evaluated: key->type()==QEvent::KeyPress yes Evaluation Count:5520 | yes Evaluation Count:10676 |
| 5520-10676 |
1928 | | - |
1929 | | - |
1930 | if ((res = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.tryShortcutEvent(receiver, key))) evaluated: (res = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->shortcutMap.tryShortcutEvent(receiver, key)) yes Evaluation Count:118 | yes Evaluation Count:5402 |
| 118-5402 |
1931 | return res; executed: return res; Execution Count:118 | 118 |
1932 | | - |
1933 | qt_in_tab_key_event = (key->key() == Qt::Key_Backtab evaluated: key->key() == Qt::Key_Backtab yes Evaluation Count:20 | yes Evaluation Count:5382 |
| 20-5382 |
1934 | || key->key() == Qt::Key_Tab evaluated: key->key() == Qt::Key_Tab yes Evaluation Count:143 | yes Evaluation Count:5239 |
| 143-5239 |
1935 | || key->key() == Qt::Key_Left evaluated: key->key() == Qt::Key_Left yes Evaluation Count:448 | yes Evaluation Count:4791 |
| 448-4791 |
1936 | || key->key() == Qt::Key_Up evaluated: key->key() == Qt::Key_Up yes Evaluation Count:1087 | yes Evaluation Count:3704 |
| 1087-3704 |
1937 | || key->key() == Qt::Key_Right evaluated: key->key() == Qt::Key_Right yes Evaluation Count:398 | yes Evaluation Count:3306 |
| 398-3306 |
1938 | || key->key() == Qt::Key_Down); evaluated: key->key() == Qt::Key_Down yes Evaluation Count:527 | yes Evaluation Count:2779 |
| 527-2779 |
1939 | } executed: } Execution Count:5402 | 5402 |
1940 | bool def = key->isAccepted(); | - |
1941 | QPointer<QObject> pr = receiver; | - |
1942 | while (receiver) { partially evaluated: receiver yes Evaluation Count:18763 | no Evaluation Count:0 |
| 0-18763 |
1943 | if (def) evaluated: def yes Evaluation Count:12424 | yes Evaluation Count:6339 |
| 6339-12424 |
1944 | key->accept(); executed: key->accept(); Execution Count:12424 | 12424 |
1945 | else | - |
1946 | key->ignore(); executed: key->ignore(); Execution Count:6339 | 6339 |
1947 | res = d->notify_helper(receiver, e); | - |
1948 | QWidget *w = isWidget ? static_cast<QWidget *>(receiver) : 0; partially evaluated: isWidget yes Evaluation Count:18763 | no Evaluation Count:0 |
| 0-18763 |
1949 | | - |
1950 | QGraphicsWidget *gw = isGraphicsWidget ? static_cast<QGraphicsWidget *>(receiver) : 0; partially evaluated: isGraphicsWidget no Evaluation Count:0 | yes Evaluation Count:18763 |
| 0-18763 |
1951 | | - |
1952 | | - |
1953 | if ((res && key->isAccepted()) evaluated: res yes Evaluation Count:18760 | yes Evaluation Count:3 |
evaluated: key->isAccepted() yes Evaluation Count:7074 | yes Evaluation Count:11686 |
| 3-18760 |
1954 | || !pr partially evaluated: !pr no Evaluation Count:0 | yes Evaluation Count:11689 |
| 0-11689 |
1955 | || (isWidget && (w->isWindow() || !w->parentWidget())) partially evaluated: isWidget yes Evaluation Count:11689 | no Evaluation Count:0 |
evaluated: w->isWindow() yes Evaluation Count:9004 | yes Evaluation Count:2685 |
partially evaluated: !w->parentWidget() no Evaluation Count:0 | yes Evaluation Count:2685 |
| 0-11689 |
1956 | | - |
1957 | || (isGraphicsWidget && (gw->isWindow() || !gw->parentWidget())) partially evaluated: isGraphicsWidget no Evaluation Count:0 | yes Evaluation Count:2685 |
never evaluated: gw->isWindow() never evaluated: !gw->parentWidget() | 0-2685 |
1958 | | - |
1959 | ) { | - |
1960 | break; executed: break; Execution Count:16078 | 16078 |
1961 | } | - |
1962 | | - |
1963 | | - |
1964 | receiver = w ? (QObject *)w->parentWidget() : (QObject *)gw->parentWidget(); partially evaluated: w yes Evaluation Count:2685 | no Evaluation Count:0 |
| 0-2685 |
1965 | | - |
1966 | | - |
1967 | | - |
1968 | } executed: } Execution Count:2685 | 2685 |
1969 | qt_in_tab_key_event = false; | - |
1970 | } | - |
1971 | break; executed: break; Execution Count:16078 | 16078 |
1972 | case QEvent::MouseButtonPress: | - |
1973 | case QEvent::MouseButtonRelease: | - |
1974 | case QEvent::MouseButtonDblClick: | - |
1975 | case QEvent::MouseMove: | - |
1976 | { | - |
1977 | QWidget* w = static_cast<QWidget *>(receiver); | - |
1978 | | - |
1979 | QMouseEvent* mouse = static_cast<QMouseEvent*>(e); | - |
1980 | QPoint relpos = mouse->pos(); | - |
1981 | | - |
1982 | if (e->spontaneous()) { evaluated: e->spontaneous() yes Evaluation Count:11600 | yes Evaluation Count:938 |
| 938-11600 |
1983 | | - |
1984 | if (e->type() == QEvent::MouseButtonPress) { evaluated: e->type() == QEvent::MouseButtonPress yes Evaluation Count:5288 | yes Evaluation Count:6312 |
| 5288-6312 |
1985 | QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, | - |
1986 | Qt::ClickFocus, | - |
1987 | Qt::MouseFocusReason); | - |
1988 | } executed: } Execution Count:5288 | 5288 |
1989 | if (e->type() == QEvent::MouseMove && mouse->buttons() == 0) { evaluated: e->type() == QEvent::MouseMove yes Evaluation Count:675 | yes Evaluation Count:10925 |
evaluated: mouse->buttons() == 0 yes Evaluation Count:674 | yes Evaluation Count:1 |
| 1-10925 |
1990 | d->toolTipWidget = w; | - |
1991 | d->toolTipPos = relpos; | - |
1992 | d->toolTipGlobalPos = mouse->globalPos(); | - |
1993 | d->toolTipWakeUp.start(d->toolTipFallAsleep.isActive()?20:700, this); | - |
1994 | } executed: } Execution Count:674 | 674 |
1995 | } executed: } Execution Count:11600 | 11600 |
1996 | | - |
1997 | bool eventAccepted = mouse->isAccepted(); | - |
1998 | | - |
1999 | QPointer<QWidget> pw = w; | - |
2000 | while (w) { partially evaluated: w yes Evaluation Count:12559 | no Evaluation Count:0 |
| 0-12559 |
2001 | QMouseEvent me(mouse->type(), relpos, mouse->windowPos(), mouse->globalPos(), mouse->button(), mouse->buttons(), | - |
2002 | mouse->modifiers()); | - |
2003 | me.spont = mouse->spontaneous(); | - |
2004 | me.setTimestamp(mouse->timestamp()); | - |
2005 | | - |
2006 | if (!w->hasMouseTracking() evaluated: !w->hasMouseTracking() yes Evaluation Count:11514 | yes Evaluation Count:1045 |
| 1045-11514 |
2007 | && mouse->type() == QEvent::MouseMove && mouse->buttons() == 0) { evaluated: mouse->type() == QEvent::MouseMove yes Evaluation Count:591 | yes Evaluation Count:10923 |
evaluated: mouse->buttons() == 0 yes Evaluation Count:530 | yes Evaluation Count:61 |
| 61-10923 |
2008 | | - |
2009 | for (int i = 0; d->extraData && i < d->extraData->eventFilters.size(); ++i) { evaluated: d->extraData yes Evaluation Count:130 | yes Evaluation Count:465 |
evaluated: i < d->extraData->eventFilters.size() yes Evaluation Count:65 | yes Evaluation Count:65 |
| 65-465 |
2010 | register QObject *obj = d->extraData->eventFilters.at(i); | - |
2011 | if (!obj) evaluated: !obj yes Evaluation Count:28 | yes Evaluation Count:37 |
| 28-37 |
2012 | continue; executed: continue; Execution Count:28 | 28 |
2013 | if (obj->d_func()->threadData != w->d_func()->threadData) { partially evaluated: obj->d_func()->threadData != w->d_func()->threadData no Evaluation Count:0 | yes Evaluation Count:37 |
| 0-37 |
2014 | QMessageLogger("kernel/qapplication.cpp", 2953, __PRETTY_FUNCTION__).warning("QApplication: Object event filter cannot be in a different thread."); | - |
2015 | continue; never executed: continue; | 0 |
2016 | } | - |
2017 | if (obj->eventFilter(w, w == receiver ? mouse : &me)) partially evaluated: obj->eventFilter(w, w == receiver ? mouse : &me) no Evaluation Count:0 | yes Evaluation Count:37 |
| 0-37 |
2018 | break; | 0 |
2019 | } executed: } Execution Count:37 | 37 |
2020 | res = true; | - |
2021 | } else { executed: } Execution Count:530 | 530 |
2022 | w->setAttribute(Qt::WA_NoMouseReplay, false); | - |
2023 | res = d->notify_helper(w, w == receiver ? mouse : &me); | - |
2024 | e->spont = false; | - |
2025 | } executed: } Execution Count:12029 | 12029 |
2026 | eventAccepted = (w == receiver ? mouse : &me)->isAccepted(); evaluated: w == receiver yes Evaluation Count:12538 | yes Evaluation Count:21 |
| 21-12538 |
2027 | if (res && eventAccepted) evaluated: res yes Evaluation Count:12551 | yes Evaluation Count:8 |
evaluated: eventAccepted yes Evaluation Count:12475 | yes Evaluation Count:76 |
| 8-12551 |
2028 | break; executed: break; Execution Count:12475 | 12475 |
2029 | if (w->isWindow() || w->testAttribute(Qt::WA_NoMousePropagation)) evaluated: w->isWindow() yes Evaluation Count:57 | yes Evaluation Count:27 |
evaluated: w->testAttribute(Qt::WA_NoMousePropagation) yes Evaluation Count:6 | yes Evaluation Count:21 |
| 6-57 |
2030 | break; executed: break; Execution Count:63 | 63 |
2031 | relpos += w->pos(); | - |
2032 | w = w->parentWidget(); | - |
2033 | } executed: } Execution Count:21 | 21 |
2034 | | - |
2035 | mouse->setAccepted(eventAccepted); | - |
2036 | | - |
2037 | if (e->type() == QEvent::MouseMove) { evaluated: e->type() == QEvent::MouseMove yes Evaluation Count:1128 | yes Evaluation Count:11410 |
| 1128-11410 |
2038 | if (!pw) evaluated: !pw yes Evaluation Count:1 | yes Evaluation Count:1127 |
| 1-1127 |
2039 | break; executed: break; Execution Count:1 | 1 |
2040 | | - |
2041 | w = static_cast<QWidget *>(receiver); | - |
2042 | relpos = mouse->pos(); | - |
2043 | QPoint diff = relpos - w->mapFromGlobal(d->hoverGlobalPos); | - |
2044 | while (w) { partially evaluated: w yes Evaluation Count:2908 | no Evaluation Count:0 |
| 0-2908 |
2045 | if (w->testAttribute(Qt::WA_Hover) && evaluated: w->testAttribute(Qt::WA_Hover) yes Evaluation Count:29 | yes Evaluation Count:2879 |
| 29-2879 |
2046 | (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { evaluated: !QApplication::activePopupWidget() yes Evaluation Count:28 | yes Evaluation Count:1 |
partially evaluated: QApplication::activePopupWidget() == w->window() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-28 |
2047 | QHoverEvent he(QEvent::HoverMove, relpos, relpos - diff, mouse->modifiers()); | - |
2048 | d->notify_helper(w, &he); | - |
2049 | } executed: } Execution Count:28 | 28 |
2050 | if (w->isWindow() || w->testAttribute(Qt::WA_NoMousePropagation)) evaluated: w->isWindow() yes Evaluation Count:1127 | yes Evaluation Count:1781 |
partially evaluated: w->testAttribute(Qt::WA_NoMousePropagation) no Evaluation Count:0 | yes Evaluation Count:1781 |
| 0-1781 |
2051 | break; executed: break; Execution Count:1127 | 1127 |
2052 | relpos += w->pos(); | - |
2053 | w = w->parentWidget(); | - |
2054 | } executed: } Execution Count:1781 | 1781 |
2055 | } executed: } Execution Count:1127 | 1127 |
2056 | | - |
2057 | d->hoverGlobalPos = mouse->globalPos(); | - |
2058 | } | - |
2059 | break; executed: break; Execution Count:12537 | 12537 |
2060 | | - |
2061 | case QEvent::Wheel: | - |
2062 | { | - |
2063 | QWidget* w = static_cast<QWidget *>(receiver); | - |
2064 | QWheelEvent* wheel = static_cast<QWheelEvent*>(e); | - |
2065 | QPoint relpos = wheel->pos(); | - |
2066 | bool eventAccepted = wheel->isAccepted(); | - |
2067 | | - |
2068 | if (e->spontaneous()) { partially evaluated: e->spontaneous() no Evaluation Count:0 | yes Evaluation Count:38 |
| 0-38 |
2069 | QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, | - |
2070 | Qt::WheelFocus, | - |
2071 | Qt::MouseFocusReason); | - |
2072 | } | 0 |
2073 | | - |
2074 | while (w) { partially evaluated: w yes Evaluation Count:42 | no Evaluation Count:0 |
| 0-42 |
2075 | QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), | - |
2076 | wheel->modifiers()); | - |
2077 | we.spont = wheel->spontaneous(); | - |
2078 | res = d->notify_helper(w, w == receiver ? wheel : &we); | - |
2079 | eventAccepted = ((w == receiver) ? wheel : &we)->isAccepted(); evaluated: (w == receiver) yes Evaluation Count:38 | yes Evaluation Count:4 |
| 4-38 |
2080 | e->spont = false; | - |
2081 | if ((res && eventAccepted) evaluated: res yes Evaluation Count:39 | yes Evaluation Count:3 |
evaluated: eventAccepted yes Evaluation Count:35 | yes Evaluation Count:4 |
| 3-39 |
2082 | || w->isWindow() || w->testAttribute(Qt::WA_NoMousePropagation)) evaluated: w->isWindow() yes Evaluation Count:3 | yes Evaluation Count:4 |
partially evaluated: w->testAttribute(Qt::WA_NoMousePropagation) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2083 | break; executed: break; Execution Count:38 | 38 |
2084 | | - |
2085 | relpos += w->pos(); | - |
2086 | w = w->parentWidget(); | - |
2087 | } executed: } Execution Count:4 | 4 |
2088 | wheel->setAccepted(eventAccepted); | - |
2089 | } | - |
2090 | break; executed: break; Execution Count:38 | 38 |
2091 | | - |
2092 | | - |
2093 | case QEvent::ContextMenu: | - |
2094 | { | - |
2095 | QWidget* w = static_cast<QWidget *>(receiver); | - |
2096 | QContextMenuEvent *context = static_cast<QContextMenuEvent*>(e); | - |
2097 | QPoint relpos = context->pos(); | - |
2098 | bool eventAccepted = context->isAccepted(); | - |
2099 | while (w) { partially evaluated: w yes Evaluation Count:305 | no Evaluation Count:0 |
| 0-305 |
2100 | QContextMenuEvent ce(context->reason(), relpos, context->globalPos(), context->modifiers()); | - |
2101 | ce.spont = e->spontaneous(); | - |
2102 | res = d->notify_helper(w, w == receiver ? context : &ce); | - |
2103 | eventAccepted = ((w == receiver) ? context : &ce)->isAccepted(); evaluated: (w == receiver) yes Evaluation Count:205 | yes Evaluation Count:100 |
| 100-205 |
2104 | e->spont = false; | - |
2105 | | - |
2106 | if ((res && eventAccepted) partially evaluated: res yes Evaluation Count:305 | no Evaluation Count:0 |
evaluated: eventAccepted yes Evaluation Count:105 | yes Evaluation Count:200 |
| 0-305 |
2107 | || w->isWindow() || w->testAttribute(Qt::WA_NoMousePropagation)) evaluated: w->isWindow() yes Evaluation Count:100 | yes Evaluation Count:100 |
partially evaluated: w->testAttribute(Qt::WA_NoMousePropagation) no Evaluation Count:0 | yes Evaluation Count:100 |
| 0-100 |
2108 | break; executed: break; Execution Count:205 | 205 |
2109 | | - |
2110 | relpos += w->pos(); | - |
2111 | w = w->parentWidget(); | - |
2112 | } executed: } Execution Count:100 | 100 |
2113 | context->setAccepted(eventAccepted); | - |
2114 | } | - |
2115 | break; executed: break; Execution Count:205 | 205 |
2116 | | - |
2117 | | - |
2118 | case QEvent::TabletMove: | - |
2119 | case QEvent::TabletPress: | - |
2120 | case QEvent::TabletRelease: | - |
2121 | { | - |
2122 | QWidget *w = static_cast<QWidget *>(receiver); | - |
2123 | QTabletEvent *tablet = static_cast<QTabletEvent*>(e); | - |
2124 | QPointF relpos = tablet->posF(); | - |
2125 | bool eventAccepted = tablet->isAccepted(); | - |
2126 | while (w) { | 0 |
2127 | QTabletEvent te(tablet->type(), relpos, tablet->globalPosF(), | - |
2128 | tablet->device(), tablet->pointerType(), | - |
2129 | tablet->pressure(), tablet->xTilt(), tablet->yTilt(), | - |
2130 | tablet->tangentialPressure(), tablet->rotation(), tablet->z(), | - |
2131 | tablet->modifiers(), tablet->uniqueId()); | - |
2132 | te.spont = e->spontaneous(); | - |
2133 | res = d->notify_helper(w, w == receiver ? tablet : &te); | - |
2134 | eventAccepted = ((w == receiver) ? tablet : &te)->isAccepted(); never evaluated: (w == receiver) | 0 |
2135 | e->spont = false; | - |
2136 | if ((res && eventAccepted) never evaluated: eventAccepted | 0 |
2137 | || w->isWindow() never evaluated: w->isWindow() | 0 |
2138 | || w->testAttribute(Qt::WA_NoMousePropagation)) never evaluated: w->testAttribute(Qt::WA_NoMousePropagation) | 0 |
2139 | break; | 0 |
2140 | | - |
2141 | relpos += w->pos(); | - |
2142 | w = w->parentWidget(); | - |
2143 | } | 0 |
2144 | tablet->setAccepted(eventAccepted); | - |
2145 | qt_tabletChokeMouse = tablet->isAccepted(); | - |
2146 | } | - |
2147 | break; | 0 |
2148 | | - |
2149 | | - |
2150 | | - |
2151 | case QEvent::ToolTip: | - |
2152 | case QEvent::WhatsThis: | - |
2153 | case QEvent::QueryWhatsThis: | - |
2154 | { | - |
2155 | QWidget* w = static_cast<QWidget *>(receiver); | - |
2156 | QHelpEvent *help = static_cast<QHelpEvent*>(e); | - |
2157 | QPoint relpos = help->pos(); | - |
2158 | bool eventAccepted = help->isAccepted(); | - |
2159 | while (w) { partially evaluated: w yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2160 | QHelpEvent he(help->type(), relpos, help->globalPos()); | - |
2161 | he.spont = e->spontaneous(); | - |
2162 | res = d->notify_helper(w, w == receiver ? help : &he); | - |
2163 | e->spont = false; | - |
2164 | eventAccepted = (w == receiver ? help : &he)->isAccepted(); partially evaluated: w == receiver yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2165 | if ((res && eventAccepted) || w->isWindow()) partially evaluated: res yes Evaluation Count:3 | no Evaluation Count:0 |
evaluated: eventAccepted yes Evaluation Count:2 | yes Evaluation Count:1 |
partially evaluated: w->isWindow() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-3 |
2166 | break; executed: break; Execution Count:3 | 3 |
2167 | | - |
2168 | relpos += w->pos(); | - |
2169 | w = w->parentWidget(); | - |
2170 | } | 0 |
2171 | help->setAccepted(eventAccepted); | - |
2172 | } | - |
2173 | break; executed: break; Execution Count:3 | 3 |
2174 | | - |
2175 | | - |
2176 | case QEvent::StatusTip: | - |
2177 | case QEvent::WhatsThisClicked: | - |
2178 | { | - |
2179 | QWidget *w = static_cast<QWidget *>(receiver); | - |
2180 | while (w) { partially evaluated: w yes Evaluation Count:215 | no Evaluation Count:0 |
| 0-215 |
2181 | res = d->notify_helper(w, e); | - |
2182 | if ((res && e->isAccepted()) || w->isWindow()) evaluated: res yes Evaluation Count:85 | yes Evaluation Count:130 |
evaluated: e->isAccepted() yes Evaluation Count:2 | yes Evaluation Count:83 |
evaluated: w->isWindow() yes Evaluation Count:126 | yes Evaluation Count:87 |
| 2-130 |
2183 | break; executed: break; Execution Count:128 | 128 |
2184 | w = w->parentWidget(); | - |
2185 | } executed: } Execution Count:87 | 87 |
2186 | } | - |
2187 | break; executed: break; Execution Count:128 | 128 |
2188 | | - |
2189 | | - |
2190 | | - |
2191 | case QEvent::DragEnter: { | - |
2192 | QWidget* w = static_cast<QWidget *>(receiver); | - |
2193 | QDragEnterEvent *dragEvent = static_cast<QDragEnterEvent *>(e); | - |
2194 | | - |
2195 | | - |
2196 | | - |
2197 | QWExtra *extra = w->window()->d_func()->extra; | - |
2198 | if (extra && extra->proxyWidget) { partially evaluated: extra yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2199 | res = d->notify_helper(w, dragEvent); | - |
2200 | break; | 0 |
2201 | } | - |
2202 | | - |
2203 | while (w) { partially evaluated: w yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2204 | if (w->isEnabled() && w->acceptDrops()) { partially evaluated: w->isEnabled() yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: w->acceptDrops() yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2205 | res = d->notify_helper(w, dragEvent); | - |
2206 | if (res && dragEvent->isAccepted()) { partially evaluated: res yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: dragEvent->isAccepted() yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2207 | QDragManager::self()->setCurrentTarget(w); | - |
2208 | break; executed: break; Execution Count:3 | 3 |
2209 | } | - |
2210 | } | 0 |
2211 | if (w->isWindow()) never evaluated: w->isWindow() | 0 |
2212 | break; | 0 |
2213 | dragEvent->p = w->mapToParent(dragEvent->p.toPoint()); | - |
2214 | w = w->parentWidget(); | - |
2215 | } | 0 |
2216 | } | - |
2217 | break; executed: break; Execution Count:3 | 3 |
2218 | case QEvent::DragMove: | - |
2219 | case QEvent::Drop: | - |
2220 | case QEvent::DragLeave: { | - |
2221 | QWidget* w = static_cast<QWidget *>(receiver); | - |
2222 | | - |
2223 | | - |
2224 | | - |
2225 | QWExtra *extra = w->window()->d_func()->extra; | - |
2226 | bool isProxyWidget = extra && extra->proxyWidget; partially evaluated: extra yes Evaluation Count:8 | no Evaluation Count:0 |
partially evaluated: extra->proxyWidget no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2227 | if (!isProxyWidget) partially evaluated: !isProxyWidget yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
2228 | | - |
2229 | w = qobject_cast<QWidget *>(QDragManager::self()->currentTarget()); executed: w = qobject_cast<QWidget *>(QDragManager::self()->currentTarget()); Execution Count:8 | 8 |
2230 | | - |
2231 | if (!w) { partially evaluated: !w no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
2232 | break; | 0 |
2233 | } | - |
2234 | if (e->type() == QEvent::DragMove || e->type() == QEvent::Drop) { evaluated: e->type() == QEvent::DragMove yes Evaluation Count:5 | yes Evaluation Count:3 |
evaluated: e->type() == QEvent::Drop yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-5 |
2235 | QDropEvent *dragEvent = static_cast<QDropEvent *>(e); | - |
2236 | QWidget *origReciver = static_cast<QWidget *>(receiver); | - |
2237 | while (origReciver && w != origReciver) { partially evaluated: origReciver yes Evaluation Count:7 | no Evaluation Count:0 |
partially evaluated: w != origReciver no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
2238 | dragEvent->p = origReciver->mapToParent(dragEvent->p.toPoint()); | - |
2239 | origReciver = origReciver->parentWidget(); | - |
2240 | } | 0 |
2241 | } executed: } Execution Count:7 | 7 |
2242 | res = d->notify_helper(w, e); | - |
2243 | if (e->type() != QEvent::DragMove evaluated: e->type() != QEvent::DragMove yes Evaluation Count:3 | yes Evaluation Count:5 |
| 3-5 |
2244 | | - |
2245 | && !isProxyWidget partially evaluated: !isProxyWidget yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
2246 | | - |
2247 | ) | - |
2248 | QDragManager::self()->setCurrentTarget(0, e->type() == QEvent::Drop); executed: QDragManager::self()->setCurrentTarget(0, e->type() == QEvent::Drop); Execution Count:3 | 3 |
2249 | } | - |
2250 | break; executed: break; Execution Count:8 | 8 |
2251 | | - |
2252 | | - |
2253 | case QEvent::TouchUpdate: | - |
2254 | case QEvent::TouchEnd: | - |
2255 | { | - |
2256 | QWidget *widget = static_cast<QWidget *>(receiver); | - |
2257 | QTouchEvent *touchEvent = static_cast<QTouchEvent *>(e); | - |
2258 | const bool acceptTouchEvents = widget->testAttribute(Qt::WA_AcceptTouchEvents); | - |
2259 | | - |
2260 | touchEvent->setTarget(widget); | - |
2261 | touchEvent->setAccepted(acceptTouchEvents); | - |
2262 | | - |
2263 | res = acceptTouchEvents && d->notify_helper(widget, touchEvent); evaluated: acceptTouchEvents yes Evaluation Count:20 | yes Evaluation Count:3 |
evaluated: d->notify_helper(widget, touchEvent) yes Evaluation Count:6 | yes Evaluation Count:14 |
| 3-20 |
2264 | | - |
2265 | | - |
2266 | if (!touchEvent->isAccepted()) evaluated: !touchEvent->isAccepted() yes Evaluation Count:4 | yes Evaluation Count:19 |
| 4-19 |
2267 | res = d->translateTouchToMouse(widget, touchEvent); executed: res = d->translateTouchToMouse(widget, touchEvent); Execution Count:4 | 4 |
2268 | break; executed: break; Execution Count:23 | 23 |
2269 | } | - |
2270 | | - |
2271 | case QEvent::TouchBegin: | - |
2272 | | - |
2273 | { | - |
2274 | QWidget *widget = static_cast<QWidget *>(receiver); | - |
2275 | QTouchEvent *touchEvent = static_cast<QTouchEvent *>(e); | - |
2276 | bool eventAccepted = touchEvent->isAccepted(); | - |
2277 | if (widget->testAttribute(Qt::WA_AcceptTouchEvents) && e->spontaneous()) { evaluated: widget->testAttribute(Qt::WA_AcceptTouchEvents) yes Evaluation Count:14 | yes Evaluation Count:8 |
evaluated: e->spontaneous() yes Evaluation Count:7 | yes Evaluation Count:7 |
| 7-14 |
2278 | | - |
2279 | QApplicationPrivate::giveFocusAccordingToFocusPolicy(widget, | - |
2280 | Qt::ClickFocus, | - |
2281 | Qt::MouseFocusReason); | - |
2282 | } executed: } Execution Count:7 | 7 |
2283 | | - |
2284 | while (widget) { partially evaluated: widget yes Evaluation Count:28 | no Evaluation Count:0 |
| 0-28 |
2285 | | - |
2286 | bool acceptTouchEvents = widget->testAttribute(Qt::WA_AcceptTouchEvents); | - |
2287 | touchEvent->setTarget(widget); | - |
2288 | touchEvent->setAccepted(acceptTouchEvents); | - |
2289 | QPointer<QWidget> p = widget; | - |
2290 | res = acceptTouchEvents && d->notify_helper(widget, touchEvent); evaluated: acceptTouchEvents yes Evaluation Count:17 | yes Evaluation Count:11 |
evaluated: d->notify_helper(widget, touchEvent) yes Evaluation Count:10 | yes Evaluation Count:7 |
| 7-17 |
2291 | | - |
2292 | | - |
2293 | if (!touchEvent->isAccepted()) { evaluated: !touchEvent->isAccepted() yes Evaluation Count:16 | yes Evaluation Count:12 |
| 12-16 |
2294 | res = d->translateTouchToMouse(widget, touchEvent); | - |
2295 | eventAccepted = touchEvent->isAccepted(); | - |
2296 | if (eventAccepted) evaluated: eventAccepted yes Evaluation Count:4 | yes Evaluation Count:12 |
| 4-12 |
2297 | break; executed: break; Execution Count:4 | 4 |
2298 | } executed: } Execution Count:12 | 12 |
2299 | | - |
2300 | eventAccepted = touchEvent->isAccepted(); | - |
2301 | if (p.isNull()) { partially evaluated: p.isNull() no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
2302 | | - |
2303 | widget = 0; | - |
2304 | } else { | 0 |
2305 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, res && eventAccepted); | - |
2306 | } executed: } Execution Count:24 | 24 |
2307 | touchEvent->spont = false; | - |
2308 | if (res && eventAccepted) { evaluated: res yes Evaluation Count:5 | yes Evaluation Count:19 |
partially evaluated: eventAccepted yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-19 |
2309 | | - |
2310 | for (int i = 0; i < touchEvent->touchPoints().count(); ++i) { evaluated: i < touchEvent->touchPoints().count() yes Evaluation Count:5 | yes Evaluation Count:5 |
| 5 |
2311 | const QTouchEvent::TouchPoint &touchPoint = touchEvent->touchPoints().at(i); | - |
2312 | d->activeTouchPoints[QGuiApplicationPrivate::ActiveTouchPointsKey(touchEvent->device(), touchPoint.id())].target = widget; | - |
2313 | } executed: } Execution Count:5 | 5 |
2314 | break; executed: break; Execution Count:5 | 5 |
2315 | } else if (p.isNull() || widget->isWindow() || widget->testAttribute(Qt::WA_NoMousePropagation)) { partially evaluated: p.isNull() no Evaluation Count:0 | yes Evaluation Count:19 |
evaluated: widget->isWindow() yes Evaluation Count:13 | yes Evaluation Count:6 |
partially evaluated: widget->testAttribute(Qt::WA_NoMousePropagation) no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-19 |
2316 | break; executed: break; Execution Count:13 | 13 |
2317 | } | - |
2318 | QPoint offset = widget->pos(); | - |
2319 | widget = widget->parentWidget(); | - |
2320 | touchEvent->setTarget(widget); | - |
2321 | for (int i = 0; i < touchEvent->_touchPoints.size(); ++i) { evaluated: i < touchEvent->_touchPoints.size() yes Evaluation Count:6 | yes Evaluation Count:6 |
| 6 |
2322 | QTouchEvent::TouchPoint &pt = touchEvent->_touchPoints[i]; | - |
2323 | QRectF rect = pt.rect(); | - |
2324 | rect.moveCenter(offset); | - |
2325 | pt.d->rect = rect; | - |
2326 | pt.d->startPos = pt.startPos() + offset; | - |
2327 | pt.d->lastPos = pt.lastPos() + offset; | - |
2328 | } executed: } Execution Count:6 | 6 |
2329 | } executed: } Execution Count:6 | 6 |
2330 | | - |
2331 | touchEvent->setAccepted(eventAccepted); | - |
2332 | break; executed: break; Execution Count:22 | 22 |
2333 | } | - |
2334 | case QEvent::RequestSoftwareInputPanel: | - |
2335 | inputMethod()->show(); | - |
2336 | break; | 0 |
2337 | case QEvent::CloseSoftwareInputPanel: | - |
2338 | inputMethod()->hide(); | - |
2339 | break; | 0 |
2340 | | - |
2341 | | - |
2342 | case QEvent::NativeGesture: | - |
2343 | { | - |
2344 | | - |
2345 | QWidget *w = static_cast<QWidget *>(receiver); | - |
2346 | while (w) { | 0 |
2347 | e->ignore(); | - |
2348 | res = d->notify_helper(w, e); | - |
2349 | if ((res && e->isAccepted()) || w->isWindow()) never evaluated: e->isAccepted() never evaluated: w->isWindow() | 0 |
2350 | break; | 0 |
2351 | w = w->parentWidget(); | - |
2352 | } | 0 |
2353 | break; | 0 |
2354 | } | - |
2355 | case QEvent::Gesture: | - |
2356 | case QEvent::GestureOverride: | - |
2357 | { | - |
2358 | if (receiver->isWidgetType()) { partially evaluated: receiver->isWidgetType() yes Evaluation Count:268 | no Evaluation Count:0 |
| 0-268 |
2359 | QWidget *w = static_cast<QWidget *>(receiver); | - |
2360 | QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(e); | - |
2361 | QList<QGesture *> allGestures = gestureEvent->gestures(); | - |
2362 | | - |
2363 | bool eventAccepted = gestureEvent->isAccepted(); | - |
2364 | bool wasAccepted = eventAccepted; | - |
2365 | while (w) { partially evaluated: w yes Evaluation Count:340 | no Evaluation Count:0 |
| 0-340 |
2366 | | - |
2367 | QList<QGesture *> gestures; | - |
2368 | QWidgetPrivate *wd = w->d_func(); | - |
2369 | for (int i = 0; i < allGestures.size();) { evaluated: i < allGestures.size() yes Evaluation Count:414 | yes Evaluation Count:340 |
| 340-414 |
2370 | QGesture *g = allGestures.at(i); | - |
2371 | Qt::GestureType type = g->gestureType(); | - |
2372 | QMap<Qt::GestureType, Qt::GestureFlags>::iterator contextit = | - |
2373 | wd->gestureContext.find(type); | - |
2374 | bool deliver = contextit != wd->gestureContext.end() && evaluated: contextit != wd->gestureContext.end() yes Evaluation Count:366 | yes Evaluation Count:48 |
| 48-366 |
2375 | (g->state() == Qt::GestureStarted || w == receiver || evaluated: g->state() == Qt::GestureStarted yes Evaluation Count:122 | yes Evaluation Count:244 |
evaluated: w == receiver yes Evaluation Count:202 | yes Evaluation Count:42 |
| 42-244 |
2376 | (contextit.value() & Qt::ReceivePartialGestures)); evaluated: (contextit.value() & Qt::ReceivePartialGestures) yes Evaluation Count:39 | yes Evaluation Count:3 |
| 3-39 |
2377 | if (deliver) { evaluated: deliver yes Evaluation Count:363 | yes Evaluation Count:51 |
| 51-363 |
2378 | allGestures.removeAt(i); | - |
2379 | gestures.append(g); | - |
2380 | } else { executed: } Execution Count:363 | 363 |
2381 | ++i; | - |
2382 | } executed: } Execution Count:51 | 51 |
2383 | } | - |
2384 | if (!gestures.isEmpty()) { evaluated: !gestures.isEmpty() yes Evaluation Count:319 | yes Evaluation Count:21 |
| 21-319 |
2385 | QGestureEvent ge(gestures); | - |
2386 | ge.t = gestureEvent->t; | - |
2387 | ge.spont = gestureEvent->spont; | - |
2388 | ge.m_accept = wasAccepted; | - |
2389 | ge.m_accepted = gestureEvent->m_accepted; | - |
2390 | res = d->notify_helper(w, &ge); | - |
2391 | gestureEvent->spont = false; | - |
2392 | eventAccepted = ge.isAccepted(); | - |
2393 | for (int i = 0; i < gestures.size(); ++i) { evaluated: i < gestures.size() yes Evaluation Count:363 | yes Evaluation Count:319 |
| 319-363 |
2394 | QGesture *g = gestures.at(i); | - |
2395 | | - |
2396 | | - |
2397 | if (eventAccepted || ge.isAccepted(g)) { evaluated: eventAccepted yes Evaluation Count:221 | yes Evaluation Count:142 |
evaluated: ge.isAccepted(g) yes Evaluation Count:10 | yes Evaluation Count:132 |
| 10-221 |
2398 | | - |
2399 | gestureEvent->m_targetWidgets[g->gestureType()] = w; | - |
2400 | gestureEvent->setAccepted(g, true); | - |
2401 | } else { executed: } Execution Count:231 | 231 |
2402 | | - |
2403 | | - |
2404 | allGestures.append(g); | - |
2405 | } executed: } Execution Count:132 | 132 |
2406 | } | - |
2407 | } executed: } Execution Count:319 | 319 |
2408 | if (allGestures.isEmpty()) evaluated: allGestures.isEmpty() yes Evaluation Count:225 | yes Evaluation Count:115 |
| 115-225 |
2409 | break; executed: break; Execution Count:225 | 225 |
2410 | if (w->isWindow()) evaluated: w->isWindow() yes Evaluation Count:43 | yes Evaluation Count:72 |
| 43-72 |
2411 | break; executed: break; Execution Count:43 | 43 |
2412 | w = w->parentWidget(); | - |
2413 | } executed: } Execution Count:72 | 72 |
2414 | for (QForeachContainer<__typeof__(allGestures)> _container_(allGestures); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGesture *g = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
2415 | gestureEvent->setAccepted(g, false); executed: gestureEvent->setAccepted(g, false); Execution Count:61 | 61 |
2416 | gestureEvent->m_accept = false; | - |
2417 | } else { executed: } Execution Count:268 | 268 |
2418 | res = d->notify_helper(receiver, e); | - |
2419 | } | 0 |
2420 | break; executed: break; Execution Count:268 | 268 |
2421 | } | - |
2422 | | - |
2423 | default: | - |
2424 | res = d->notify_helper(receiver, e); | - |
2425 | break; executed: break; Execution Count:557597 | 557597 |
2426 | } | 0 |
2427 | | - |
2428 | return res; executed: return res; Execution Count:661893 | 661893 |
2429 | } | - |
2430 | | - |
2431 | bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e) | - |
2432 | { | - |
2433 | | - |
2434 | if (sendThroughApplicationEventFilters(receiver, e)) evaluated: sendThroughApplicationEventFilters(receiver, e) yes Evaluation Count:1 | yes Evaluation Count:664363 |
| 1-664363 |
2435 | return true; executed: return true; Execution Count:1 | 1 |
2436 | | - |
2437 | if (receiver->isWidgetType()) { evaluated: receiver->isWidgetType() yes Evaluation Count:589379 | yes Evaluation Count:74988 |
| 74988-589379 |
2438 | QWidget *widget = static_cast<QWidget *>(receiver); | - |
2439 | | - |
2440 | | - |
2441 | | - |
2442 | if ((e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) && evaluated: e->type() == QEvent::Enter yes Evaluation Count:2847 | yes Evaluation Count:586532 |
evaluated: e->type() == QEvent::DragEnter yes Evaluation Count:3 | yes Evaluation Count:586529 |
| 3-586532 |
2443 | (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == widget->window())) evaluated: !QApplication::activePopupWidget() yes Evaluation Count:2813 | yes Evaluation Count:37 |
evaluated: QApplication::activePopupWidget() == widget->window() yes Evaluation Count:7 | yes Evaluation Count:30 |
| 7-2813 |
2444 | widget->setAttribute(Qt::WA_UnderMouse, true); executed: widget->setAttribute(Qt::WA_UnderMouse, true); Execution Count:2820 | 2820 |
2445 | else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave) evaluated: e->type() == QEvent::Leave yes Evaluation Count:964 | yes Evaluation Count:585595 |
evaluated: e->type() == QEvent::DragLeave yes Evaluation Count:1 | yes Evaluation Count:585594 |
| 1-585595 |
2446 | widget->setAttribute(Qt::WA_UnderMouse, false); executed: widget->setAttribute(Qt::WA_UnderMouse, false); Execution Count:965 | 965 |
2447 | | - |
2448 | | - |
2449 | if (QLayout *layout=widget->d_func()->layout) { evaluated: QLayout *layout=widget->d_func()->layout yes Evaluation Count:105401 | yes Evaluation Count:483978 |
| 105401-483978 |
2450 | layout->widgetEvent(e); | - |
2451 | } executed: } Execution Count:105401 | 105401 |
2452 | } executed: } Execution Count:589379 | 589379 |
2453 | | - |
2454 | | - |
2455 | if (sendThroughObjectEventFilters(receiver, e)) evaluated: sendThroughObjectEventFilters(receiver, e) yes Evaluation Count:20446 | yes Evaluation Count:643915 |
| 20446-643915 |
2456 | return true; executed: return true; Execution Count:20446 | 20446 |
2457 | | - |
2458 | | - |
2459 | bool consumed = receiver->event(e); | - |
2460 | e->spont = false; | - |
2461 | return consumed; executed: return consumed; Execution Count:643915 | 643915 |
2462 | } | - |
2463 | | - |
2464 | bool QApplicationPrivate::inPopupMode() | - |
2465 | { | - |
2466 | return QApplicationPrivate::popupWidgets != 0; executed: return QApplicationPrivate::popupWidgets != 0; Execution Count:2288 | 2288 |
2467 | } | - |
2468 | void QApplication::setCursorFlashTime(int msecs) | - |
2469 | { | - |
2470 | (void)msecs;; | - |
2471 | } executed: } Execution Count:1 | 1 |
2472 | | - |
2473 | int QApplication::cursorFlashTime() | - |
2474 | { | - |
2475 | return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->cursorFlashTime(); executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->cursorFlashTime(); Execution Count:4198 | 4198 |
2476 | } | - |
2477 | void QApplication::setDoubleClickInterval(int ms) | - |
2478 | { | - |
2479 | (void)ms;; | - |
2480 | } | 0 |
2481 | | - |
2482 | int QApplication::doubleClickInterval() | - |
2483 | { | - |
2484 | return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->mouseDoubleClickInterval(); executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->mouseDoubleClickInterval(); Execution Count:717 | 717 |
2485 | } | - |
2486 | void QApplication::setKeyboardInputInterval(int ms) | - |
2487 | { | - |
2488 | (void)ms;; | - |
2489 | } | 0 |
2490 | | - |
2491 | int QApplication::keyboardInputInterval() | - |
2492 | { | - |
2493 | return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->keyboardInputInterval(); executed: return (static_cast<QApplication *>(QCoreApplication::instance()))->styleHints()->keyboardInputInterval(); Execution Count:19 | 19 |
2494 | } | - |
2495 | bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event) | - |
2496 | { | - |
2497 | return QGuiApplication::sendSpontaneousEvent(receiver, event); executed: return QGuiApplication::sendSpontaneousEvent(receiver, event); Execution Count:180 | 180 |
2498 | } | - |
2499 | | - |
2500 | | - |
2501 | void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget, | - |
2502 | Qt::FocusPolicy focusPolicy, | - |
2503 | Qt::FocusReason focusReason) | - |
2504 | { | - |
2505 | QWidget *focusWidget = widget; | - |
2506 | while (focusWidget) { partially evaluated: focusWidget yes Evaluation Count:10487 | no Evaluation Count:0 |
| 0-10487 |
2507 | if (focusWidget->isEnabled() evaluated: focusWidget->isEnabled() yes Evaluation Count:10483 | yes Evaluation Count:4 |
| 4-10483 |
2508 | && QApplicationPrivate::shouldSetFocus(focusWidget, focusPolicy)) { evaluated: QApplicationPrivate::shouldSetFocus(focusWidget, focusPolicy) yes Evaluation Count:5062 | yes Evaluation Count:5421 |
| 5062-5421 |
2509 | focusWidget->setFocus(focusReason); | - |
2510 | break; executed: break; Execution Count:5062 | 5062 |
2511 | } | - |
2512 | if (focusWidget->isWindow()) evaluated: focusWidget->isWindow() yes Evaluation Count:233 | yes Evaluation Count:5192 |
| 233-5192 |
2513 | break; executed: break; Execution Count:233 | 233 |
2514 | focusWidget = focusWidget->parentWidget(); | - |
2515 | } executed: } Execution Count:5192 | 5192 |
2516 | } executed: } Execution Count:5295 | 5295 |
2517 | | - |
2518 | bool QApplicationPrivate::shouldSetFocus(QWidget *w, Qt::FocusPolicy policy) | - |
2519 | { | - |
2520 | QWidget *f = w; | - |
2521 | while (f->d_func()->extra && f->d_func()->extra->focus_proxy) evaluated: f->d_func()->extra yes Evaluation Count:15441 | yes Evaluation Count:181 |
evaluated: f->d_func()->extra->focus_proxy yes Evaluation Count:5139 | yes Evaluation Count:10302 |
| 181-15441 |
2522 | f = f->d_func()->extra->focus_proxy; executed: f = f->d_func()->extra->focus_proxy; Execution Count:5139 | 5139 |
2523 | | - |
2524 | if ((w->focusPolicy() & policy) != policy) evaluated: (w->focusPolicy() & policy) != policy yes Evaluation Count:5421 | yes Evaluation Count:5062 |
| 5062-5421 |
2525 | return false; executed: return false; Execution Count:5421 | 5421 |
2526 | if (w != f && (f->focusPolicy() & policy) != policy) evaluated: w != f yes Evaluation Count:22 | yes Evaluation Count:5040 |
partially evaluated: (f->focusPolicy() & policy) != policy no Evaluation Count:0 | yes Evaluation Count:22 |
| 0-5040 |
2527 | return false; never executed: return false; | 0 |
2528 | return true; executed: return true; Execution Count:5062 | 5062 |
2529 | } | - |
2530 | | - |
2531 | void QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent) | - |
2532 | { | - |
2533 | for (int i = 0; i < touchEvent->touchPoints().count(); ++i) { evaluated: i < touchEvent->touchPoints().count() yes Evaluation Count:29 | yes Evaluation Count:29 |
| 29 |
2534 | QTouchEvent::TouchPoint &touchPoint = touchEvent->_touchPoints[i]; | - |
2535 | | - |
2536 | | - |
2537 | QRectF rect = touchPoint.screenRect(); | - |
2538 | const QPointF screenPos = rect.center(); | - |
2539 | const QPointF delta = screenPos - screenPos.toPoint(); | - |
2540 | | - |
2541 | rect.moveCenter(widget->mapFromGlobal(screenPos.toPoint()) + delta); | - |
2542 | touchPoint.d->rect = rect; | - |
2543 | touchPoint.d->startPos = widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta; | - |
2544 | touchPoint.d->lastPos = widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta; | - |
2545 | } executed: } Execution Count:29 | 29 |
2546 | } executed: } Execution Count:29 | 29 |
2547 | | - |
2548 | void QApplicationPrivate::initializeMultitouch() | - |
2549 | { | - |
2550 | initializeMultitouch_sys(); | - |
2551 | } executed: } Execution Count:215 | 215 |
2552 | | - |
2553 | void QApplicationPrivate::cleanupMultitouch() | - |
2554 | { | - |
2555 | cleanupMultitouch_sys(); | - |
2556 | } executed: } Execution Count:213 | 213 |
2557 | | - |
2558 | QWidget *QApplicationPrivate::findClosestTouchPointTarget(QTouchDevice *device, const QPointF &screenPos) | - |
2559 | { | - |
2560 | int closestTouchPointId = -1; | - |
2561 | QObject *closestTarget = 0; | - |
2562 | qreal closestDistance = qreal(0.); | - |
2563 | QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it = activeTouchPoints.constBegin(), | - |
2564 | ite = activeTouchPoints.constEnd(); | - |
2565 | while (it != ite) { evaluated: it != ite yes Evaluation Count:16 | yes Evaluation Count:15 |
| 15-16 |
2566 | if (it.key().device == device) { evaluated: it.key().device == device yes Evaluation Count:15 | yes Evaluation Count:1 |
| 1-15 |
2567 | const QTouchEvent::TouchPoint &touchPoint = it->touchPoint; | - |
2568 | qreal dx = screenPos.x() - touchPoint.screenPos().x(); | - |
2569 | qreal dy = screenPos.y() - touchPoint.screenPos().y(); | - |
2570 | qreal distance = dx * dx + dy * dy; | - |
2571 | if (closestTouchPointId == -1 || distance < closestDistance) { partially evaluated: closestTouchPointId == -1 yes Evaluation Count:15 | no Evaluation Count:0 |
never evaluated: distance < closestDistance | 0-15 |
2572 | closestTouchPointId = touchPoint.id(); | - |
2573 | closestDistance = distance; | - |
2574 | closestTarget = it.value().target.data(); | - |
2575 | } executed: } Execution Count:15 | 15 |
2576 | } executed: } Execution Count:15 | 15 |
2577 | ++it; | - |
2578 | } executed: } Execution Count:16 | 16 |
2579 | return static_cast<QWidget *>(closestTarget); executed: return static_cast<QWidget *>(closestTarget); Execution Count:15 | 15 |
2580 | } | - |
2581 | | - |
2582 | class WidgetAttributeSaver | - |
2583 | { | - |
2584 | public: | - |
2585 | explicit WidgetAttributeSaver(QWidget *widget, Qt::WidgetAttribute attribute, bool forcedValue) | - |
2586 | : m_widget(widget), | - |
2587 | m_attribute(attribute), | - |
2588 | m_savedValue(widget->testAttribute(attribute)) | - |
2589 | { | - |
2590 | widget->setAttribute(attribute, forcedValue); | - |
2591 | } executed: } Execution Count:20 | 20 |
2592 | | - |
2593 | ~WidgetAttributeSaver() | - |
2594 | { | - |
2595 | m_widget->setAttribute(m_attribute, m_savedValue); | - |
2596 | } executed: } Execution Count:20 | 20 |
2597 | | - |
2598 | private: | - |
2599 | QWidget * const m_widget; | - |
2600 | const Qt::WidgetAttribute m_attribute; | - |
2601 | const bool m_savedValue; | - |
2602 | }; | - |
2603 | | - |
2604 | bool QApplicationPrivate::translateTouchToMouse(QWidget *widget, QTouchEvent *event) | - |
2605 | { | - |
2606 | QApplication * const q = q_func(); | - |
2607 | | - |
2608 | | - |
2609 | if (!QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool()) partially evaluated: !QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool() no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
2610 | return false; never executed: return false; | 0 |
2611 | | - |
2612 | for (QForeachContainer<__typeof__(event->touchPoints())> _container_(event->touchPoints()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QTouchEvent::TouchPoint &p = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
2613 | const QEvent::Type eventType = (p.state() & Qt::TouchPointPressed) ? QEvent::MouseButtonPress evaluated: (p.state() & Qt::TouchPointPressed) yes Evaluation Count:16 | yes Evaluation Count:4 |
| 4-16 |
2614 | : (p.state() & Qt::TouchPointReleased) ? QEvent::MouseButtonRelease | - |
2615 | : (p.state() & Qt::TouchPointMoved) ? QEvent::MouseMove | - |
2616 | : QEvent::None; | - |
2617 | | - |
2618 | if (eventType == QEvent::None) partially evaluated: eventType == QEvent::None no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
2619 | continue; never executed: continue; | 0 |
2620 | | - |
2621 | const QPoint pos = widget->mapFromGlobal(p.screenPos().toPoint()); | - |
2622 | | - |
2623 | QMouseEvent mouseEvent(eventType, pos, | - |
2624 | Qt::LeftButton, Qt::LeftButton, | - |
2625 | event->modifiers()); | - |
2626 | mouseEvent.setAccepted(true); | - |
2627 | mouseEvent.setTimestamp(event->timestamp()); | - |
2628 | | - |
2629 | | - |
2630 | | - |
2631 | | - |
2632 | | - |
2633 | WidgetAttributeSaver saver(widget, Qt::WA_NoMousePropagation, true); | - |
2634 | | - |
2635 | | - |
2636 | | - |
2637 | | - |
2638 | const bool res = q->sendSpontaneousEvent(widget, &mouseEvent); | - |
2639 | event->setAccepted(mouseEvent.isAccepted()); | - |
2640 | | - |
2641 | if (mouseEvent.isAccepted()) evaluated: mouseEvent.isAccepted() yes Evaluation Count:8 | yes Evaluation Count:12 |
| 8-12 |
2642 | return res; executed: return res; Execution Count:8 | 8 |
2643 | } executed: } Execution Count:12 | 12 |
2644 | | - |
2645 | return false; executed: return false; Execution Count:12 | 12 |
2646 | } | - |
2647 | | - |
2648 | void QApplicationPrivate::translateRawTouchEvent(QWidget *window, | - |
2649 | QTouchDevice *device, | - |
2650 | const QList<QTouchEvent::TouchPoint> &touchPoints, | - |
2651 | ulong timestamp) | - |
2652 | { | - |
2653 | QApplicationPrivate *d = self; | - |
2654 | typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; | - |
2655 | QHash<QWidget *, StatesAndTouchPoints> widgetsNeedingEvents; | - |
2656 | | - |
2657 | for (int i = 0; i < touchPoints.count(); ++i) { evaluated: i < touchPoints.count() yes Evaluation Count:29 | yes Evaluation Count:29 |
| 29 |
2658 | QTouchEvent::TouchPoint touchPoint = touchPoints.at(i); | - |
2659 | | - |
2660 | | - |
2661 | | - |
2662 | touchPoint.d = touchPoint.d->detach(); | - |
2663 | | - |
2664 | | - |
2665 | QPointer<QObject> target; | - |
2666 | ActiveTouchPointsKey touchInfoKey(device, touchPoint.id()); | - |
2667 | ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey]; | - |
2668 | if (touchPoint.state() == Qt::TouchPointPressed) { evaluated: touchPoint.state() == Qt::TouchPointPressed yes Evaluation Count:15 | yes Evaluation Count:14 |
| 14-15 |
2669 | if (device->type() == QTouchDevice::TouchPad) { partially evaluated: device->type() == QTouchDevice::TouchPad no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
2670 | | - |
2671 | target = d->activeTouchPoints.isEmpty() never evaluated: d->activeTouchPoints.isEmpty() | 0 |
2672 | ? QPointer<QObject>() | - |
2673 | : d->activeTouchPoints.constBegin().value().target; | - |
2674 | } | 0 |
2675 | | - |
2676 | if (!target) { partially evaluated: !target yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
2677 | | - |
2678 | if (!window) partially evaluated: !window no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
2679 | window = QApplication::topLevelAt(touchPoint.screenPos().toPoint()); never executed: window = QApplication::topLevelAt(touchPoint.screenPos().toPoint()); | 0 |
2680 | if (!window) partially evaluated: !window no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
2681 | continue; never executed: continue; | 0 |
2682 | target = window->childAt(window->mapFromGlobal(touchPoint.screenPos().toPoint())); | - |
2683 | if (!target) evaluated: !target yes Evaluation Count:6 | yes Evaluation Count:9 |
| 6-9 |
2684 | target = window; executed: target = window; Execution Count:6 | 6 |
2685 | } executed: } Execution Count:15 | 15 |
2686 | | - |
2687 | if (device->type() == QTouchDevice::TouchScreen) { partially evaluated: device->type() == QTouchDevice::TouchScreen yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
2688 | QWidget *closestWidget = d->findClosestTouchPointTarget(device, touchPoint.screenPos()); | - |
2689 | QWidget *widget = static_cast<QWidget *>(target.data()); | - |
2690 | if (closestWidget partially evaluated: closestWidget no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
2691 | && (widget->isAncestorOf(closestWidget) || closestWidget->isAncestorOf(widget))) { never evaluated: widget->isAncestorOf(closestWidget) never evaluated: closestWidget->isAncestorOf(widget) | 0 |
2692 | target = closestWidget; | - |
2693 | } | 0 |
2694 | } executed: } Execution Count:15 | 15 |
2695 | | - |
2696 | touchInfo.target = target; | - |
2697 | } else { executed: } Execution Count:15 | 15 |
2698 | target = touchInfo.target; | - |
2699 | if (!target) partially evaluated: !target no Evaluation Count:0 | yes Evaluation Count:14 |
| 0-14 |
2700 | continue; never executed: continue; | 0 |
2701 | } executed: } Execution Count:14 | 14 |
2702 | qt_noop(); | - |
2703 | | - |
2704 | StatesAndTouchPoints &maskAndPoints = widgetsNeedingEvents[static_cast<QWidget *>(target.data())]; | - |
2705 | maskAndPoints.first |= touchPoint.state(); | - |
2706 | maskAndPoints.second.append(touchPoint); | - |
2707 | } executed: } Execution Count:29 | 29 |
2708 | | - |
2709 | if (widgetsNeedingEvents.isEmpty()) partially evaluated: widgetsNeedingEvents.isEmpty() no Evaluation Count:0 | yes Evaluation Count:29 |
| 0-29 |
2710 | return; | 0 |
2711 | | - |
2712 | QHash<QWidget *, StatesAndTouchPoints>::ConstIterator it = widgetsNeedingEvents.constBegin(); | - |
2713 | const QHash<QWidget *, StatesAndTouchPoints>::ConstIterator end = widgetsNeedingEvents.constEnd(); | - |
2714 | for (; it != end; ++it) { evaluated: it != end yes Evaluation Count:29 | yes Evaluation Count:29 |
| 29 |
2715 | QWidget *widget = it.key(); | - |
2716 | if (!QApplicationPrivate::tryModalHelper(widget, 0)) partially evaluated: !QApplicationPrivate::tryModalHelper(widget, 0) no Evaluation Count:0 | yes Evaluation Count:29 |
| 0-29 |
2717 | continue; never executed: continue; | 0 |
2718 | | - |
2719 | QEvent::Type eventType; | - |
2720 | switch (it.value().first) { | - |
2721 | case Qt::TouchPointPressed: | - |
2722 | eventType = QEvent::TouchBegin; | - |
2723 | break; executed: break; Execution Count:15 | 15 |
2724 | case Qt::TouchPointReleased: | - |
2725 | eventType = QEvent::TouchEnd; | - |
2726 | break; executed: break; Execution Count:12 | 12 |
2727 | case Qt::TouchPointStationary: | - |
2728 | | - |
2729 | continue; never executed: continue; | 0 |
2730 | default: | - |
2731 | eventType = QEvent::TouchUpdate; | - |
2732 | break; executed: break; Execution Count:2 | 2 |
2733 | } | - |
2734 | | - |
2735 | QTouchEvent touchEvent(eventType, | - |
2736 | device, | - |
2737 | QApplication::keyboardModifiers(), | - |
2738 | it.value().first, | - |
2739 | it.value().second); | - |
2740 | updateTouchPointsForWidget(widget, &touchEvent); | - |
2741 | touchEvent.setTimestamp(timestamp); | - |
2742 | touchEvent.setWindow(window->windowHandle()); | - |
2743 | touchEvent.setTarget(widget); | - |
2744 | | - |
2745 | switch (touchEvent.type()) { | - |
2746 | case QEvent::TouchBegin: | - |
2747 | { | - |
2748 | | - |
2749 | | - |
2750 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); | - |
2751 | (void ) QApplication::sendSpontaneousEvent(widget, &touchEvent); | - |
2752 | break; executed: break; Execution Count:15 | 15 |
2753 | } | - |
2754 | default: | - |
2755 | if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)) { evaluated: widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent) yes Evaluation Count:9 | yes Evaluation Count:5 |
| 5-9 |
2756 | if (touchEvent.type() == QEvent::TouchEnd) evaluated: touchEvent.type() == QEvent::TouchEnd yes Evaluation Count:7 | yes Evaluation Count:2 |
| 2-7 |
2757 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); executed: widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); Execution Count:7 | 7 |
2758 | (void) QApplication::sendSpontaneousEvent(widget, &touchEvent); | - |
2759 | } executed: } Execution Count:9 | 9 |
2760 | break; executed: break; Execution Count:14 | 14 |
2761 | } | - |
2762 | } executed: } Execution Count:29 | 29 |
2763 | } executed: } Execution Count:29 | 29 |
2764 | | - |
2765 | void QApplicationPrivate::translateTouchCancel(QTouchDevice *device, ulong timestamp) | - |
2766 | { | - |
2767 | QTouchEvent touchEvent(QEvent::TouchCancel, device, QApplication::keyboardModifiers()); | - |
2768 | touchEvent.setTimestamp(timestamp); | - |
2769 | QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it | - |
2770 | = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd(); | - |
2771 | QSet<QWidget *> widgetsNeedingCancel; | - |
2772 | while (it != ite) { never evaluated: it != ite | 0 |
2773 | QWidget *widget = static_cast<QWidget *>(it->target.data()); | - |
2774 | if (widget) | 0 |
2775 | widgetsNeedingCancel.insert(widget); never executed: widgetsNeedingCancel.insert(widget); | 0 |
2776 | ++it; | - |
2777 | } | 0 |
2778 | for (QSet<QWidget *>::const_iterator widIt = widgetsNeedingCancel.constBegin(), | - |
2779 | widItEnd = widgetsNeedingCancel.constEnd(); widIt != widItEnd; ++widIt) { never evaluated: widIt != widItEnd | 0 |
2780 | QWidget *widget = *widIt; | - |
2781 | touchEvent.setWindow(widget->windowHandle()); | - |
2782 | touchEvent.setTarget(widget); | - |
2783 | QApplication::sendSpontaneousEvent(widget, &touchEvent); | - |
2784 | } | 0 |
2785 | } | 0 |
2786 | | - |
2787 | void QApplicationPrivate::notifyThemeChanged() | - |
2788 | { | - |
2789 | QGuiApplicationPrivate::notifyThemeChanged(); | - |
2790 | clearSystemPalette(); | - |
2791 | initSystemPalette(); | - |
2792 | } | 0 |
2793 | | - |
2794 | | - |
2795 | void QApplicationPrivate::notifyDragStarted(const QDrag *drag) | - |
2796 | { | - |
2797 | | - |
2798 | QGuiApplicationPrivate::notifyDragStarted(drag); | - |
2799 | qt_button_down = 0; | - |
2800 | } | 0 |
2801 | | - |
2802 | | - |
2803 | | - |
2804 | QGestureManager* QGestureManager::instance() | - |
2805 | { | - |
2806 | QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); | - |
2807 | if (!qAppPriv) partially evaluated: !qAppPriv no Evaluation Count:0 | yes Evaluation Count:11672 |
| 0-11672 |
2808 | return 0; never executed: return 0; | 0 |
2809 | if (!qAppPriv->gestureManager) evaluated: !qAppPriv->gestureManager yes Evaluation Count:56 | yes Evaluation Count:11616 |
| 56-11616 |
2810 | qAppPriv->gestureManager = new QGestureManager((static_cast<QApplication *>(QCoreApplication::instance()))); executed: qAppPriv->gestureManager = new QGestureManager((static_cast<QApplication *>(QCoreApplication::instance()))); Execution Count:56 | 56 |
2811 | return qAppPriv->gestureManager; executed: return qAppPriv->gestureManager; Execution Count:11672 | 11672 |
2812 | } | - |
2813 | | - |
2814 | | - |
2815 | QPixmap QApplicationPrivate::applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const | - |
2816 | { | - |
2817 | QStyleOption opt(0); | - |
2818 | opt.palette = QGuiApplication::palette(); | - |
2819 | return QApplication::style()->generatedIconPixmap(mode, base, &opt); executed: return QApplication::style()->generatedIconPixmap(mode, base, &opt); Execution Count:48 | 48 |
2820 | } | - |
2821 | | - |
2822 | | - |
2823 | | - |
2824 | | - |
| | |