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