kernel/qguiapplication.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qguiapplication.h" -
43 -
44#include "private/qguiapplication_p.h" -
45#include <qpa/qplatformintegrationfactory_p.h> -
46#include "private/qevent_p.h" -
47#include "qfont.h" -
48#include <qpa/qplatformfontdatabase.h> -
49#include <qpa/qplatformwindow.h> -
50#include <qpa/qplatformnativeinterface.h> -
51#include <qpa/qplatformtheme.h> -
52#include <qpa/qplatformintegration.h> -
53#include <qpa/qplatformdrag.h> -
54 -
55#include <QtCore/QAbstractEventDispatcher> -
56#include <QtCore/QVariant> -
57#include <QtCore/private/qcoreapplication_p.h> -
58#include <QtCore/private/qabstracteventdispatcher_p.h> -
59#include <QtCore/qmutex.h> -
60#include <QtCore/private/qthread_p.h> -
61#include <QtCore/qdir.h> -
62#include <QtDebug> -
63#include "qaccessible.h" -
64#include <qpalette.h> -
65#include <qscreen.h> -
66#include "qsessionmanager.h" -
67#include <private/qscreen_p.h> -
68#include <private/qdrawhelper_p.h> -
69 -
70#include <QtGui/qgenericpluginfactory.h> -
71#include <QtGui/qstylehints.h> -
72#include <QtGui/qinputmethod.h> -
73#include <QtGui/qpixmapcache.h> -
74#include <qpa/qplatforminputcontext.h> -
75#include <qpa/qplatforminputcontext_p.h> -
76 -
77#include <qpa/qwindowsysteminterface.h> -
78#include <qpa/qwindowsysteminterface_p.h> -
79#include "private/qwindow_p.h" -
80#include "private/qcursor_p.h" -
81 -
82#include "private/qdnd_p.h" -
83#include <qpa/qplatformthemefactory_p.h> -
84 -
85#ifndef QT_NO_CURSOR -
86#include <qpa/qplatformcursor.h> -
87#endif -
88 -
89#include <QtGui/QPixmap> -
90 -
91#ifndef QT_NO_CLIPBOARD -
92#include <QtGui/QClipboard> -
93#endif -
94 -
95#ifdef Q_OS_MAC -
96# include "private/qcore_mac_p.h" -
97#endif -
98 -
99QT_BEGIN_NAMESPACE -
100 -
101Q_GUI_EXPORT bool qt_is_gui_used = true; -
102 -
103Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton; -
104Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier; -
105 -
106QPointF QGuiApplicationPrivate::lastCursorPosition(0.0, 0.0); -
107 -
108bool QGuiApplicationPrivate::tabletState = false; -
109QWindow *QGuiApplicationPrivate::tabletPressTarget = 0; -
110QWindow *QGuiApplicationPrivate::currentMouseWindow = 0; -
111 -
112QPlatformIntegration *QGuiApplicationPrivate::platform_integration = 0; -
113QPlatformTheme *QGuiApplicationPrivate::platform_theme = 0; -
114 -
115QList<QObject *> QGuiApplicationPrivate::generic_plugin_list; -
116 -
117enum ApplicationResourceFlags -
118{ -
119 ApplicationPaletteExplicitlySet = 0x1, -
120 ApplicationFontExplicitlySet = 0x2 -
121}; -
122 -
123static unsigned applicationResourceFlags = 0; -
124 -
125QString *QGuiApplicationPrivate::platform_name = 0; -
126QString *QGuiApplicationPrivate::displayName = 0; -
127 -
128QPalette *QGuiApplicationPrivate::app_pal = 0; // default application palette -
129 -
130Qt::MouseButtons QGuiApplicationPrivate::buttons = Qt::NoButton; -
131ulong QGuiApplicationPrivate::mousePressTime = 0; -
132Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton; -
133int QGuiApplicationPrivate::mousePressX = 0; -
134int QGuiApplicationPrivate::mousePressY = 0; -
135int QGuiApplicationPrivate::mouse_double_click_distance = 5; -
136 -
137static Qt::LayoutDirection layout_direction = Qt::LeftToRight; -
138static bool force_reverse = false; -
139 -
140QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0; -
141QTouchDevice *QGuiApplicationPrivate::m_fakeTouchDevice = 0; -
142int QGuiApplicationPrivate::m_fakeMouseSourcePointId = 0; -
143 -
144#ifndef QT_NO_CLIPBOARD -
145QClipboard *QGuiApplicationPrivate::qt_clipboard = 0; -
146#endif -
147 -
148QList<QScreen *> QGuiApplicationPrivate::screen_list; -
149 -
150QWindowList QGuiApplicationPrivate::window_list; -
151QWindow *QGuiApplicationPrivate::focus_window = 0; -
152 -
153static QBasicMutex applicationFontMutex; -
154QFont *QGuiApplicationPrivate::app_font = 0; -
155bool QGuiApplicationPrivate::obey_desktop_settings = true; -
156bool QGuiApplicationPrivate::noGrab = false; -
157 -
158static qreal fontSmoothingGamma = 1.7; -
159 -
160extern void qRegisterGuiVariant(); -
161extern void qInitDrawhelperAsm(); -
162extern void qInitImageConversions(); -
163 -
164static bool qt_detectRTLLanguage() -
165{ -
166 return force_reverse ^
executed: return force_reverse ^ (QCoreApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
Execution Count:52
52
167 (QCoreApplication::tr("QT_LAYOUT_DIRECTION",
executed: return force_reverse ^ (QCoreApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
Execution Count:52
52
168 "Translate this string to the string 'LTR' in left-to-right"
executed: return force_reverse ^ (QCoreApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
Execution Count:52
52
169 " languages or to 'RTL' in right-to-left languages (such as Hebrew"
executed: return force_reverse ^ (QCoreApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
Execution Count:52
52
170 " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
executed: return force_reverse ^ (QCoreApplication::tr("QT_LAYOUT_DIRECTION", "Translate this string to the string 'LTR' in left-to-right" " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL"));
Execution Count:52
52
171} -
172 -
173static void initPalette() -
174{ -
175 if (!QGuiApplicationPrivate::app_pal)
evaluated: !QGuiApplicationPrivate::app_pal
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:121948
2-121948
176 if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette())
partially evaluated: const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
177 QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
0
178 if (!QGuiApplicationPrivate::app_pal)
evaluated: !QGuiApplicationPrivate::app_pal
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:121948
2-121948
179 QGuiApplicationPrivate::app_pal = new QPalette(Qt::black);
executed: QGuiApplicationPrivate::app_pal = new QPalette(Qt::black);
Execution Count:2
2
180}
executed: }
Execution Count:121950
121950
181 -
182static inline void clearPalette() -
183{ -
184 delete QGuiApplicationPrivate::app_pal;
executed (the execution status of this line is deduced): delete QGuiApplicationPrivate::app_pal;
-
185 QGuiApplicationPrivate::app_pal = 0;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::app_pal = 0;
-
186}
executed: }
Execution Count:258
258
187 -
188static void initFontUnlocked() -
189{ -
190 if (!QGuiApplicationPrivate::app_font) {
evaluated: !QGuiApplicationPrivate::app_font
TRUEFALSE
yes
Evaluation Count:160
yes
Evaluation Count:806322
160-806322
191 if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()
TRUEFALSE
yes
Evaluation Count:160
no
Evaluation Count:0
0-160
192 if (const QFont *font = theme->font(QPlatformTheme::SystemFont))
partially evaluated: const QFont *font = theme->font(QPlatformTheme::SystemFont)
TRUEFALSE
yes
Evaluation Count:160
no
Evaluation Count:0
0-160
193 QGuiApplicationPrivate::app_font = new QFont(*font);
executed: QGuiApplicationPrivate::app_font = new QFont(*font);
Execution Count:160
160
194 }
executed: }
Execution Count:160
160
195 if (!QGuiApplicationPrivate::app_font)
partially evaluated: !QGuiApplicationPrivate::app_font
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:806482
0-806482
196 QGuiApplicationPrivate::app_font =
never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
0
197 new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
never executed: QGuiApplicationPrivate::app_font = new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
0
198}
executed: }
Execution Count:806482
806482
199 -
200static inline void clearFontUnlocked() -
201{ -
202 delete QGuiApplicationPrivate::app_font;
executed (the execution status of this line is deduced): delete QGuiApplicationPrivate::app_font;
-
203 QGuiApplicationPrivate::app_font = 0;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::app_font = 0;
-
204}
executed: }
Execution Count:258
258
205 -
206/*! -
207 \class QGuiApplication -
208 \brief The QGuiApplication class manages the GUI application's control -
209 flow and main settings. -
210 -
211 \inmodule QtGui -
212 \since 5.0 -
213 -
214 QGuiApplication contains the main event loop, where all events from the window -
215 system and other sources are processed and dispatched. It also handles the -
216 application's initialization and finalization, and provides session management. -
217 In addition, QGuiApplication handles most of the system-wide and application-wide -
218 settings. -
219 -
220 For any GUI application using Qt, there is precisely \b one QGuiApplication -
221 object no matter whether the application has 0, 1, 2 or more windows at -
222 any given time. For non-GUI Qt applications, use QCoreApplication instead, -
223 as it does not depend on the \l QtGui library. For QWidget based Qt applications, -
224 use QApplication instead, as it provides some functionality needed for creating -
225 QWidget instances. -
226 -
227 The QGuiApplication object is accessible through the instance() function, which -
228 returns a pointer equivalent to the global \l qApp pointer. -
229 -
230 QGuiApplication's main areas of responsibility are: -
231 \list -
232 \li It initializes the application with the user's desktop settings, -
233 such as palette(), font() and styleHints(). It keeps -
234 track of these properties in case the user changes the desktop -
235 globally, for example, through some kind of control panel. -
236 -
237 \li It performs event handling, meaning that it receives events -
238 from the underlying window system and dispatches them to the -
239 relevant widgets. You can send your own events to windows by -
240 using sendEvent() and postEvent(). -
241 -
242 \li It parses common command line arguments and sets its internal -
243 state accordingly. See the \l{QGuiApplication::QGuiApplication()} -
244 {constructor documentation} below for more details. -
245 -
246 \li It provides localization of strings that are visible to the -
247 user via translate(). -
248 -
249 \li It provides some magical objects like the clipboard(). -
250 -
251 \li It knows about the application's windows. You can ask which -
252 window is at a certain position using topLevelAt(), get a list of -
253 topLevelWindows(), etc. -
254 -
255 \li It manages the application's mouse cursor handling, see -
256 setOverrideCursor() -
257 -
258 \li It provides support for sophisticated \l{Session Management} -
259 {session management}. This makes it possible for applications -
260 to terminate gracefully when the user logs out, to cancel a -
261 shutdown process if termination isn't possible and even to -
262 preserve the entire application's state for a future session. -
263 See isSessionRestored(), sessionId() and commitDataRequest() and -
264 saveStateRequest() for details. -
265 \endlist -
266 -
267 Since the QGuiApplication object does so much initialization, it \e{must} be -
268 created before any other objects related to the user interface are created. -
269 QGuiApplication also deals with common command line arguments. Hence, it is -
270 usually a good idea to create it \e before any interpretation or -
271 modification of \c argv is done in the application itself. -
272 -
273 \table -
274 \header -
275 \li{2,1} Groups of functions -
276 -
277 \row -
278 \li System settings -
279 \li desktopSettingsAware(), -
280 setDesktopSettingsAware(), -
281 styleHints(), -
282 palette(), -
283 setPalette(), -
284 font(), -
285 setFont(). -
286 -
287 \row -
288 \li Event handling -
289 \li exec(), -
290 processEvents(), -
291 exit(), -
292 quit(). -
293 sendEvent(), -
294 postEvent(), -
295 sendPostedEvents(), -
296 removePostedEvents(), -
297 hasPendingEvents(), -
298 notify(). -
299 -
300 \row -
301 \li Windows -
302 \li allWindows(), -
303 topLevelWindows(), -
304 focusWindow(), -
305 clipboard(), -
306 topLevelAt(). -
307 -
308 \row -
309 \li Advanced cursor handling -
310 \li overrideCursor(), -
311 setOverrideCursor(), -
312 restoreOverrideCursor(). -
313 -
314 \row -
315 \li Session management -
316 \li isSessionRestored(), -
317 sessionId(), -
318 commitDataRequest(), -
319 saveStateRequest(). -
320 -
321 \row -
322 \li Miscellaneous -
323 \li startingUp(), -
324 closingDown(), -
325 type(). -
326 \endtable -
327 -
328 \sa QCoreApplication, QAbstractEventDispatcher, QEventLoop -
329*/ -
330 -
331/*! -
332 Initializes the window system and constructs an application object with -
333 \a argc command line arguments in \a argv. -
334 -
335 \warning The data referred to by \a argc and \a argv must stay valid for -
336 the entire lifetime of the QGuiApplication object. In addition, \a argc must -
337 be greater than zero and \a argv must contain at least one valid character -
338 string. -
339 -
340 The global \c qApp pointer refers to this application object. Only one -
341 application object should be created. -
342 -
343 This application object must be constructed before any \l{QPaintDevice} -
344 {paint devices} (including pixmaps, bitmaps etc.). -
345 -
346 \note \a argc and \a argv might be changed as Qt removes command line -
347 arguments that it recognizes. -
348 -
349 All Qt programs automatically support the following command line options: -
350 \list -
351 \li -reverse, sets the application's layout direction to -
352 Qt::RightToLeft -
353 \li -qmljsdebugger=, activates the QML/JS debugger with a specified port. -
354 The value must be of format port:1234[,block], where block is optional -
355 and will make the application wait until a debugger connects to it. -
356 \li -session \e session, restores the application from an earlier -
357 \l{Session Management}{session}. -
358 \endlist -
359 -
360 \sa arguments() -
361*/ -
362#ifdef Q_QDOC -
363QGuiApplication::QGuiApplication(int &argc, char **argv) -
364#else -
365QGuiApplication::QGuiApplication(int &argc, char **argv, int flags) -
366#endif -
367 : QCoreApplication(*new QGuiApplicationPrivate(argc, argv, flags)) -
368{ -
369 d_func()->init();
executed (the execution status of this line is deduced): d_func()->init();
-
370 -
371 QCoreApplicationPrivate::eventDispatcher->startingUp();
executed (the execution status of this line is deduced): QCoreApplicationPrivate::eventDispatcher->startingUp();
-
372}
executed: }
Execution Count:75
75
373 -
374/*! -
375 \internal -
376*/ -
377QGuiApplication::QGuiApplication(QGuiApplicationPrivate &p) -
378 : QCoreApplication(p) -
379{ -
380 d_func()->init(); }
executed: }
Execution Count:201
201
381 -
382/*! -
383 Destructs the application. -
384*/ -
385QGuiApplication::~QGuiApplication() -
386{ -
387 Q_D(QGuiApplication);
executed (the execution status of this line is deduced): QGuiApplicationPrivate * const d = d_func();
-
388 -
389 d->eventDispatcher->closingDown();
executed (the execution status of this line is deduced): d->eventDispatcher->closingDown();
-
390 d->eventDispatcher = 0;
executed (the execution status of this line is deduced): d->eventDispatcher = 0;
-
391 -
392#ifndef QT_NO_CLIPBOARD -
393 delete QGuiApplicationPrivate::qt_clipboard;
executed (the execution status of this line is deduced): delete QGuiApplicationPrivate::qt_clipboard;
-
394 QGuiApplicationPrivate::qt_clipboard = 0;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::qt_clipboard = 0;
-
395#endif -
396 -
397#ifndef QT_NO_SESSIONMANAGER -
398 delete d->session_manager;
executed (the execution status of this line is deduced): delete d->session_manager;
-
399 d->session_manager = 0;
executed (the execution status of this line is deduced): d->session_manager = 0;
-
400#endif //QT_NO_SESSIONMANAGER -
401 -
402 clearPalette();
executed (the execution status of this line is deduced): clearPalette();
-
403 -
404#ifndef QT_NO_CURSOR -
405 d->cursor_list.clear();
executed (the execution status of this line is deduced): d->cursor_list.clear();
-
406#endif -
407 -
408 delete QGuiApplicationPrivate::platform_name;
executed (the execution status of this line is deduced): delete QGuiApplicationPrivate::platform_name;
-
409 QGuiApplicationPrivate::platform_name = 0;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::platform_name = 0;
-
410 delete QGuiApplicationPrivate::displayName;
executed (the execution status of this line is deduced): delete QGuiApplicationPrivate::displayName;
-
411 QGuiApplicationPrivate::displayName = 0;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::displayName = 0;
-
412}
executed: }
Execution Count:258
258
413 -
414QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags) -
415 : QCoreApplicationPrivate(argc, argv, flags), -
416 styleHints(0), -
417 inputMethod(0), -
418 lastTouchType(QEvent::TouchEnd) -
419{ -
420 self = this;
executed (the execution status of this line is deduced): self = this;
-
421 application_type = QCoreApplicationPrivate::Gui;
executed (the execution status of this line is deduced): application_type = QCoreApplicationPrivate::Gui;
-
422#ifndef QT_NO_SESSIONMANAGER -
423 is_session_restored = false;
executed (the execution status of this line is deduced): is_session_restored = false;
-
424 is_saving_session = false;
executed (the execution status of this line is deduced): is_saving_session = false;
-
425#endif -
426}
executed: }
Execution Count:276
276
427 -
428/*! -
429 \property QGuiApplication::applicationDisplayName -
430 \brief the user-visible name of this application -
431 \since 5.0 -
432 -
433 This name is shown to the user, for instance in window titles. -
434 It can be translated, if necessary. -
435 -
436 If not set, the application display name defaults to the application name. -
437 -
438 \sa applicationName -
439*/ -
440void QGuiApplication::setApplicationDisplayName(const QString &name) -
441{ -
442 if (!QGuiApplicationPrivate::displayName)
partially evaluated: !QGuiApplicationPrivate::displayName
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
443 QGuiApplicationPrivate::displayName = new QString;
executed: QGuiApplicationPrivate::displayName = new QString;
Execution Count:1
1
444 *QGuiApplicationPrivate::displayName = name;
executed (the execution status of this line is deduced): *QGuiApplicationPrivate::displayName = name;
-
445}
executed: }
Execution Count:1
1
446 -
447QString QGuiApplication::applicationDisplayName() -
448{ -
449 return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
executed: return QGuiApplicationPrivate::displayName ? *QGuiApplicationPrivate::displayName : applicationName();
Execution Count:2
2
450} -
451 -
452/*! -
453 Returns the most recently shown modal window. If no modal windows are -
454 visible, this function returns zero. -
455 -
456 A modal window is a window which has its -
457 \l{QWindow::modality}{modality} property set to Qt::WindowModal -
458 or Qt::ApplicationModal. A modal window must be closed before the user can -
459 continue with other parts of the program. -
460 -
461 Modal window are organized in a stack. This function returns the modal -
462 window at the top of the stack. -
463 -
464 \sa Qt::WindowModality, QWindow::setModality() -
465*/ -
466QWindow *QGuiApplication::modalWindow() -
467{ -
468 if (QGuiApplicationPrivate::self->modalWindowList.isEmpty())
evaluated: QGuiApplicationPrivate::self->modalWindowList.isEmpty()
TRUEFALSE
yes
Evaluation Count:2064
yes
Evaluation Count:328
328-2064
469 return 0;
executed: return 0;
Execution Count:2064
2064
470 return QGuiApplicationPrivate::self->modalWindowList.first();
executed: return QGuiApplicationPrivate::self->modalWindowList.first();
Execution Count:328
328
471} -
472 -
473void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window) -
474{ -
475 bool shouldBeBlocked = false;
executed (the execution status of this line is deduced): bool shouldBeBlocked = false;
-
476 if ((window->type() & Qt::Popup) != Qt::Popup && !self->modalWindowList.isEmpty())
evaluated: (window->type() & Qt::Popup) != Qt::Popup
TRUEFALSE
yes
Evaluation Count:912
yes
Evaluation Count:90
evaluated: !self->modalWindowList.isEmpty()
TRUEFALSE
yes
Evaluation Count:493
yes
Evaluation Count:419
90-912
477 shouldBeBlocked = self->isWindowBlocked(window);
executed: shouldBeBlocked = self->isWindowBlocked(window);
Execution Count:493
493
478 -
479 if (shouldBeBlocked != window->d_func()->blockedByModalWindow) {
evaluated: shouldBeBlocked != window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:514
yes
Evaluation Count:488
488-514
480 QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked);
executed (the execution status of this line is deduced): QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked);
-
481 -
482 window->d_func()->blockedByModalWindow = shouldBeBlocked;
executed (the execution status of this line is deduced): window->d_func()->blockedByModalWindow = shouldBeBlocked;
-
483 QGuiApplication::sendEvent(window, &e);
executed (the execution status of this line is deduced): QGuiApplication::sendEvent(window, &e);
-
484 }
executed: }
Execution Count:514
514
485}
executed: }
Execution Count:1002
1002
486 -
487void QGuiApplicationPrivate::showModalWindow(QWindow *modal) -
488{ -
489 self->modalWindowList.prepend(modal);
executed (the execution status of this line is deduced): self->modalWindowList.prepend(modal);
-
490 -
491 // Send leave for currently entered window if it should be blocked -
492 if (currentMouseWindow && (currentMouseWindow->type() & Qt::Popup) != Qt::Popup) {
evaluated: currentMouseWindow
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:81
partially evaluated: (currentMouseWindow->type() & Qt::Popup) != Qt::Popup
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
0-81
493 bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow);
executed (the execution status of this line is deduced): bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow);
-
494 if (shouldBeBlocked) {
evaluated: shouldBeBlocked
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:15
10-15
495 // Remove the new window from modalWindowList temporarily so leave can go through -
496 self->modalWindowList.removeFirst();
executed (the execution status of this line is deduced): self->modalWindowList.removeFirst();
-
497 QEvent e(QEvent::Leave);
executed (the execution status of this line is deduced): QEvent e(QEvent::Leave);
-
498 QGuiApplication::sendEvent(currentMouseWindow, &e);
executed (the execution status of this line is deduced): QGuiApplication::sendEvent(currentMouseWindow, &e);
-
499 currentMouseWindow = 0;
executed (the execution status of this line is deduced): currentMouseWindow = 0;
-
500 self->modalWindowList.prepend(modal);
executed (the execution status of this line is deduced): self->modalWindowList.prepend(modal);
-
501 }
executed: }
Execution Count:10
10
502 }
executed: }
Execution Count:25
25
503 -
504 QWindowList windows = QGuiApplication::topLevelWindows();
executed (the execution status of this line is deduced): QWindowList windows = QGuiApplication::topLevelWindows();
-
505 for (int i = 0; i < windows.count(); ++i) {
evaluated: i < windows.count()
TRUEFALSE
yes
Evaluation Count:387
yes
Evaluation Count:106
106-387
506 QWindow *window = windows.at(i);
executed (the execution status of this line is deduced): QWindow *window = windows.at(i);
-
507 if (!window->d_func()->blockedByModalWindow)
evaluated: !window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:379
yes
Evaluation Count:8
8-379
508 updateBlockedStatus(window);
executed: updateBlockedStatus(window);
Execution Count:379
379
509 }
executed: }
Execution Count:387
387
510 -
511 updateBlockedStatus(modal);
executed (the execution status of this line is deduced): updateBlockedStatus(modal);
-
512}
executed: }
Execution Count:106
106
513 -
514void QGuiApplicationPrivate::hideModalWindow(QWindow *window) -
515{ -
516 self->modalWindowList.removeAll(window);
executed (the execution status of this line is deduced): self->modalWindowList.removeAll(window);
-
517 -
518 QWindowList windows = QGuiApplication::topLevelWindows();
executed (the execution status of this line is deduced): QWindowList windows = QGuiApplication::topLevelWindows();
-
519 for (int i = 0; i < windows.count(); ++i) {
evaluated: i < windows.count()
TRUEFALSE
yes
Evaluation Count:387
yes
Evaluation Count:106
106-387
520 QWindow *window = windows.at(i);
executed (the execution status of this line is deduced): QWindow *window = windows.at(i);
-
521 if (window->d_func()->blockedByModalWindow)
evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:264
yes
Evaluation Count:123
123-264
522 updateBlockedStatus(window);
executed: updateBlockedStatus(window);
Execution Count:264
264
523 }
executed: }
Execution Count:387
387
524}
executed: }
Execution Count:106
106
525 -
526/* -
527 Returns true if \a window is blocked by a modal window. If \a -
528 blockingWindow is non-zero, *blockingWindow will be set to the blocking -
529 window (or to zero if \a window is not blocked). -
530*/ -
531bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const -
532{ -
533 QWindow *unused = 0;
executed (the execution status of this line is deduced): QWindow *unused = 0;
-
534 if (!blockingWindow)
partially evaluated: !blockingWindow
TRUEFALSE
yes
Evaluation Count:54
no
Evaluation Count:0
0-54
535 blockingWindow = &unused;
executed: blockingWindow = &unused;
Execution Count:54
54
536 -
537 if (modalWindowList.isEmpty()) {
partially evaluated: modalWindowList.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:54
0-54
538 *blockingWindow = 0;
never executed (the execution status of this line is deduced): *blockingWindow = 0;
-
539 return false;
never executed: return false;
0
540 } -
541 -
542 for (int i = 0; i < modalWindowList.count(); ++i) {
evaluated: i < modalWindowList.count()
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:13
13-61
543 QWindow *modalWindow = modalWindowList.at(i);
executed (the execution status of this line is deduced): QWindow *modalWindow = modalWindowList.at(i);
-
544 -
545 { -
546 // check if the modal window is our window or a (transient) parent of our window -
547 QWindow *w = window;
executed (the execution status of this line is deduced): QWindow *w = window;
-
548 while (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:74
yes
Evaluation Count:41
41-74
549 if (w == modalWindow) {
evaluated: w == modalWindow
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:54
20-54
550 *blockingWindow = 0;
executed (the execution status of this line is deduced): *blockingWindow = 0;
-
551 return false;
executed: return false;
Execution Count:20
20
552 } -
553 QWindow *p = w->parent();
executed (the execution status of this line is deduced): QWindow *p = w->parent();
-
554 if (!p)
partially evaluated: !p
TRUEFALSE
yes
Evaluation Count:54
no
Evaluation Count:0
0-54
555 p = w->transientParent();
executed: p = w->transientParent();
Execution Count:54
54
556 w = p;
executed (the execution status of this line is deduced): w = p;
-
557 }
executed: }
Execution Count:54
54
558 } -
559 -
560 Qt::WindowModality windowModality = modalWindow->modality();
executed (the execution status of this line is deduced): Qt::WindowModality windowModality = modalWindow->modality();
-
561 switch (windowModality) { -
562 case Qt::ApplicationModal: -
563 { -
564 if (modalWindow != window) {
partially evaluated: modalWindow != window
TRUEFALSE
yes
Evaluation Count:12
no
Evaluation Count:0
0-12
565 *blockingWindow = modalWindow;
executed (the execution status of this line is deduced): *blockingWindow = modalWindow;
-
566 return true;
executed: return true;
Execution Count:12
12
567 } -
568 break;
never executed: break;
0
569 } -
570 case Qt::WindowModal: -
571 { -
572 QWindow *w = window;
executed (the execution status of this line is deduced): QWindow *w = window;
-
573 do { -
574 QWindow *m = modalWindow;
executed (the execution status of this line is deduced): QWindow *m = modalWindow;
-
575 do { -
576 if (m == w) {
evaluated: m == w
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:58
9-58
577 *blockingWindow = m;
executed (the execution status of this line is deduced): *blockingWindow = m;
-
578 return true;
executed: return true;
Execution Count:9
9
579 } -
580 QWindow *p = m->parent();
executed (the execution status of this line is deduced): QWindow *p = m->parent();
-
581 if (!p)
partially evaluated: !p
TRUEFALSE
yes
Evaluation Count:58
no
Evaluation Count:0
0-58
582 p = m->transientParent();
executed: p = m->transientParent();
Execution Count:58
58
583 m = p;
executed (the execution status of this line is deduced): m = p;
-
584 } while (m);
executed: }
Execution Count:58
evaluated: m
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:20
20-58
585 QWindow *p = w->parent();
executed (the execution status of this line is deduced): QWindow *p = w->parent();
-
586 if (!p)
partially evaluated: !p
TRUEFALSE
yes
Evaluation Count:20
no
Evaluation Count:0
0-20
587 p = w->transientParent();
executed: p = w->transientParent();
Execution Count:20
20
588 w = p;
executed (the execution status of this line is deduced): w = p;
-
589 } while (w);
executed: }
Execution Count:20
partially evaluated: w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:20
0-20
590 break;
executed: break;
Execution Count:20
20
591 } -
592 default: -
593 Q_ASSERT_X(false, "QGuiApplication", "internal error, a modal widget cannot be modeless");
never executed (the execution status of this line is deduced): qt_noop();
-
594 break;
never executed: break;
0
595 } -
596 }
executed: }
Execution Count:20
20
597 *blockingWindow = 0;
executed (the execution status of this line is deduced): *blockingWindow = 0;
-
598 return false;
executed: return false;
Execution Count:13
13
599} -
600 -
601/*! -
602 Returns the QWindow that receives events tied to focus, -
603 such as key events. -
604*/ -
605QWindow *QGuiApplication::focusWindow() -
606{ -
607 return QGuiApplicationPrivate::focus_window;
executed: return QGuiApplicationPrivate::focus_window;
Execution Count:51590
51590
608} -
609 -
610/*! -
611 \fn QGuiApplication::focusObjectChanged(QObject *focusObject) -
612 -
613 This signal is emitted when final receiver of events tied to focus is changed. -
614 \a focusObject is the new receiver. -
615 -
616 \sa focusObject() -
617*/ -
618 -
619/*! -
620 \fn QGuiApplication::focusWindowChanged(QWindow *focusWindow) -
621 -
622 This signal is emitted when the focused window changes. -
623 \a focusWindow is the new focused window. -
624 -
625 \sa focusWindow() -
626*/ -
627 -
628/*! -
629 Returns the QObject in currently active window that will be final receiver of events -
630 tied to focus, such as key events. -
631 */ -
632QObject *QGuiApplication::focusObject() -
633{ -
634 if (focusWindow())
evaluated: focusWindow()
TRUEFALSE
yes
Evaluation Count:7841
yes
Evaluation Count:34551
7841-34551
635 return focusWindow()->focusObject();
executed: return focusWindow()->focusObject();
Execution Count:7841
7841
636 return 0;
executed: return 0;
Execution Count:34551
34551
637} -
638 -
639/*! -
640 \fn QGuiApplication::allWindows() -
641 -
642 Returns a list of all the windows in the application. -
643 -
644 The list is empty if there are no windows. -
645 -
646 \sa topLevelWindows() -
647 */ -
648QWindowList QGuiApplication::allWindows() -
649{ -
650 return QGuiApplicationPrivate::window_list;
executed: return QGuiApplicationPrivate::window_list;
Execution Count:6
6
651} -
652 -
653/*! -
654 \fn QGuiApplication::topLevelWindows() -
655 -
656 Returns a list of the top-level windows in the application. -
657 -
658 \sa allWindows() -
659 */ -
660QWindowList QGuiApplication::topLevelWindows() -
661{ -
662 const QWindowList &list = QGuiApplicationPrivate::window_list;
executed (the execution status of this line is deduced): const QWindowList &list = QGuiApplicationPrivate::window_list;
-
663 QWindowList topLevelWindows;
executed (the execution status of this line is deduced): QWindowList topLevelWindows;
-
664 for (int i = 0; i < list.size(); i++) {
evaluated: i < list.size()
TRUEFALSE
yes
Evaluation Count:865
yes
Evaluation Count:251
251-865
665 if (!list.at(i)->parent()) {
evaluated: !list.at(i)->parent()
TRUEFALSE
yes
Evaluation Count:862
yes
Evaluation Count:3
3-862
666 // Top windows of embedded QAxServers do not have QWindow parents, -
667 // but they are not true top level windows, so do not include them. -
668 const bool embedded = list.at(i)->handle() && list.at(i)->handle()->isEmbedded(0);
evaluated: list.at(i)->handle()
TRUEFALSE
yes
Evaluation Count:620
yes
Evaluation Count:242
partially evaluated: list.at(i)->handle()->isEmbedded(0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:620
0-620
669 if (!embedded)
partially evaluated: !embedded
TRUEFALSE
yes
Evaluation Count:862
no
Evaluation Count:0
0-862
670 topLevelWindows.prepend(list.at(i));
executed: topLevelWindows.prepend(list.at(i));
Execution Count:862
862
671 }
executed: }
Execution Count:862
862
672 }
executed: }
Execution Count:865
865
673 return topLevelWindows;
executed: return topLevelWindows;
Execution Count:251
251
674} -
675 -
676/*! -
677 Returns the primary (or default) screen of the application. -
678 -
679 This will be the screen where QWindows are shown, unless otherwise specified. -
680*/ -
681QScreen *QGuiApplication::primaryScreen() -
682{ -
683 if (QGuiApplicationPrivate::screen_list.isEmpty())
evaluated: QGuiApplicationPrivate::screen_list.isEmpty()
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:183245
19-183245
684 return 0;
executed: return 0;
Execution Count:19
19
685 return QGuiApplicationPrivate::screen_list.at(0);
executed: return QGuiApplicationPrivate::screen_list.at(0);
Execution Count:183245
183245
686} -
687 -
688/*! -
689 Returns a list of all the screens associated with the -
690 windowing system the application is connected to. -
691*/ -
692QList<QScreen *> QGuiApplication::screens() -
693{ -
694 return QGuiApplicationPrivate::screen_list;
executed: return QGuiApplicationPrivate::screen_list;
Execution Count:7253
7253
695} -
696 -
697/*! -
698 \fn void QGuiApplication::screenAdded(QScreen *screen) -
699 -
700 This signal is emitted whenever a new screen \a screen has been added to the system. -
701 -
702 \sa screens(), primaryScreen() -
703*/ -
704 -
705 -
706/*! -
707 Returns the highest screen device pixel ratio found on -
708 the system. This is the ratio between physical pixels and -
709 device-independent pixels. -
710 -
711 Use this function only when you don't know which window you are targeting. -
712 If you do know the target window use QWindow::devicePixelRatio() instead. -
713 -
714 \sa QWindow::devicePixelRatio(); -
715 \sa QGuiApplicaiton::devicePixelRatio(); -
716*/ -
717qreal QGuiApplication::devicePixelRatio() const -
718{ -
719 // Cache topDevicePixelRatio, iterate through the screen list once only. -
720 static qreal topDevicePixelRatio = 0.0; -
721 if (!qFuzzyIsNull(topDevicePixelRatio)) {
evaluated: !qFuzzyIsNull(topDevicePixelRatio)
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:2
2-20
722 return topDevicePixelRatio;
executed: return topDevicePixelRatio;
Execution Count:20
20
723 } -
724 -
725 topDevicePixelRatio = 1.0; // make sure we never return 0.
executed (the execution status of this line is deduced): topDevicePixelRatio = 1.0;
-
726 foreach (QScreen *screen, QGuiApplicationPrivate::screen_list) {
executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(QGuiApplicationPrivate::screen_list)> _container_(QGuiApplicationPrivate::screen_list); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QScreen *screen = *_container_.i;; __extension__ ({--_container_.brk; break;})) {
-
727 topDevicePixelRatio = qMax(topDevicePixelRatio, screen->devicePixelRatio());
executed (the execution status of this line is deduced): topDevicePixelRatio = qMax(topDevicePixelRatio, screen->devicePixelRatio());
-
728 }
executed: }
Execution Count:2
2
729 -
730 return topDevicePixelRatio;
executed: return topDevicePixelRatio;
Execution Count:2
2
731} -
732 -
733/*! -
734 Returns the top level window at the given position, if any. -
735*/ -
736QWindow *QGuiApplication::topLevelAt(const QPoint &pos) -
737{ -
738 QList<QScreen *> screens = QGuiApplication::screens();
executed (the execution status of this line is deduced): QList<QScreen *> screens = QGuiApplication::screens();
-
739 QList<QScreen *>::const_iterator screen = screens.constBegin();
executed (the execution status of this line is deduced): QList<QScreen *>::const_iterator screen = screens.constBegin();
-
740 QList<QScreen *>::const_iterator end = screens.constEnd();
executed (the execution status of this line is deduced): QList<QScreen *>::const_iterator end = screens.constEnd();
-
741 -
742 while (screen != end) {
partially evaluated: screen != end
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
743 if ((*screen)->geometry().contains(pos))
partially evaluated: (*screen)->geometry().contains(pos)
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
744 return (*screen)->handle()->topLevelAt(pos);
executed: return (*screen)->handle()->topLevelAt(pos);
Execution Count:6
6
745 ++screen;
never executed (the execution status of this line is deduced): ++screen;
-
746 }
never executed: }
0
747 return 0;
never executed: return 0;
0
748} -
749 -
750/*! -
751 \property QGuiApplication::platformName -
752 \brief The name of the underlying platform plugin. -
753 -
754 Examples: "xcb" (for X11), "Cocoa" (for Mac OS X), "windows", "qnx", -
755 "directfb", "kms", "MinimalEgl", "LinuxFb", "EglFS", "OpenWFD"... -
756*/ -
757 -
758QString QGuiApplication::platformName() -
759{ -
760 return QGuiApplicationPrivate::platform_name ?
executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
Execution Count:10
10
761 *QGuiApplicationPrivate::platform_name : QString();
executed: return QGuiApplicationPrivate::platform_name ? *QGuiApplicationPrivate::platform_name : QString();
Execution Count:10
10
762} -
763 -
764static void init_platform(const QString &pluginArgument, const QString &platformPluginPath) -
765{ -
766 // Split into platform name and arguments -
767 QStringList arguments = pluginArgument.split(QLatin1Char(':'));
executed (the execution status of this line is deduced): QStringList arguments = pluginArgument.split(QLatin1Char(':'));
-
768 const QString name = arguments.takeFirst().toLower();
executed (the execution status of this line is deduced): const QString name = arguments.takeFirst().toLower();
-
769 -
770 // Create the platform integration. -
771 QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, arguments, platformPluginPath);
executed (the execution status of this line is deduced): QGuiApplicationPrivate::platform_integration = QPlatformIntegrationFactory::create(name, arguments, platformPluginPath);
-
772 if (QGuiApplicationPrivate::platform_integration) {
partially evaluated: QGuiApplicationPrivate::platform_integration
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
773 QGuiApplicationPrivate::platform_name = new QString(name);
executed (the execution status of this line is deduced): QGuiApplicationPrivate::platform_name = new QString(name);
-
774 } else {
executed: }
Execution Count:276
276
775 QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
never executed (the execution status of this line is deduced): QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
-
776 QString fatalMessage =
never executed (the execution status of this line is deduced): QString fatalMessage =
-
777 QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name);
never executed (the execution status of this line is deduced): QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name);
-
778 foreach(const QString &key, keys) {
never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(keys)> _container_(keys); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &key = *_container_.i;; __extension__ ({--_container_.brk; break;})) {
-
779 fatalMessage.append(key + QLatin1Char('\n'));
never executed (the execution status of this line is deduced): fatalMessage.append(key + QLatin1Char('\n'));
-
780 }
never executed: }
0
781 qFatal("%s", fatalMessage.toLocal8Bit().constData());
never executed (the execution status of this line is deduced): QMessageLogger("kernel/qguiapplication.cpp", 781, __PRETTY_FUNCTION__).fatal("%s", fatalMessage.toLocal8Bit().constData());
-
782 return;
never executed: return;
0
783 } -
784 -
785 // Create the platform theme: -
786 // 1) Ask the platform integration for a list of names. -
787 const QStringList themeNames = QGuiApplicationPrivate::platform_integration->themeNames();
executed (the execution status of this line is deduced): const QStringList themeNames = QGuiApplicationPrivate::platform_integration->themeNames();
-
788 foreach (const QString &themeName, themeNames) {
executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(themeNames)> _container_(themeNames); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &themeName = *_container_.i;; __extension__ ({--_container_.brk; break;})) {
-
789 QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath);
executed (the execution status of this line is deduced): QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath);
-
790 if (QGuiApplicationPrivate::platform_theme)
partially evaluated: QGuiApplicationPrivate::platform_theme
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
791 break;
never executed: break;
0
792 }
executed: }
Execution Count:276
276
793 -
794 // 2) If none found, look for a theme plugin. Theme plugins are located in the -
795 // same directory as platform plugins. -
796 if (!QGuiApplicationPrivate::platform_theme) {
partially evaluated: !QGuiApplicationPrivate::platform_theme
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
797 foreach (const QString &themeName, themeNames) {
executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(themeNames)> _container_(themeNames); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &themeName = *_container_.i;; __extension__ ({--_container_.brk; break;})) {
-
798 QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName);
executed (the execution status of this line is deduced): QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName);
-
799 if (QGuiApplicationPrivate::platform_theme)
partially evaluated: QGuiApplicationPrivate::platform_theme
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
800 break;
executed: break;
Execution Count:276
276
801 }
never executed: }
0
802 // No error message; not having a theme plugin is allowed. -
803 }
executed: }
Execution Count:276
276
804 -
805 // 3) Fall back on the built-in "null" platform theme. -
806 if (!QGuiApplicationPrivate::platform_theme)
partially evaluated: !QGuiApplicationPrivate::platform_theme
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
807 QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
never executed: QGuiApplicationPrivate::platform_theme = new QPlatformTheme;
0
808 -
809#ifndef QT_NO_PROPERTIES -
810 // Set arguments as dynamic properties on the native interface as -
811 // boolean 'foo' or strings: 'foo=bar' -
812 if (!arguments.isEmpty()) {
partially evaluated: !arguments.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
813 if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()) {
never evaluated: QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()
0
814 foreach (const QString &argument, arguments) {
never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(arguments)> _container_(arguments); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &argument = *_container_.i;; __extension__ ({--_container_.brk; break;})) {
-
815 const int equalsPos = argument.indexOf(QLatin1Char('='));
never executed (the execution status of this line is deduced): const int equalsPos = argument.indexOf(QLatin1Char('='));
-
816 const QByteArray name =
never executed (the execution status of this line is deduced): const QByteArray name =
-
817 equalsPos != -1 ? argument.left(equalsPos).toUtf8() : argument.toUtf8();
never evaluated: equalsPos != -1
0
818 const QVariant value =
never executed (the execution status of this line is deduced): const QVariant value =
-
819 equalsPos != -1 ? QVariant(argument.mid(equalsPos + 1)) : QVariant(true);
never evaluated: equalsPos != -1
0
820 nativeInterface->setProperty(name.constData(), value);
never executed (the execution status of this line is deduced): nativeInterface->setProperty(name.constData(), value);
-
821 }
never executed: }
0
822 }
never executed: }
0
823 }
never executed: }
0
824#endif -
825 -
826 fontSmoothingGamma = QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal();
executed (the execution status of this line is deduced): fontSmoothingGamma = QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FontSmoothingGamma).toReal();
-
827}
executed: }
Execution Count:276
276
828 -
829static void init_plugins(const QList<QByteArray> &pluginList) -
830{ -
831 for (int i = 0; i < pluginList.count(); ++i) {
evaluated: i < pluginList.count()
TRUEFALSE
yes
Evaluation Count:277
yes
Evaluation Count:276
276-277
832 QByteArray pluginSpec = pluginList.at(i);
executed (the execution status of this line is deduced): QByteArray pluginSpec = pluginList.at(i);
-
833 int colonPos = pluginSpec.indexOf(':');
executed (the execution status of this line is deduced): int colonPos = pluginSpec.indexOf(':');
-
834 QObject *plugin;
executed (the execution status of this line is deduced): QObject *plugin;
-
835 if (colonPos < 0)
partially evaluated: colonPos < 0
TRUEFALSE
yes
Evaluation Count:277
no
Evaluation Count:0
0-277
836 plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString());
executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec), QString());
Execution Count:277
277
837 else -
838 plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)),
never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1)));
0
839 QLatin1String(pluginSpec.mid(colonPos+1)));
never executed: plugin = QGenericPluginFactory::create(QLatin1String(pluginSpec.mid(0, colonPos)), QLatin1String(pluginSpec.mid(colonPos+1)));
0
840 if (plugin)
evaluated: plugin
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:276
1-276
841 QGuiApplicationPrivate::generic_plugin_list.append(plugin);
executed: QGuiApplicationPrivate::generic_plugin_list.append(plugin);
Execution Count:1
1
842 }
executed: }
Execution Count:277
277
843}
executed: }
Execution Count:276
276
844 -
845void QGuiApplicationPrivate::createPlatformIntegration() -
846{ -
847 // Use the Qt menus by default. Platform plugins that -
848 // want to enable a native menu implementation can clear -
849 // this flag. -
850 QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
executed (the execution status of this line is deduced): QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
-
851 -
852 // Load the platform integration -
853 QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
executed (the execution status of this line is deduced): QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
-
854 -
855 // On Mac, look inside the application bundle for the platform plugin. -
856 // TODO (msorvig): Create proper cross-platform solution for loading -
857 // deployed platform plugins -
858#ifdef Q_OS_MAC -
859 const QString bundlePluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/"); -
860 if (platformPluginPath.isEmpty() && QDir(bundlePluginPath).exists()) { -
861 platformPluginPath = bundlePluginPath; -
862 } -
863#endif -
864 -
865 QByteArray platformName;
executed (the execution status of this line is deduced): QByteArray platformName;
-
866#ifdef QT_QPA_DEFAULT_PLATFORM_NAME -
867 platformName = QT_QPA_DEFAULT_PLATFORM_NAME;
executed (the execution status of this line is deduced): platformName = "xcb";
-
868#endif -
869 QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM");
executed (the execution status of this line is deduced): QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM");
-
870 if (!platformNameEnv.isEmpty()) {
partially evaluated: !platformNameEnv.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
871 platformName = platformNameEnv;
never executed (the execution status of this line is deduced): platformName = platformNameEnv;
-
872 }
never executed: }
0
873 -
874 // Get command line params -
875 -
876 int j = argc ? 1 : 0;
evaluated: argc
TRUEFALSE
yes
Evaluation Count:211
yes
Evaluation Count:65
65-211
877 for (int i=1; i<argc; i++) {
evaluated: i<argc
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:276
8-276
878 if (argv[i] && *argv[i] != '-') {
partially evaluated: argv[i]
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
evaluated: *argv[i] != '-'
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:5
0-8
879 argv[j++] = argv[i];
executed (the execution status of this line is deduced): argv[j++] = argv[i];
-
880 continue;
executed: continue;
Execution Count:3
3
881 } -
882 QByteArray arg = argv[i];
executed (the execution status of this line is deduced): QByteArray arg = argv[i];
-
883 if (arg == "-platformpluginpath") {
partially evaluated: arg == "-platformpluginpath"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
884 if (++i < argc)
never evaluated: ++i < argc
0
885 platformPluginPath = QLatin1String(argv[i]);
never executed: platformPluginPath = QLatin1String(argv[i]);
0
886 } else if (arg == "-platform") {
never executed: }
partially evaluated: arg == "-platform"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
887 if (++i < argc)
never evaluated: ++i < argc
0
888 platformName = argv[i];
never executed: platformName = argv[i];
0
889 } else {
never executed: }
0
890 argv[j++] = argv[i];
executed (the execution status of this line is deduced): argv[j++] = argv[i];
-
891 }
executed: }
Execution Count:5
5
892 } -
893 -
894 if (j < argc) {
partially evaluated: j < argc
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
895 argv[j] = 0;
never executed (the execution status of this line is deduced): argv[j] = 0;
-
896 argc = j;
never executed (the execution status of this line is deduced): argc = j;
-
897 }
never executed: }
0
898 -
899 init_platform(QLatin1String(platformName), platformPluginPath);
executed (the execution status of this line is deduced): init_platform(QLatin1String(platformName), platformPluginPath);
-
900 -
901}
executed: }
Execution Count:276
276
902 -
903void QGuiApplicationPrivate::createEventDispatcher() -
904{ -
905 if (platform_integration == 0)
partially evaluated: platform_integration == 0
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
906 createPlatformIntegration();
executed: createPlatformIntegration();
Execution Count:276
276
907 -
908 if (!eventDispatcher) {
partially evaluated: !eventDispatcher
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
909 QAbstractEventDispatcher *eventDispatcher = platform_integration->guiThreadEventDispatcher();
never executed (the execution status of this line is deduced): QAbstractEventDispatcher *eventDispatcher = platform_integration->guiThreadEventDispatcher();
-
910 setEventDispatcher(eventDispatcher);
never executed (the execution status of this line is deduced): setEventDispatcher(eventDispatcher);
-
911 }
never executed: }
0
912}
executed: }
Execution Count:276
276
913 -
914void QGuiApplicationPrivate::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher) -
915{ -
916 Q_Q(QGuiApplication);
executed (the execution status of this line is deduced): QGuiApplication * const q = q_func();
-
917 -
918 if (!QCoreApplicationPrivate::eventDispatcher) {
partially evaluated: !QCoreApplicationPrivate::eventDispatcher
TRUEFALSE
yes
Evaluation Count:276
no
Evaluation Count:0
0-276
919 QCoreApplicationPrivate::eventDispatcher = eventDispatcher;
executed (the execution status of this line is deduced): QCoreApplicationPrivate::eventDispatcher = eventDispatcher;
-
920 QCoreApplicationPrivate::eventDispatcher->setParent(q);
executed (the execution status of this line is deduced): QCoreApplicationPrivate::eventDispatcher->setParent(q);
-
921 threadData->eventDispatcher = eventDispatcher;
executed (the execution status of this line is deduced): threadData->eventDispatcher = eventDispatcher;
-
922 }
executed: }
Execution Count:276
276
923 -
924}
executed: }
Execution Count:276
276
925 -
926#if defined(QT_DEBUG) && defined(Q_OS_LINUX) -
927// Find out if our parent process is gdb by looking at the 'exe' symlink under /proc. -
928static bool runningUnderDebugger() -
929{ -
930 const QFileInfo parentProcExe(QStringLiteral("/proc/") + QString::number(getppid()) + QStringLiteral("/exe")); -
931 return parentProcExe.isSymLink() && parentProcExe.symLinkTarget().endsWith(QStringLiteral("/gdb")); -
932} -
933#endif -
934 -
935void QGuiApplicationPrivate::init() -
936{ -
937 bool doGrabUnderDebugger = false;
executed (the execution status of this line is deduced): bool doGrabUnderDebugger = false;
-
938 QList<QByteArray> pluginList;
executed (the execution status of this line is deduced): QList<QByteArray> pluginList;
-
939 // Get command line params -
940 -
941 int j = argc ? 1 : 0;
evaluated: argc
TRUEFALSE
yes
Evaluation Count:211
yes
Evaluation Count:65
65-211
942 for (int i=1; i<argc; i++) {
evaluated: i<argc
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:276
7-276
943 if (argv[i] && *argv[i] != '-') {
partially evaluated: argv[i]
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
evaluated: *argv[i] != '-'
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:5
0-7
944 argv[j++] = argv[i];
executed (the execution status of this line is deduced): argv[j++] = argv[i];
-
945 continue;
executed: continue;
Execution Count:2
2
946 } -
947 QByteArray arg = argv[i];
executed (the execution status of this line is deduced): QByteArray arg = argv[i];
-
948 if (arg == "-plugin") {
evaluated: arg == "-plugin"
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
1-4
949 if (++i < argc)
partially evaluated: ++i < argc
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
950 pluginList << argv[i];
executed: pluginList << argv[i];
Execution Count:1
1
951 } else if (arg == "-reverse") {
executed: }
Execution Count:1
evaluated: arg == "-reverse"
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
952 force_reverse = true;
executed (the execution status of this line is deduced): force_reverse = true;
-
953 QGuiApplication::setLayoutDirection(Qt::RightToLeft);
executed (the execution status of this line is deduced): QGuiApplication::setLayoutDirection(Qt::RightToLeft);
-
954#ifdef Q_OS_MAC -
955 } else if (arg.startsWith("-psn_")) { -
956 // eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder. -
957 // special hack to change working directory (for an app bundle) when running from finder -
958 if (QDir::currentPath() == QLatin1String("/")) { -
959 QCFType<CFURLRef> bundleURL(CFBundleCopyBundleURL(CFBundleGetMainBundle())); -
960 QString qbundlePath = QCFString(CFURLCopyFileSystemPath(bundleURL, -
961 kCFURLPOSIXPathStyle)); -
962 if (qbundlePath.endsWith(QLatin1String(".app"))) -
963 QDir::setCurrent(qbundlePath.section(QLatin1Char('/'), 0, -2)); -
964 } -
965#endif -
966 } else if (arg == "-nograb") {
executed: }
Execution Count:1
partially evaluated: arg == "-nograb"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
967 QGuiApplicationPrivate::noGrab = true;
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::noGrab = true;
-
968 } else if (arg == "-dograb") {
never executed: }
partially evaluated: arg == "-dograb"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
969 doGrabUnderDebugger = true;
never executed (the execution status of this line is deduced): doGrabUnderDebugger = true;
-
970#ifndef QT_NO_SESSIONMANAGER -
971 } else if (arg == "-session" && i < argc-1) {
never executed: }
partially evaluated: arg == "-session"
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
never evaluated: i < argc-1
0-3
972 ++i;
never executed (the execution status of this line is deduced): ++i;
-
973 if (argv[i] && *argv[i]) {
never evaluated: argv[i]
never evaluated: *argv[i]
0
974 session_id = QString::fromLatin1(argv[i]);
never executed (the execution status of this line is deduced): session_id = QString::fromLatin1(argv[i]);
-
975 int p = session_id.indexOf(QLatin1Char('_'));
never executed (the execution status of this line is deduced): int p = session_id.indexOf(QLatin1Char('_'));
-
976 if (p >= 0) {
never evaluated: p >= 0
0
977 session_key = session_id.mid(p +1);
never executed (the execution status of this line is deduced): session_key = session_id.mid(p +1);
-
978 session_id = session_id.left(p);
never executed (the execution status of this line is deduced): session_id = session_id.left(p);
-
979 }
never executed: }
0
980 is_session_restored = true;
never executed (the execution status of this line is deduced): is_session_restored = true;
-
981 }
never executed: }
0
982#endif -
983 } else {
never executed: }
0
984 argv[j++] = argv[i];
executed (the execution status of this line is deduced): argv[j++] = argv[i];
-
985 }
executed: }
Execution Count:3
3
986 } -
987 -
988 if (j < argc) {
evaluated: j < argc
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:274
2-274
989 argv[j] = 0;
executed (the execution status of this line is deduced): argv[j] = 0;
-
990 argc = j;
executed (the execution status of this line is deduced): argc = j;
-
991 }
executed: }
Execution Count:2
2
992 -
993#if defined(QT_DEBUG) && defined(Q_OS_LINUX) -
994 if (!doGrabUnderDebugger && !QGuiApplicationPrivate::noGrab && runningUnderDebugger()) { -
995 QGuiApplicationPrivate::noGrab = true; -
996 qDebug("Qt: gdb: -nograb added to command-line options.\n" -
997 "\t Use the -dograb option to enforce grabbing."); -
998 } -
999#else -
1000 Q_UNUSED(doGrabUnderDebugger)
executed (the execution status of this line is deduced): (void)doGrabUnderDebugger;
-
1001#endif -
1002 -
1003 // Load environment exported generic plugins -
1004 foreach (const QByteArray &plugin, qgetenv("QT_QPA_GENERIC_PLUGINS").split(','))
executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(qgetenv("QT_QPA_GENERIC_PLUGINS").split(','))> _container_(qgetenv("QT_QPA_GENERIC_PLUGINS").split(',')); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QByteArray &plugin = *_container_.i;; __extension__ ({--_container_.brk; break;}))
-
1005 pluginList << plugin;
executed: pluginList << plugin;
Execution Count:276
276
1006 -
1007 if (platform_integration == 0)
partially evaluated: platform_integration == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:276
0-276
1008 createPlatformIntegration();
never executed: createPlatformIntegration();
0
1009 -
1010 // Set up which span functions should be used in raster engine... -
1011 qInitDrawhelperAsm();
executed (the execution status of this line is deduced): qInitDrawhelperAsm();
-
1012 // and QImage conversion functions -
1013 qInitImageConversions();
executed (the execution status of this line is deduced): qInitImageConversions();
-
1014 -
1015 QFont::initialize();
executed (the execution status of this line is deduced): QFont::initialize();
-
1016 -
1017#ifndef QT_NO_CURSOR -
1018 QCursorData::initialize();
executed (the execution status of this line is deduced): QCursorData::initialize();
-
1019#endif -
1020 -
1021 // trigger registering of QVariant's GUI types -
1022 qRegisterGuiVariant();
executed (the execution status of this line is deduced): qRegisterGuiVariant();
-
1023 -
1024 QWindowSystemInterfacePrivate::eventTime.start();
executed (the execution status of this line is deduced): QWindowSystemInterfacePrivate::eventTime.start();
-
1025 -
1026 is_app_running = true;
executed (the execution status of this line is deduced): is_app_running = true;
-
1027 init_plugins(pluginList);
executed (the execution status of this line is deduced): init_plugins(pluginList);
-
1028 QWindowSystemInterface::flushWindowSystemEvents();
executed (the execution status of this line is deduced): QWindowSystemInterface::flushWindowSystemEvents();
-
1029 -
1030 Q_Q(QGuiApplication);
executed (the execution status of this line is deduced): QGuiApplication * const q = q_func();
-
1031 -
1032#ifndef QT_NO_SESSIONMANAGER -
1033 // connect to the session manager -
1034 session_manager = new QSessionManager(q, session_id, session_key);
executed (the execution status of this line is deduced): session_manager = new QSessionManager(q, session_id, session_key);
-
1035#endif -
1036 -
1037}
executed: }
Execution Count:276
276
1038 -
1039extern void qt_cleanupFontDatabase(); -
1040 -
1041QGuiApplicationPrivate::~QGuiApplicationPrivate() -
1042{ -
1043 is_app_closing = true;
executed (the execution status of this line is deduced): is_app_closing = true;
-
1044 is_app_running = false;
executed (the execution status of this line is deduced): is_app_running = false;
-
1045 -
1046 for (int i = 0; i < generic_plugin_list.count(); ++i)
evaluated: i < generic_plugin_list.count()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:258
1-258
1047 delete generic_plugin_list.at(i);
executed: delete generic_plugin_list.at(i);
Execution Count:1
1
1048 generic_plugin_list.clear();
executed (the execution status of this line is deduced): generic_plugin_list.clear();
-
1049 -
1050 clearFontUnlocked();
executed (the execution status of this line is deduced): clearFontUnlocked();
-
1051 -
1052 QFont::cleanup();
executed (the execution status of this line is deduced): QFont::cleanup();
-
1053 -
1054#ifndef QT_NO_CURSOR -
1055 QCursorData::cleanup();
executed (the execution status of this line is deduced): QCursorData::cleanup();
-
1056#endif -
1057 -
1058 layout_direction = Qt::LeftToRight;
executed (the execution status of this line is deduced): layout_direction = Qt::LeftToRight;
-
1059 -
1060 cleanupThreadData();
executed (the execution status of this line is deduced): cleanupThreadData();
-
1061 -
1062 delete styleHints;
executed (the execution status of this line is deduced): delete styleHints;
-
1063 delete inputMethod;
executed (the execution status of this line is deduced): delete inputMethod;
-
1064 -
1065 qt_cleanupFontDatabase();
executed (the execution status of this line is deduced): qt_cleanupFontDatabase();
-
1066 -
1067 QPixmapCache::clear();
executed (the execution status of this line is deduced): QPixmapCache::clear();
-
1068 -
1069 delete platform_theme;
executed (the execution status of this line is deduced): delete platform_theme;
-
1070 platform_theme = 0;
executed (the execution status of this line is deduced): platform_theme = 0;
-
1071 delete platform_integration;
executed (the execution status of this line is deduced): delete platform_integration;
-
1072 platform_integration = 0;
executed (the execution status of this line is deduced): platform_integration = 0;
-
1073 delete m_gammaTables.load();
executed (the execution status of this line is deduced): delete m_gammaTables.load();
-
1074}
executed: }
Execution Count:258
258
1075 -
1076#if 0 -
1077#ifndef QT_NO_CURSOR -
1078QCursor *overrideCursor(); -
1079void setOverrideCursor(const QCursor &); -
1080void changeOverrideCursor(const QCursor &); -
1081void restoreOverrideCursor(); -
1082#endif -
1083 -
1084static QFont font(); -
1085static QFont font(const QWidget*); -
1086static QFont font(const char *className); -
1087static void setFont(const QFont &, const char* className = 0); -
1088static QFontMetrics fontMetrics(); -
1089 -
1090#ifndef QT_NO_CLIPBOARD -
1091static QClipboard *clipboard(); -
1092#endif -
1093#endif -
1094 -
1095/*! -
1096 Returns the current state of the modifier keys on the keyboard. The current -
1097 state is updated sychronously as the event queue is emptied of events that -
1098 will spontaneously change the keyboard state (QEvent::KeyPress and -
1099 QEvent::KeyRelease events). -
1100 -
1101 It should be noted this may not reflect the actual keys held on the input -
1102 device at the time of calling but rather the modifiers as last reported in -
1103 one of the above events. If no keys are being held Qt::NoModifier is -
1104 returned. -
1105 -
1106 \sa mouseButtons(), queryKeyboardModifiers() -
1107*/ -
1108Qt::KeyboardModifiers QGuiApplication::keyboardModifiers() -
1109{ -
1110 return QGuiApplicationPrivate::modifier_buttons;
executed: return QGuiApplicationPrivate::modifier_buttons;
Execution Count:536
536
1111} -
1112 -
1113/*! -
1114 \fn Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers() -
1115 -
1116 Queries and returns the state of the modifier keys on the keyboard. -
1117 Unlike keyboardModifiers, this method returns the actual keys held -
1118 on the input device at the time of calling the method. -
1119 -
1120 It does not rely on the keypress events having been received by this -
1121 process, which makes it possible to check the modifiers while moving -
1122 a window, for instance. Note that in most cases, you should use -
1123 keyboardModifiers(), which is faster and more accurate since it contains -
1124 the state of the modifiers as they were when the currently processed -
1125 event was received. -
1126 -
1127 \sa keyboardModifiers() -
1128*/ -
1129Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers() -
1130{ -
1131 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
never executed (the execution status of this line is deduced): QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
-
1132 return pi->queryKeyboardModifiers();
never executed: return pi->queryKeyboardModifiers();
0
1133} -
1134 -
1135/*! -
1136 Returns the current state of the buttons on the mouse. The current state is -
1137 updated syncronously as the event queue is emptied of events that will -
1138 spontaneously change the mouse state (QEvent::MouseButtonPress and -
1139 QEvent::MouseButtonRelease events). -
1140 -
1141 It should be noted this may not reflect the actual buttons held on the -
1142 input device at the time of calling but rather the mouse buttons as last -
1143 reported in one of the above events. If no mouse buttons are being held -
1144 Qt::NoButton is returned. -
1145 -
1146 \sa keyboardModifiers() -
1147*/ -
1148Qt::MouseButtons QGuiApplication::mouseButtons() -
1149{ -
1150 return QGuiApplicationPrivate::mouse_buttons;
never executed: return QGuiApplicationPrivate::mouse_buttons;
0
1151} -
1152 -
1153/*! -
1154 Returns the platform's native interface, for platform specific -
1155 functionality. -
1156*/ -
1157QPlatformNativeInterface *QGuiApplication::platformNativeInterface() -
1158{ -
1159 QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
executed (the execution status of this line is deduced): QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
-
1160 return pi ? pi->nativeInterface() : 0;
executed: return pi ? pi->nativeInterface() : 0;
Execution Count:1
1
1161} -
1162 -
1163/*! -
1164 Enters the main event loop and waits until exit() is called, and then -
1165 returns the value that was set to exit() (which is 0 if exit() is called -
1166 via quit()). -
1167 -
1168 It is necessary to call this function to start event handling. The main -
1169 event loop receives events from the window system and dispatches these to -
1170 the application widgets. -
1171 -
1172 Generally, no user interaction can take place before calling exec(). -
1173 -
1174 To make your application perform idle processing, e.g., executing a special -
1175 function whenever there are no pending events, use a QTimer with 0 timeout. -
1176 More advanced idle processing schemes can be achieved using processEvents(). -
1177 -
1178 We recommend that you connect clean-up code to the -
1179 \l{QCoreApplication::}{aboutToQuit()} signal, instead of putting it in your -
1180 application's \c{main()} function. This is because, on some platforms, the -
1181 QApplication::exec() call may not return. -
1182 -
1183 \sa quitOnLastWindowClosed, quit(), exit(), processEvents(), -
1184 QCoreApplication::exec() -
1185*/ -
1186int QGuiApplication::exec() -
1187{ -
1188#ifndef QT_NO_ACCESSIBILITY -
1189 QAccessible::setRootObject(qApp);
executed (the execution status of this line is deduced): QAccessible::setRootObject((static_cast<QGuiApplication *>(QCoreApplication::instance())));
-
1190#endif -
1191 return QCoreApplication::exec();
executed: return QCoreApplication::exec();
Execution Count:39
39
1192} -
1193 -
1194/*! \reimp -
1195*/ -
1196bool QGuiApplication::notify(QObject *object, QEvent *event) -
1197{ -
1198#ifndef QT_NO_SHORTCUT -
1199 if (event->type() == QEvent::KeyPress) {
evaluated: event->type() == QEvent::KeyPress
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:103939
7-103939
1200 // Try looking for a Shortcut before sending key events -
1201 QWindow *w = qobject_cast<QWindow *>(object);
executed (the execution status of this line is deduced): QWindow *w = qobject_cast<QWindow *>(object);
-
1202 QObject *focus = w ? w->focusObject() : 0;
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:7
no
Evaluation Count:0
0-7
1203 if (!focus)
partially evaluated: !focus
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1204 focus = object;
never executed: focus = object;
0
1205 if (QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, static_cast<QKeyEvent *>(event)))
partially evaluated: QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(focus, static_cast<QKeyEvent *>(event))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1206 return true;
never executed: return true;
0
1207 }
executed: }
Execution Count:7
7
1208#endif -
1209 -
1210 if (object->isWindowType())
evaluated: object->isWindowType()
TRUEFALSE
yes
Evaluation Count:640
yes
Evaluation Count:103306
640-103306
1211 QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
executed: QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(object), event);
Execution Count:640
640
1212 return QCoreApplication::notify(object, event);
executed: return QCoreApplication::notify(object, event);
Execution Count:103946
103946
1213} -
1214 -
1215/*! \reimp -
1216*/ -
1217bool QGuiApplication::event(QEvent *e) -
1218{ -
1219 if(e->type() == QEvent::LanguageChange) {
evaluated: e->type() == QEvent::LanguageChange
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:1704
52-1704
1220 setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
executed (the execution status of this line is deduced): setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
-
1221 }
executed: }
Execution Count:52
52
1222 return QCoreApplication::event(e);
executed: return QCoreApplication::event(e);
Execution Count:1756
1756
1223} -
1224 -
1225/*! -
1226 \internal -
1227*/ -
1228bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) -
1229{ -
1230 return QCoreApplication::compressEvent(event, receiver, postedEvents);
executed: return QCoreApplication::compressEvent(event, receiver, postedEvents);
Execution Count:12256
12256
1231} -
1232 -
1233void QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event) -
1234{ -
1235 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12941
0-12941
1236 return;
never executed: return;
0
1237 QPlatformWindow *platformWindow = window->handle();
executed (the execution status of this line is deduced): QPlatformWindow *platformWindow = window->handle();
-
1238 if (!platformWindow)
evaluated: !platformWindow
TRUEFALSE
yes
Evaluation Count:223
yes
Evaluation Count:12718
223-12718
1239 return;
executed: return;
Execution Count:223
223
1240 // spontaneous events come from the platform integration already, we don't need to send the events back -
1241 if (event->spontaneous())
evaluated: event->spontaneous()
TRUEFALSE
yes
Evaluation Count:7113
yes
Evaluation Count:5605
5605-7113
1242 return;
executed: return;
Execution Count:7113
7113
1243 // let the platform window do any handling it needs to as well -
1244 platformWindow->windowEvent(event);
executed (the execution status of this line is deduced): platformWindow->windowEvent(event);
-
1245}
executed: }
Execution Count:5605
5605
1246 -
1247bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) -
1248{ -
1249 return window->nativeEvent(eventType, message, result);
executed: return window->nativeEvent(eventType, message, result);
Execution Count:40010
40010
1250} -
1251 -
1252void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e) -
1253{ -
1254 switch(e->type) { -
1255 case QWindowSystemInterfacePrivate::FrameStrutMouse: -
1256 case QWindowSystemInterfacePrivate::Mouse: -
1257 QGuiApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e));
-
1258 break;
executed: break;
Execution Count:238
238
1259 case QWindowSystemInterfacePrivate::Wheel: -
1260 QGuiApplicationPrivate::processWheelEvent(static_cast<QWindowSystemInterfacePrivate::WheelEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processWheelEvent(static_cast<QWindowSystemInterfacePrivate::WheelEvent *>(e));
-
1261 break;
executed: break;
Execution Count:3
3
1262 case QWindowSystemInterfacePrivate::Key: -
1263 QGuiApplicationPrivate::processKeyEvent(static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processKeyEvent(static_cast<QWindowSystemInterfacePrivate::KeyEvent *>(e));
-
1264 break;
executed: break;
Execution Count:62
62
1265 case QWindowSystemInterfacePrivate::Touch: -
1266 QGuiApplicationPrivate::processTouchEvent(static_cast<QWindowSystemInterfacePrivate::TouchEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processTouchEvent(static_cast<QWindowSystemInterfacePrivate::TouchEvent *>(e));
-
1267 break;
executed: break;
Execution Count:24
24
1268 case QWindowSystemInterfacePrivate::GeometryChange: -
1269 QGuiApplicationPrivate::processGeometryChangeEvent(static_cast<QWindowSystemInterfacePrivate::GeometryChangeEvent*>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processGeometryChangeEvent(static_cast<QWindowSystemInterfacePrivate::GeometryChangeEvent*>(e));
-
1270 break;
executed: break;
Execution Count:1039
1039
1271 case QWindowSystemInterfacePrivate::Enter: -
1272 QGuiApplicationPrivate::processEnterEvent(static_cast<QWindowSystemInterfacePrivate::EnterEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processEnterEvent(static_cast<QWindowSystemInterfacePrivate::EnterEvent *>(e));
-
1273 break;
executed: break;
Execution Count:748
748
1274 case QWindowSystemInterfacePrivate::Leave: -
1275 QGuiApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processLeaveEvent(static_cast<QWindowSystemInterfacePrivate::LeaveEvent *>(e));
-
1276 break;
executed: break;
Execution Count:547
547
1277 case QWindowSystemInterfacePrivate::ActivatedWindow: -
1278 QGuiApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processActivatedEvent(static_cast<QWindowSystemInterfacePrivate::ActivatedWindowEvent *>(e));
-
1279 break;
executed: break;
Execution Count:1040
1040
1280 case QWindowSystemInterfacePrivate::WindowStateChanged: -
1281 QGuiApplicationPrivate::processWindowStateChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowStateChangedEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processWindowStateChangedEvent(static_cast<QWindowSystemInterfacePrivate::WindowStateChangedEvent *>(e));
-
1282 break;
executed: break;
Execution Count:736
736
1283 case QWindowSystemInterfacePrivate::Close: -
1284 QGuiApplicationPrivate::processCloseEvent(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::processCloseEvent(
-
1285 static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::CloseEvent *>(e));
-
1286 break;
never executed: break;
0
1287 case QWindowSystemInterfacePrivate::ScreenOrientation: -
1288 QGuiApplicationPrivate::reportScreenOrientationChange(
executed (the execution status of this line is deduced): QGuiApplicationPrivate::reportScreenOrientationChange(
-
1289 static_cast<QWindowSystemInterfacePrivate::ScreenOrientationEvent *>(e));
executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ScreenOrientationEvent *>(e));
-
1290 break;
executed: break;
Execution Count:7
7
1291 case QWindowSystemInterfacePrivate::ScreenGeometry: -
1292 QGuiApplicationPrivate::reportGeometryChange(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::reportGeometryChange(
-
1293 static_cast<QWindowSystemInterfacePrivate::ScreenGeometryEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ScreenGeometryEvent *>(e));
-
1294 break;
never executed: break;
0
1295 case QWindowSystemInterfacePrivate::ScreenAvailableGeometry: -
1296 QGuiApplicationPrivate::reportAvailableGeometryChange(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::reportAvailableGeometryChange(
-
1297 static_cast<QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *>(e));
-
1298 break;
never executed: break;
0
1299 case QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInch: -
1300 QGuiApplicationPrivate::reportLogicalDotsPerInchChange(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::reportLogicalDotsPerInchChange(
-
1301 static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e));
-
1302 break;
never executed: break;
0
1303 case QWindowSystemInterfacePrivate::ScreenRefreshRate: -
1304 QGuiApplicationPrivate::reportRefreshRateChange(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::reportRefreshRateChange(
-
1305 static_cast<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *>(e));
-
1306 break;
never executed: break;
0
1307 case QWindowSystemInterfacePrivate::ThemeChange: -
1308 QGuiApplicationPrivate::processThemeChanged(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::processThemeChanged(
-
1309 static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e));
-
1310 break;
never executed: break;
0
1311 case QWindowSystemInterfacePrivate::Expose: -
1312 QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e));
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processExposeEvent(static_cast<QWindowSystemInterfacePrivate::ExposeEvent *>(e));
-
1313 break;
executed: break;
Execution Count:1873
1873
1314 case QWindowSystemInterfacePrivate::Tablet: -
1315 QGuiApplicationPrivate::processTabletEvent(
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processTabletEvent(
-
1316 static_cast<QWindowSystemInterfacePrivate::TabletEvent *>(e));
executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::TabletEvent *>(e));
-
1317 break;
executed: break;
Execution Count:2
2
1318 case QWindowSystemInterfacePrivate::TabletEnterProximity: -
1319 QGuiApplicationPrivate::processTabletEnterProximityEvent(
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processTabletEnterProximityEvent(
-
1320 static_cast<QWindowSystemInterfacePrivate::TabletEnterProximityEvent *>(e));
executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::TabletEnterProximityEvent *>(e));
-
1321 break;
executed: break;
Execution Count:1
1
1322 case QWindowSystemInterfacePrivate::TabletLeaveProximity: -
1323 QGuiApplicationPrivate::processTabletLeaveProximityEvent(
executed (the execution status of this line is deduced): QGuiApplicationPrivate::processTabletLeaveProximityEvent(
-
1324 static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e));
executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e));
-
1325 break;
executed: break;
Execution Count:1
1
1326 case QWindowSystemInterfacePrivate::PlatformPanel: -
1327 QGuiApplicationPrivate::processPlatformPanelEvent(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::processPlatformPanelEvent(
-
1328 static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));
-
1329 break;
never executed: break;
0
1330 case QWindowSystemInterfacePrivate::FileOpen: -
1331 QGuiApplicationPrivate::processFileOpenEvent(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::processFileOpenEvent(
-
1332 static_cast<QWindowSystemInterfacePrivate::FileOpenEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::FileOpenEvent *>(e));
-
1333 break;
never executed: break;
0
1334#ifndef QT_NO_CONTEXTMENU -
1335 case QWindowSystemInterfacePrivate::ContextMenu: -
1336 QGuiApplicationPrivate::processContextMenuEvent(
never executed (the execution status of this line is deduced): QGuiApplicationPrivate::processContextMenuEvent(
-
1337 static_cast<QWindowSystemInterfacePrivate::ContextMenuEvent *>(e));
never executed (the execution status of this line is deduced): static_cast<QWindowSystemInterfacePrivate::ContextMenuEvent *>(e));
-
1338 break;
never executed: break;
0
1339#endif -
1340 default: -
1341 qWarning() << "Unknown user input event type:" << e->type;
never executed (the execution status of this line is deduced): QMessageLogger("kernel/qguiapplication.cpp", 1341, __PRETTY_FUNCTION__).warning() << "Unknown user input event type:" << e->type;
-
1342 break;
never executed: break;
0
1343 } -
1344}
executed: }
Execution Count:6321
6321
1345 -
1346void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e) -
1347{ -
1348 QEvent::Type type;
executed (the execution status of this line is deduced): QEvent::Type type;
-
1349 // move first -
1350 Qt::MouseButtons stateChange = e->buttons ^ buttons;
executed (the execution status of this line is deduced): Qt::MouseButtons stateChange = e->buttons ^ buttons;
-
1351 const bool frameStrut = e->type == QWindowSystemInterfacePrivate::FrameStrutMouse;
executed (the execution status of this line is deduced): const bool frameStrut = e->type == QWindowSystemInterfacePrivate::FrameStrutMouse;
-
1352 if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition && (stateChange != Qt::NoButton)) {
evaluated: e->globalPos != QGuiApplicationPrivate::lastCursorPosition
TRUEFALSE
yes
Evaluation Count:123
yes
Evaluation Count:120
evaluated: (stateChange != Qt::NoButton)
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:115
8-123
1353 QWindowSystemInterfacePrivate::MouseEvent * newMouseEvent =
executed (the execution status of this line is deduced): QWindowSystemInterfacePrivate::MouseEvent * newMouseEvent =
-
1354 new QWindowSystemInterfacePrivate::MouseEvent(e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers);
executed (the execution status of this line is deduced): new QWindowSystemInterfacePrivate::MouseEvent(e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers);
-
1355 QWindowSystemInterfacePrivate::windowSystemEventQueue.prepend(newMouseEvent); // just in case the move triggers a new event loop
executed (the execution status of this line is deduced): QWindowSystemInterfacePrivate::windowSystemEventQueue.prepend(newMouseEvent);
-
1356 stateChange = Qt::NoButton;
executed (the execution status of this line is deduced): stateChange = Qt::NoButton;
-
1357 }
executed: }
Execution Count:8
8
1358 -
1359 QWindow *window = e->window.data();
executed (the execution status of this line is deduced): QWindow *window = e->window.data();
-
1360 modifier_buttons = e->modifiers;
executed (the execution status of this line is deduced): modifier_buttons = e->modifiers;
-
1361 -
1362 QPointF localPoint = e->localPos;
executed (the execution status of this line is deduced): QPointF localPoint = e->localPos;
-
1363 QPointF globalPoint = e->globalPos;
executed (the execution status of this line is deduced): QPointF globalPoint = e->globalPos;
-
1364 -
1365 if (e->nullWindow) {
evaluated: e->nullWindow
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:237
6-237
1366 window = QGuiApplication::topLevelAt(globalPoint.toPoint());
executed (the execution status of this line is deduced): window = QGuiApplication::topLevelAt(globalPoint.toPoint());
-
1367 if (window) {
evaluated: window
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1368 QPointF delta = globalPoint - globalPoint.toPoint();
executed (the execution status of this line is deduced): QPointF delta = globalPoint - globalPoint.toPoint();
-
1369 localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta;
executed (the execution status of this line is deduced): localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta;
-
1370 }
executed: }
Execution Count:3
3
1371 }
executed: }
Execution Count:6
6
1372 -
1373 Qt::MouseButton button = Qt::NoButton;
executed (the execution status of this line is deduced): Qt::MouseButton button = Qt::NoButton;
-
1374 bool doubleClick = false;
executed (the execution status of this line is deduced): bool doubleClick = false;
-
1375 -
1376 if (QGuiApplicationPrivate::lastCursorPosition != globalPoint) {
evaluated: QGuiApplicationPrivate::lastCursorPosition != globalPoint
TRUEFALSE
yes
Evaluation Count:123
yes
Evaluation Count:120
120-123
1377 type = frameStrut ? QEvent::NonClientAreaMouseMove : QEvent::MouseMove;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
1378 QGuiApplicationPrivate::lastCursorPosition = globalPoint;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::lastCursorPosition = globalPoint;
-
1379 if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance||
evaluated: qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance
TRUEFALSE
yes
Evaluation Count:121
yes
Evaluation Count:2
2-121
1380 qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance)
evaluated: qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1381 mousePressButton = Qt::NoButton;
executed: mousePressButton = Qt::NoButton;
Execution Count:122
122
1382 } else { // Check to see if a new button has been pressed/released.
executed: }
Execution Count:123
123
1383 for (int check = Qt::LeftButton;
executed (the execution status of this line is deduced): for (int check = Qt::LeftButton;
-
1384 check <= int(Qt::MaxMouseButton);
partially evaluated: check <= int(Qt::MaxMouseButton)
TRUEFALSE
yes
Evaluation Count:182
no
Evaluation Count:0
0-182
1385 check = check << 1) {
executed (the execution status of this line is deduced): check = check << 1) {
-
1386 if (check & stateChange) {
evaluated: check & stateChange
TRUEFALSE
yes
Evaluation Count:120
yes
Evaluation Count:62
62-120
1387 button = Qt::MouseButton(check);
executed (the execution status of this line is deduced): button = Qt::MouseButton(check);
-
1388 break;
executed: break;
Execution Count:120
120
1389 } -
1390 }
executed: }
Execution Count:62
62
1391 if (button == Qt::NoButton) {
partially evaluated: button == Qt::NoButton
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:120
0-120
1392 // Ignore mouse events that don't change the current state. -
1393 return;
never executed: return;
0
1394 } -
1395 mouse_buttons = buttons = e->buttons;
executed (the execution status of this line is deduced): mouse_buttons = buttons = e->buttons;
-
1396 if (button & e->buttons) {
evaluated: button & e->buttons
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:60
60
1397 ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval());
executed (the execution status of this line is deduced): ulong doubleClickInterval = static_cast<ulong>((static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints()->mouseDoubleClickInterval());
-
1398 doubleClick = e->timestamp - mousePressTime < doubleClickInterval && button == mousePressButton;
evaluated: e->timestamp - mousePressTime < doubleClickInterval
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:10
evaluated: button == mousePressButton
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:31
10-50
1399 type = frameStrut ? QEvent::NonClientAreaMouseButtonPress : QEvent::MouseButtonPress;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1400 mousePressTime = e->timestamp;
executed (the execution status of this line is deduced): mousePressTime = e->timestamp;
-
1401 mousePressButton = button;
executed (the execution status of this line is deduced): mousePressButton = button;
-
1402 const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint();
executed (the execution status of this line is deduced): const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint();
-
1403 mousePressX = point.x();
executed (the execution status of this line is deduced): mousePressX = point.x();
-
1404 mousePressY = point.y();
executed (the execution status of this line is deduced): mousePressY = point.y();
-
1405 } else {
executed: }
Execution Count:60
60
1406 type = frameStrut ? QEvent::NonClientAreaMouseButtonRelease : QEvent::MouseButtonRelease;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:60
0-60
1407 }
executed: }
Execution Count:60
60
1408 } -
1409 -
1410 if (!window)
evaluated: !window
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:240
3-240
1411 return;
executed: return;
Execution Count:3
3
1412 -
1413 if (window->d_func()->blockedByModalWindow) {
evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:237
3-237
1414 // a modal window is blocking this window, don't allow mouse events through -
1415 return;
executed: return;
Execution Count:3
3
1416 } -
1417 -
1418 QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers);
executed (the execution status of this line is deduced): QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers);
-
1419 ev.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): ev.setTimestamp(e->timestamp);
-
1420#ifndef QT_NO_CURSOR -
1421 if (const QScreen *screen = window->screen())
partially evaluated: const QScreen *screen = window->screen()
TRUEFALSE
yes
Evaluation Count:237
no
Evaluation Count:0
0-237
1422 if (QPlatformCursor *cursor = screen->handle()->cursor())
partially evaluated: QPlatformCursor *cursor = screen->handle()->cursor()
TRUEFALSE
yes
Evaluation Count:237
no
Evaluation Count:0
0-237
1423 cursor->pointerEvent(ev);
executed: cursor->pointerEvent(ev);
Execution Count:237
237
1424#endif -
1425 QGuiApplication::sendSpontaneousEvent(window, &ev);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &ev);
-
1426 if (!e->synthetic && !ev.isAccepted()
evaluated: !e->synthetic
TRUEFALSE
yes
Evaluation Count:232
yes
Evaluation Count:5
evaluated: !ev.isAccepted()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:221
5-232
1427 && !frameStrut
partially evaluated: !frameStrut
TRUEFALSE
yes
Evaluation Count:11
no
Evaluation Count:0
0-11
1428 && qApp->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)) {
evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:6
5-6
1429 if (!m_fakeTouchDevice) {
evaluated: !m_fakeTouchDevice
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4
1-4
1430 m_fakeTouchDevice = new QTouchDevice;
executed (the execution status of this line is deduced): m_fakeTouchDevice = new QTouchDevice;
-
1431 QWindowSystemInterface::registerTouchDevice(m_fakeTouchDevice);
executed (the execution status of this line is deduced): QWindowSystemInterface::registerTouchDevice(m_fakeTouchDevice);
-
1432 }
executed: }
Execution Count:1
1
1433 QList<QWindowSystemInterface::TouchPoint> points;
executed (the execution status of this line is deduced): QList<QWindowSystemInterface::TouchPoint> points;
-
1434 QWindowSystemInterface::TouchPoint point;
executed (the execution status of this line is deduced): QWindowSystemInterface::TouchPoint point;
-
1435 point.id = 1;
executed (the execution status of this line is deduced): point.id = 1;
-
1436 point.area = QRectF(globalPoint.x() - 2, globalPoint.y() - 2, 4, 4);
executed (the execution status of this line is deduced): point.area = QRectF(globalPoint.x() - 2, globalPoint.y() - 2, 4, 4);
-
1437 -
1438 // only translate left button related events to -
1439 // avoid strange touch event sequences when several -
1440 // buttons are pressed -
1441 if (type == QEvent::MouseButtonPress && button == Qt::LeftButton) {
evaluated: type == QEvent::MouseButtonPress
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
partially evaluated: button == Qt::LeftButton
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-3
1442 point.state = Qt::TouchPointPressed;
executed (the execution status of this line is deduced): point.state = Qt::TouchPointPressed;
-
1443 } else if (type == QEvent::MouseButtonRelease && button == Qt::LeftButton) {
executed: }
Execution Count:2
evaluated: type == QEvent::MouseButtonRelease
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1
partially evaluated: button == Qt::LeftButton
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1444 point.state = Qt::TouchPointReleased;
executed (the execution status of this line is deduced): point.state = Qt::TouchPointReleased;
-
1445 } else if (type == QEvent::MouseMove && (buttons & Qt::LeftButton)) {
executed: }
Execution Count:2
partially evaluated: type == QEvent::MouseMove
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
partially evaluated: (buttons & Qt::LeftButton)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-2
1446 point.state = Qt::TouchPointMoved;
never executed (the execution status of this line is deduced): point.state = Qt::TouchPointMoved;
-
1447 } else {
never executed: }
0
1448 return;
executed: return;
Execution Count:1
1
1449 } -
1450 -
1451 points << point;
executed (the execution status of this line is deduced): points << point;
-
1452 -
1453 QEvent::Type type;
executed (the execution status of this line is deduced): QEvent::Type type;
-
1454 QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::convertTouchPoints(points, &type);
executed (the execution status of this line is deduced): QList<QTouchEvent::TouchPoint> touchPoints = QWindowSystemInterfacePrivate::convertTouchPoints(points, &type);
-
1455 -
1456 QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers);
executed (the execution status of this line is deduced): QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers);
-
1457 fake.synthetic = true;
executed (the execution status of this line is deduced): fake.synthetic = true;
-
1458 processTouchEvent(&fake);
executed (the execution status of this line is deduced): processTouchEvent(&fake);
-
1459 }
executed: }
Execution Count:4
4
1460 if (doubleClick) {
evaluated: doubleClick
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:217
19-217
1461 mousePressButton = Qt::NoButton;
executed (the execution status of this line is deduced): mousePressButton = Qt::NoButton;
-
1462 const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
partially evaluated: frameStrut
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
1463 QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
executed (the execution status of this line is deduced): QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
-
1464 button, buttons, e->modifiers);
executed (the execution status of this line is deduced): button, buttons, e->modifiers);
-
1465 dblClickEvent.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): dblClickEvent.setTimestamp(e->timestamp);
-
1466 QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent);
-
1467 }
executed: }
Execution Count:19
19
1468}
executed: }
Execution Count:236
236
1469 -
1470void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent *e) -
1471{ -
1472#ifndef QT_NO_WHEELEVENT -
1473 QWindow *window = e->window.data();
executed (the execution status of this line is deduced): QWindow *window = e->window.data();
-
1474 QPointF globalPoint = e->globalPos;
executed (the execution status of this line is deduced): QPointF globalPoint = e->globalPos;
-
1475 QPointF localPoint = e->localPos;
executed (the execution status of this line is deduced): QPointF localPoint = e->localPos;
-
1476 -
1477 if (e->nullWindow) {
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1478 window = QGuiApplication::topLevelAt(globalPoint.toPoint());
never executed (the execution status of this line is deduced): window = QGuiApplication::topLevelAt(globalPoint.toPoint());
-
1479 if (window) {
never evaluated: window
0
1480 QPointF delta = globalPoint - globalPoint.toPoint();
never executed (the execution status of this line is deduced): QPointF delta = globalPoint - globalPoint.toPoint();
-
1481 localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta;
never executed (the execution status of this line is deduced): localPoint = window->mapFromGlobal(globalPoint.toPoint()) + delta;
-
1482 }
never executed: }
0
1483 }
never executed: }
0
1484 -
1485 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1486 return;
never executed: return;
0
1487 -
1488 QGuiApplicationPrivate::lastCursorPosition = globalPoint;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::lastCursorPosition = globalPoint;
-
1489 modifier_buttons = e->modifiers;
executed (the execution status of this line is deduced): modifier_buttons = e->modifiers;
-
1490 -
1491 if (window->d_func()->blockedByModalWindow) {
partially evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
1492 // a modal window is blocking this window, don't allow wheel events through -
1493 return;
never executed: return;
0
1494 } -
1495 -
1496 QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers);
executed (the execution status of this line is deduced): QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers);
-
1497 ev.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): ev.setTimestamp(e->timestamp);
-
1498 QGuiApplication::sendSpontaneousEvent(window, &ev);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &ev);
-
1499#endif /* ifndef QT_NO_WHEELEVENT */ -
1500}
executed: }
Execution Count:3
3
1501 -
1502// Remember, Qt convention is: keyboard state is state *before* -
1503 -
1504void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e) -
1505{ -
1506 QWindow *window = e->window.data();
executed (the execution status of this line is deduced): QWindow *window = e->window.data();
-
1507 modifier_buttons = e->modifiers;
executed (the execution status of this line is deduced): modifier_buttons = e->modifiers;
-
1508 if (e->nullWindow)
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
1509 window = QGuiApplication::focusWindow();
never executed: window = QGuiApplication::focusWindow();
0
1510 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
1511 return;
never executed: return;
0
1512 if (window->d_func()->blockedByModalWindow) {
partially evaluated: window->d_func()->blockedByModalWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
1513 // a modal window is blocking this window, don't allow key events through -
1514 return;
never executed: return;
0
1515 } -
1516 -
1517 QKeyEvent ev(e->keyType, e->key, e->modifiers,
executed (the execution status of this line is deduced): QKeyEvent ev(e->keyType, e->key, e->modifiers,
-
1518 e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
executed (the execution status of this line is deduced): e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
-
1519 e->unicode, e->repeat, e->repeatCount);
executed (the execution status of this line is deduced): e->unicode, e->repeat, e->repeatCount);
-
1520 ev.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): ev.setTimestamp(e->timestamp);
-
1521 QGuiApplication::sendSpontaneousEvent(window, &ev);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &ev);
-
1522}
executed: }
Execution Count:62
62
1523 -
1524void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e) -
1525{ -
1526 if (!e->enter)
partially evaluated: !e->enter
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:748
0-748
1527 return;
never executed: return;
0
1528 if (e->enter.data()->d_func()->blockedByModalWindow) {
evaluated: e->enter.data()->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:49
yes
Evaluation Count:699
49-699
1529 // a modal window is blocking this window, don't allow enter events through -
1530 return;
executed: return;
Execution Count:49
49
1531 } -
1532 -
1533 currentMouseWindow = e->enter;
executed (the execution status of this line is deduced): currentMouseWindow = e->enter;
-
1534 -
1535 QEnterEvent event(e->localPos, e->localPos, e->globalPos);
executed (the execution status of this line is deduced): QEnterEvent event(e->localPos, e->localPos, e->globalPos);
-
1536 QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event);
executed (the execution status of this line is deduced): QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event);
-
1537}
executed: }
Execution Count:699
699
1538 -
1539void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::LeaveEvent *e) -
1540{ -
1541 if (!e->leave)
evaluated: !e->leave
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:537
10-537
1542 return;
executed: return;
Execution Count:10
10
1543 if (e->leave.data()->d_func()->blockedByModalWindow) {
evaluated: e->leave.data()->d_func()->blockedByModalWindow
TRUEFALSE
yes
Evaluation Count:56
yes
Evaluation Count:481
56-481
1544 // a modal window is blocking this window, don't allow leave events through -
1545 return;
executed: return;
Execution Count:56
56
1546 } -
1547 -
1548 currentMouseWindow = 0;
executed (the execution status of this line is deduced): currentMouseWindow = 0;
-
1549 -
1550 QEvent event(QEvent::Leave);
executed (the execution status of this line is deduced): QEvent event(QEvent::Leave);
-
1551 QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event);
executed (the execution status of this line is deduced): QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event);
-
1552}
executed: }
Execution Count:481
481
1553 -
1554void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e) -
1555{ -
1556 QWindow *previous = QGuiApplicationPrivate::focus_window;
executed (the execution status of this line is deduced): QWindow *previous = QGuiApplicationPrivate::focus_window;
-
1557 QWindow *newFocus = e->activated.data();
executed (the execution status of this line is deduced): QWindow *newFocus = e->activated.data();
-
1558 -
1559 if (previous == newFocus)
evaluated: previous == newFocus
TRUEFALSE
yes
Evaluation Count:72
yes
Evaluation Count:968
72-968
1560 return;
executed: return;
Execution Count:72
72
1561 -
1562 QObject *previousFocusObject = previous ? previous->focusObject() : 0;
evaluated: previous
TRUEFALSE
yes
Evaluation Count:308
yes
Evaluation Count:660
308-660
1563 -
1564 if (previous) {
evaluated: previous
TRUEFALSE
yes
Evaluation Count:308
yes
Evaluation Count:660
308-660
1565 QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange);
executed (the execution status of this line is deduced): QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange);
-
1566 QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange);
executed (the execution status of this line is deduced): QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange);
-
1567 }
executed: }
Execution Count:308
308
1568 -
1569 QGuiApplicationPrivate::focus_window = newFocus;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::focus_window = newFocus;
-
1570 -
1571 if (previous) {
evaluated: previous
TRUEFALSE
yes
Evaluation Count:308
yes
Evaluation Count:660
308-660
1572 QFocusEvent focusOut(QEvent::FocusOut);
executed (the execution status of this line is deduced): QFocusEvent focusOut(QEvent::FocusOut);
-
1573 QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
executed (the execution status of this line is deduced): QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
-
1574 QObject::disconnect(previous, SIGNAL(focusObjectChanged(QObject*)),
executed (the execution status of this line is deduced): QObject::disconnect(previous, "2""focusObjectChanged(QObject*)",
-
1575 qApp, SLOT(_q_updateFocusObject(QObject*)));
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance())), "1""_q_updateFocusObject(QObject*)");
-
1576 } else {
executed: }
Execution Count:308
308
1577 QEvent appActivate(QEvent::ApplicationActivate);
executed (the execution status of this line is deduced): QEvent appActivate(QEvent::ApplicationActivate);
-
1578 qApp->sendSpontaneousEvent(qApp, &appActivate);
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appActivate);
-
1579 }
executed: }
Execution Count:660
660
1580 -
1581 if (QGuiApplicationPrivate::focus_window) {
evaluated: QGuiApplicationPrivate::focus_window
TRUEFALSE
yes
Evaluation Count:923
yes
Evaluation Count:45
45-923
1582 QFocusEvent focusIn(QEvent::FocusIn);
executed (the execution status of this line is deduced): QFocusEvent focusIn(QEvent::FocusIn);
-
1583 QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn);
executed (the execution status of this line is deduced): QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn);
-
1584 QObject::connect(QGuiApplicationPrivate::focus_window, SIGNAL(focusObjectChanged(QObject*)),
executed (the execution status of this line is deduced): QObject::connect(QGuiApplicationPrivate::focus_window, "2""focusObjectChanged(QObject*)",
-
1585 qApp, SLOT(_q_updateFocusObject(QObject*)));
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance())), "1""_q_updateFocusObject(QObject*)");
-
1586 } else {
executed: }
Execution Count:923
923
1587 QEvent appActivate(QEvent::ApplicationDeactivate);
executed (the execution status of this line is deduced): QEvent appActivate(QEvent::ApplicationDeactivate);
-
1588 qApp->sendSpontaneousEvent(qApp, &appActivate);
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &appActivate);
-
1589 }
executed: }
Execution Count:45
45
1590 -
1591 if (self) {
partially evaluated: self
TRUEFALSE
yes
Evaluation Count:968
no
Evaluation Count:0
0-968
1592 self->notifyActiveWindowChange(previous);
executed (the execution status of this line is deduced): self->notifyActiveWindowChange(previous);
-
1593 -
1594 if (previousFocusObject != qApp->focusObject())
evaluated: previousFocusObject != (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject()
TRUEFALSE
yes
Evaluation Count:965
yes
Evaluation Count:3
3-965
1595 self->_q_updateFocusObject(qApp->focusObject());
executed: self->_q_updateFocusObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusObject());
Execution Count:965
965
1596 }
executed: }
Execution Count:968
968
1597 -
1598 emit qApp->focusWindowChanged(newFocus);
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->focusWindowChanged(newFocus);
-
1599}
executed: }
Execution Count:968
968
1600 -
1601void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse) -
1602{ -
1603 if (QWindow *window = wse->window.data()) {
evaluated: QWindow *window = wse->window.data()
TRUEFALSE
yes
Evaluation Count:735
yes
Evaluation Count:1
1-735
1604 QWindowStateChangeEvent e(window->windowState());
executed (the execution status of this line is deduced): QWindowStateChangeEvent e(window->windowState());
-
1605 window->d_func()->windowState = wse->newState;
executed (the execution status of this line is deduced): window->d_func()->windowState = wse->newState;
-
1606 QGuiApplication::sendSpontaneousEvent(window, &e);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &e);
-
1607 }
executed: }
Execution Count:735
735
1608}
executed: }
Execution Count:736
736
1609 -
1610void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce) -
1611{ -
1612 if (self)
never evaluated: self
0
1613 self->notifyThemeChanged();
never executed: self->notifyThemeChanged();
0
1614 if (QWindow *window = tce->window.data()) {
never evaluated: QWindow *window = tce->window.data()
0
1615 QEvent e(QEvent::ThemeChange);
never executed (the execution status of this line is deduced): QEvent e(QEvent::ThemeChange);
-
1616 QGuiApplication::sendSpontaneousEvent(window, &e);
never executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &e);
-
1617 }
never executed: }
0
1618}
never executed: }
0
1619 -
1620void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e) -
1621{ -
1622 if (e->tlw.isNull())
evaluated: e->tlw.isNull()
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:1026
13-1026
1623 return;
executed: return;
Execution Count:13
13
1624 -
1625 QWindow *window = e->tlw.data();
executed (the execution status of this line is deduced): QWindow *window = e->tlw.data();
-
1626 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1026
0-1026
1627 return;
never executed: return;
0
1628 -
1629 QRect newRect = e->newGeometry;
executed (the execution status of this line is deduced): QRect newRect = e->newGeometry;
-
1630 QRect cr = window->d_func()->geometry;
executed (the execution status of this line is deduced): QRect cr = window->d_func()->geometry;
-
1631 -
1632 bool isResize = cr.size() != newRect.size();
executed (the execution status of this line is deduced): bool isResize = cr.size() != newRect.size();
-
1633 bool isMove = cr.topLeft() != newRect.topLeft();
executed (the execution status of this line is deduced): bool isMove = cr.topLeft() != newRect.topLeft();
-
1634 -
1635 window->d_func()->geometry = newRect;
executed (the execution status of this line is deduced): window->d_func()->geometry = newRect;
-
1636 -
1637 if (isResize || window->d_func()->resizeEventPending) {
evaluated: isResize
TRUEFALSE
yes
Evaluation Count:597
yes
Evaluation Count:429
evaluated: window->d_func()->resizeEventPending
TRUEFALSE
yes
Evaluation Count:141
yes
Evaluation Count:288
141-597
1638 QResizeEvent e(newRect.size(), cr.size());
executed (the execution status of this line is deduced): QResizeEvent e(newRect.size(), cr.size());
-
1639 QGuiApplication::sendSpontaneousEvent(window, &e);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &e);
-
1640 -
1641 window->d_func()->resizeEventPending = false;
executed (the execution status of this line is deduced): window->d_func()->resizeEventPending = false;
-
1642 -
1643 if (cr.width() != newRect.width())
evaluated: cr.width() != newRect.width()
TRUEFALSE
yes
Evaluation Count:583
yes
Evaluation Count:155
155-583
1644 window->widthChanged(newRect.width());
executed: window->widthChanged(newRect.width());
Execution Count:583
583
1645 if (cr.height() != newRect.height())
evaluated: cr.height() != newRect.height()
TRUEFALSE
yes
Evaluation Count:585
yes
Evaluation Count:153
153-585
1646 window->heightChanged(newRect.height());
executed: window->heightChanged(newRect.height());
Execution Count:585
585
1647 }
executed: }
Execution Count:738
738
1648 -
1649 if (isMove) {
evaluated: isMove
TRUEFALSE
yes
Evaluation Count:691
yes
Evaluation Count:335
335-691
1650 //### frame geometry -
1651 QMoveEvent e(newRect.topLeft(), cr.topLeft());
executed (the execution status of this line is deduced): QMoveEvent e(newRect.topLeft(), cr.topLeft());
-
1652 QGuiApplication::sendSpontaneousEvent(window, &e);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &e);
-
1653 -
1654 if (cr.x() != newRect.x())
evaluated: cr.x() != newRect.x()
TRUEFALSE
yes
Evaluation Count:675
yes
Evaluation Count:16
16-675
1655 window->xChanged(newRect.x());
executed: window->xChanged(newRect.x());
Execution Count:675
675
1656 if (cr.y() != newRect.y())
evaluated: cr.y() != newRect.y()
TRUEFALSE
yes
Evaluation Count:689
yes
Evaluation Count:2
2-689
1657 window->yChanged(newRect.y());
executed: window->yChanged(newRect.y());
Execution Count:689
689
1658 }
executed: }
Execution Count:691
691
1659}
executed: }
Execution Count:1026
1026
1660 -
1661void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e) -
1662{ -
1663 if (e->window.isNull())
never evaluated: e->window.isNull()
0
1664 return;
never executed: return;
0
1665 if (e->window.data()->d_func()->blockedByModalWindow) {
never evaluated: e->window.data()->d_func()->blockedByModalWindow
0
1666 // a modal window is blocking this window, don't allow close events through -
1667 return;
never executed: return;
0
1668 } -
1669 -
1670 QCloseEvent event;
never executed (the execution status of this line is deduced): QCloseEvent event;
-
1671 QGuiApplication::sendSpontaneousEvent(e->window.data(), &event);
never executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(e->window.data(), &event);
-
1672}
never executed: }
0
1673 -
1674void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e) -
1675{ -
1676 if (e->fileName.isEmpty())
never evaluated: e->fileName.isEmpty()
0
1677 return;
never executed: return;
0
1678 -
1679 QFileOpenEvent event(e->fileName);
never executed (the execution status of this line is deduced): QFileOpenEvent event(e->fileName);
-
1680 QGuiApplication::sendSpontaneousEvent(qApp, &event);
never executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &event);
-
1681}
never executed: }
0
1682 -
1683void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::TabletEvent *e) -
1684{ -
1685#ifndef QT_NO_TABLETEVENT -
1686 QEvent::Type type = QEvent::TabletMove;
executed (the execution status of this line is deduced): QEvent::Type type = QEvent::TabletMove;
-
1687 if (e->down != tabletState) {
partially evaluated: e->down != tabletState
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1688 type = e->down ? QEvent::TabletPress : QEvent::TabletRelease;
evaluated: e->down
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1689 tabletState = e->down;
executed (the execution status of this line is deduced): tabletState = e->down;
-
1690 }
executed: }
Execution Count:2
2
1691 -
1692 QWindow *window = e->window.data();
executed (the execution status of this line is deduced): QWindow *window = e->window.data();
-
1693 modifier_buttons = e->modifiers;
executed (the execution status of this line is deduced): modifier_buttons = e->modifiers;
-
1694 -
1695 bool localValid = true;
executed (the execution status of this line is deduced): bool localValid = true;
-
1696 // If window is null, pick one based on the global position and make sure all -
1697 // subsequent events up to the release are delivered to that same window. -
1698 // If window is given, just send to that. -
1699 if (type == QEvent::TabletPress) {
evaluated: type == QEvent::TabletPress
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1700 if (e->nullWindow) {
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1701 window = QGuiApplication::topLevelAt(e->global.toPoint());
never executed (the execution status of this line is deduced): window = QGuiApplication::topLevelAt(e->global.toPoint());
-
1702 localValid = false;
never executed (the execution status of this line is deduced): localValid = false;
-
1703 }
never executed: }
0
1704 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1705 return;
never executed: return;
0
1706 tabletPressTarget = window;
executed (the execution status of this line is deduced): tabletPressTarget = window;
-
1707 } else {
executed: }
Execution Count:1
1
1708 if (e->nullWindow) {
partially evaluated: e->nullWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1709 window = tabletPressTarget;
never executed (the execution status of this line is deduced): window = tabletPressTarget;
-
1710 localValid = false;
never executed (the execution status of this line is deduced): localValid = false;
-
1711 }
never executed: }
0
1712 if (type == QEvent::TabletRelease)
partially evaluated: type == QEvent::TabletRelease
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
1713 tabletPressTarget = 0;
executed: tabletPressTarget = 0;
Execution Count:1
1
1714 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1715 return;
never executed: return;
0
1716 }
executed: }
Execution Count:1
1
1717 QPointF local = e->local;
executed (the execution status of this line is deduced): QPointF local = e->local;
-
1718 if (!localValid) {
partially evaluated: !localValid
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1719 QPointF delta = e->global - e->global.toPoint();
never executed (the execution status of this line is deduced): QPointF delta = e->global - e->global.toPoint();
-
1720 local = window->mapFromGlobal(e->global.toPoint()) + delta;
never executed (the execution status of this line is deduced): local = window->mapFromGlobal(e->global.toPoint()) + delta;
-
1721 }
never executed: }
0
1722 QTabletEvent ev(type, local, e->global,
executed (the execution status of this line is deduced): QTabletEvent ev(type, local, e->global,
-
1723 e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt,
executed (the execution status of this line is deduced): e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt,
-
1724 e->tangentialPressure, e->rotation, e->z,
executed (the execution status of this line is deduced): e->tangentialPressure, e->rotation, e->z,
-
1725 e->modifiers, e->uid);
executed (the execution status of this line is deduced): e->modifiers, e->uid);
-
1726 ev.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): ev.setTimestamp(e->timestamp);
-
1727 QGuiApplication::sendSpontaneousEvent(window, &ev);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &ev);
-
1728#else -
1729 Q_UNUSED(e) -
1730#endif -
1731}
executed: }
Execution Count:2
2
1732 -
1733void QGuiApplicationPrivate::processTabletEnterProximityEvent(QWindowSystemInterfacePrivate::TabletEnterProximityEvent *e) -
1734{ -
1735#ifndef QT_NO_TABLETEVENT -
1736 QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(),
executed (the execution status of this line is deduced): QTabletEvent ev(QEvent::TabletEnterProximity, QPointF(), QPointF(),
-
1737 e->device, e->pointerType, 0, 0, 0,
executed (the execution status of this line is deduced): e->device, e->pointerType, 0, 0, 0,
-
1738 0, 0, 0,
executed (the execution status of this line is deduced): 0, 0, 0,
-
1739 Qt::NoModifier, e->uid);
executed (the execution status of this line is deduced): Qt::NoModifier, e->uid);
-
1740 ev.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): ev.setTimestamp(e->timestamp);
-
1741 QGuiApplication::sendSpontaneousEvent(qGuiApp, &ev);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev);
-
1742#else -
1743 Q_UNUSED(e) -
1744#endif -
1745}
executed: }
Execution Count:1
1
1746 -
1747void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *e) -
1748{ -
1749#ifndef QT_NO_TABLETEVENT -
1750 QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(),
executed (the execution status of this line is deduced): QTabletEvent ev(QEvent::TabletLeaveProximity, QPointF(), QPointF(),
-
1751 e->device, e->pointerType, 0, 0, 0,
executed (the execution status of this line is deduced): e->device, e->pointerType, 0, 0, 0,
-
1752 0, 0, 0,
executed (the execution status of this line is deduced): 0, 0, 0,
-
1753 Qt::NoModifier, e->uid);
executed (the execution status of this line is deduced): Qt::NoModifier, e->uid);
-
1754 ev.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): ev.setTimestamp(e->timestamp);
-
1755 QGuiApplication::sendSpontaneousEvent(qGuiApp, &ev);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent((static_cast<QGuiApplication *>(QCoreApplication::instance())), &ev);
-
1756#else -
1757 Q_UNUSED(e) -
1758#endif -
1759}
executed: }
Execution Count:1
1
1760 -
1761void QGuiApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e) -
1762{ -
1763 if (!e->window)
never evaluated: !e->window
0
1764 return;
never executed: return;
0
1765 -
1766 if (e->window->d_func()->blockedByModalWindow) {
never evaluated: e->window->d_func()->blockedByModalWindow
0
1767 // a modal window is blocking this window, don't allow events through -
1768 return;
never executed: return;
0
1769 } -
1770 -
1771 QEvent ev(QEvent::PlatformPanel);
never executed (the execution status of this line is deduced): QEvent ev(QEvent::PlatformPanel);
-
1772 QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);
never executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);
-
1773}
never executed: }
0
1774 -
1775#ifndef QT_NO_CONTEXTMENU -
1776void QGuiApplicationPrivate::processContextMenuEvent(QWindowSystemInterfacePrivate::ContextMenuEvent *e) -
1777{ -
1778 // Widgets do not care about mouse triggered context menu events. Also, do not forward event -
1779 // to a window blocked by a modal window. -
1780 if (!e->window || e->mouseTriggered || e->window->d_func()->blockedByModalWindow)
never evaluated: !e->window
never evaluated: e->mouseTriggered
never evaluated: e->window->d_func()->blockedByModalWindow
0
1781 return;
never executed: return;
0
1782 -
1783 QContextMenuEvent ev(QContextMenuEvent::Keyboard, e->pos, e->globalPos, e->modifiers);
never executed (the execution status of this line is deduced): QContextMenuEvent ev(QContextMenuEvent::Keyboard, e->pos, e->globalPos, e->modifiers);
-
1784 QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);
never executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);
-
1785}
never executed: }
0
1786#endif -
1787 -
1788Q_GUI_EXPORT uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k) -
1789{ -
1790 return qHash(k.device) + k.touchPointId;
executed: return qHash(k.device) + k.touchPointId;
Execution Count:50
50
1791} -
1792 -
1793Q_GUI_EXPORT bool operator==(const QGuiApplicationPrivate::ActiveTouchPointsKey &a, -
1794 const QGuiApplicationPrivate::ActiveTouchPointsKey &b) -
1795{ -
1796 return a.device == b.device
executed: return a.device == b.device && a.touchPointId == b.touchPointId;
Execution Count:29
29
1797 && a.touchPointId == b.touchPointId;
executed: return a.device == b.device && a.touchPointId == b.touchPointId;
Execution Count:29
29
1798} -
1799 -
1800void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e) -
1801{ -
1802 QGuiApplicationPrivate *d = self;
executed (the execution status of this line is deduced): QGuiApplicationPrivate *d = self;
-
1803 modifier_buttons = e->modifiers;
executed (the execution status of this line is deduced): modifier_buttons = e->modifiers;
-
1804 -
1805 if (e->touchType == QEvent::TouchCancel) {
evaluated: e->touchType == QEvent::TouchCancel
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:25
3-25
1806 // The touch sequence has been canceled (e.g. by the compositor). -
1807 // Send the TouchCancel to all windows with active touches and clean up. -
1808 QTouchEvent touchEvent(QEvent::TouchCancel, e->device, e->modifiers);
executed (the execution status of this line is deduced): QTouchEvent touchEvent(QEvent::TouchCancel, e->device, e->modifiers);
-
1809 touchEvent.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): touchEvent.setTimestamp(e->timestamp);
-
1810 QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it
executed (the execution status of this line is deduced): QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it
-
1811 = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd();
executed (the execution status of this line is deduced): = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd();
-
1812 QSet<QWindow *> windowsNeedingCancel;
executed (the execution status of this line is deduced): QSet<QWindow *> windowsNeedingCancel;
-
1813 while (it != ite) {
evaluated: it != ite
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1814 QWindow *w = it->window.data();
executed (the execution status of this line is deduced): QWindow *w = it->window.data();
-
1815 if (w)
partially evaluated: w
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
0-3
1816 windowsNeedingCancel.insert(w);
executed: windowsNeedingCancel.insert(w);
Execution Count:3
3
1817 ++it;
executed (the execution status of this line is deduced): ++it;
-
1818 }
executed: }
Execution Count:3
3
1819 for (QSet<QWindow *>::const_iterator winIt = windowsNeedingCancel.constBegin(),
executed (the execution status of this line is deduced): for (QSet<QWindow *>::const_iterator winIt = windowsNeedingCancel.constBegin(),
-
1820 winItEnd = windowsNeedingCancel.constEnd(); winIt != winItEnd; ++winIt) {
evaluated: winIt != winItEnd
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3
3
1821 touchEvent.setWindow(*winIt);
executed (the execution status of this line is deduced): touchEvent.setWindow(*winIt);
-
1822 QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent);
-
1823 }
executed: }
Execution Count:3
3
1824 if (!self->synthesizedMousePoints.isEmpty() && !e->synthetic) {
evaluated: !self->synthesizedMousePoints.isEmpty()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2
partially evaluated: !e->synthetic
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-2
1825 for (QHash<QWindow *, SynthesizedMouseData>::const_iterator synthIt = self->synthesizedMousePoints.constBegin(),
executed (the execution status of this line is deduced): for (QHash<QWindow *, SynthesizedMouseData>::const_iterator synthIt = self->synthesizedMousePoints.constBegin(),
-
1826 synthItEnd = self->synthesizedMousePoints.constEnd(); synthIt != synthItEnd; ++synthIt) {
evaluated: synthIt != synthItEnd
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
1
1827 if (!synthIt->window)
partially evaluated: !synthIt->window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
0-1
1828 continue;
never executed: continue;
0
1829 QWindowSystemInterfacePrivate::MouseEvent fake(synthIt->window.data(),
executed (the execution status of this line is deduced): QWindowSystemInterfacePrivate::MouseEvent fake(synthIt->window.data(),
-
1830 e->timestamp,
executed (the execution status of this line is deduced): e->timestamp,
-
1831 synthIt->pos,
executed (the execution status of this line is deduced): synthIt->pos,
-
1832 synthIt->screenPos,
executed (the execution status of this line is deduced): synthIt->screenPos,
-
1833 Qt::NoButton,
executed (the execution status of this line is deduced): Qt::NoButton,
-
1834 e->modifiers);
executed (the execution status of this line is deduced): e->modifiers);
-
1835 fake.synthetic = true;
executed (the execution status of this line is deduced): fake.synthetic = true;
-
1836 processMouseEvent(&fake);
executed (the execution status of this line is deduced): processMouseEvent(&fake);
-
1837 }
executed: }
Execution Count:1
1
1838 self->synthesizedMousePoints.clear();
executed (the execution status of this line is deduced): self->synthesizedMousePoints.clear();
-
1839 }
executed: }
Execution Count:1
1
1840 self->activeTouchPoints.clear();
executed (the execution status of this line is deduced): self->activeTouchPoints.clear();
-
1841 self->lastTouchType = e->touchType;
executed (the execution status of this line is deduced): self->lastTouchType = e->touchType;
-
1842 return;
executed: return;
Execution Count:3
3
1843 } -
1844 -
1845 // Prevent sending ill-formed event sequences: Cancel can only be followed by a Begin. -
1846 if (self->lastTouchType == QEvent::TouchCancel && e->touchType != QEvent::TouchBegin)
evaluated: self->lastTouchType == QEvent::TouchCancel
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:20
evaluated: e->touchType != QEvent::TouchBegin
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:3
2-20
1847 return;
executed: return;
Execution Count:2
2
1848 -
1849 self->lastTouchType = e->touchType;
executed (the execution status of this line is deduced): self->lastTouchType = e->touchType;
-
1850 -
1851 QWindow *window = e->window.data();
executed (the execution status of this line is deduced): QWindow *window = e->window.data();
-
1852 typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;
executed (the execution status of this line is deduced): typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;
-
1853 QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents;
executed (the execution status of this line is deduced): QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents;
-
1854 -
1855 for (int i = 0; i < e->points.count(); ++i) {
evaluated: i < e->points.count()
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:23
23-32
1856 QTouchEvent::TouchPoint touchPoint = e->points.at(i);
executed (the execution status of this line is deduced): QTouchEvent::TouchPoint touchPoint = e->points.at(i);
-
1857 // explicitly detach from the original touch point that we got, so even -
1858 // if the touchpoint structs are reused, we will make a copy that we'll -
1859 // deliver to the user (which might want to store the struct for later use). -
1860 touchPoint.d = touchPoint.d->detach();
executed (the execution status of this line is deduced): touchPoint.d = touchPoint.d->detach();
-
1861 -
1862 // update state -
1863 QPointer<QWindow> w;
executed (the execution status of this line is deduced): QPointer<QWindow> w;
-
1864 QTouchEvent::TouchPoint previousTouchPoint;
executed (the execution status of this line is deduced): QTouchEvent::TouchPoint previousTouchPoint;
-
1865 ActiveTouchPointsKey touchInfoKey(e->device, touchPoint.id());
executed (the execution status of this line is deduced): ActiveTouchPointsKey touchInfoKey(e->device, touchPoint.id());
-
1866 ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey];
executed (the execution status of this line is deduced): ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey];
-
1867 switch (touchPoint.state()) { -
1868 case Qt::TouchPointPressed: -
1869 if (e->device->type() == QTouchDevice::TouchPad) {
partially evaluated: e->device->type() == QTouchDevice::TouchPad
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1870 // on touch-pads, send all touch points to the same widget -
1871 w = d->activeTouchPoints.isEmpty()
never evaluated: d->activeTouchPoints.isEmpty()
0
1872 ? QPointer<QWindow>()
never executed (the execution status of this line is deduced): ? QPointer<QWindow>()
-
1873 : d->activeTouchPoints.constBegin().value().window;
never executed (the execution status of this line is deduced): : d->activeTouchPoints.constBegin().value().window;
-
1874 }
never executed: }
0
1875 -
1876 if (!w) {
partially evaluated: !w
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
0-16
1877 // determine which window this event will go to -
1878 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1879 window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint());
never executed: window = QGuiApplication::topLevelAt(touchPoint.screenPos().toPoint());
0
1880 if (!window)
partially evaluated: !window
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16
0-16
1881 continue;
never executed: continue;
0
1882 w = window;
executed (the execution status of this line is deduced): w = window;
-
1883 }
executed: }
Execution Count:16
16
1884 -
1885 touchInfo.window = w;
executed (the execution status of this line is deduced): touchInfo.window = w;
-
1886 touchPoint.d->startScreenPos = touchPoint.screenPos();
executed (the execution status of this line is deduced): touchPoint.d->startScreenPos = touchPoint.screenPos();
-
1887 touchPoint.d->lastScreenPos = touchPoint.screenPos();
executed (the execution status of this line is deduced): touchPoint.d->lastScreenPos = touchPoint.screenPos();
-
1888 touchPoint.d->startNormalizedPos = touchPoint.normalizedPos();
executed (the execution status of this line is deduced): touchPoint.d->startNormalizedPos = touchPoint.normalizedPos();
-
1889 touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos();
executed (the execution status of this line is deduced): touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos();
-
1890 if (touchPoint.pressure() < qreal(0.))
evaluated: touchPoint.pressure() < qreal(0.)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:15
1-15
1891 touchPoint.d->pressure = qreal(1.);
executed: touchPoint.d->pressure = qreal(1.);
Execution Count:1
1
1892 -
1893 touchInfo.touchPoint = touchPoint;
executed (the execution status of this line is deduced): touchInfo.touchPoint = touchPoint;
-
1894 break;
executed: break;
Execution Count:16
16
1895 -
1896 case Qt::TouchPointReleased: -
1897 w = touchInfo.window;
executed (the execution status of this line is deduced): w = touchInfo.window;
-
1898 if (!w)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
1899 continue;
never executed: continue;
0
1900 -
1901 previousTouchPoint = touchInfo.touchPoint;
executed (the execution status of this line is deduced): previousTouchPoint = touchInfo.touchPoint;
-
1902 touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();
executed (the execution status of this line is deduced): touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();
-
1903 touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();
executed (the execution status of this line is deduced): touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();
-
1904 touchPoint.d->startPos = previousTouchPoint.startPos();
executed (the execution status of this line is deduced): touchPoint.d->startPos = previousTouchPoint.startPos();
-
1905 touchPoint.d->lastPos = previousTouchPoint.pos();
executed (the execution status of this line is deduced): touchPoint.d->lastPos = previousTouchPoint.pos();
-
1906 touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();
executed (the execution status of this line is deduced): touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();
-
1907 touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();
executed (the execution status of this line is deduced): touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();
-
1908 if (touchPoint.pressure() < qreal(0.))
partially evaluated: touchPoint.pressure() < qreal(0.)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:12
0-12
1909 touchPoint.d->pressure = qreal(0.);
never executed: touchPoint.d->pressure = qreal(0.);
0
1910 -
1911 break;
executed: break;
Execution Count:12
12
1912 -
1913 default: -
1914 w = touchInfo.window;
executed (the execution status of this line is deduced): w = touchInfo.window;
-
1915 if (!w)
partially evaluated: !w
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1916 continue;
never executed: continue;
0
1917 -
1918 previousTouchPoint = touchInfo.touchPoint;
executed (the execution status of this line is deduced): previousTouchPoint = touchInfo.touchPoint;
-
1919 touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();
executed (the execution status of this line is deduced): touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos();
-
1920 touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();
executed (the execution status of this line is deduced): touchPoint.d->lastScreenPos = previousTouchPoint.screenPos();
-
1921 touchPoint.d->startPos = previousTouchPoint.startPos();
executed (the execution status of this line is deduced): touchPoint.d->startPos = previousTouchPoint.startPos();
-
1922 touchPoint.d->lastPos = previousTouchPoint.pos();
executed (the execution status of this line is deduced): touchPoint.d->lastPos = previousTouchPoint.pos();
-
1923 touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();
executed (the execution status of this line is deduced): touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos();
-
1924 touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();
executed (the execution status of this line is deduced): touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos();
-
1925 if (touchPoint.pressure() < qreal(0.))
partially evaluated: touchPoint.pressure() < qreal(0.)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
1926 touchPoint.d->pressure = qreal(1.);
never executed: touchPoint.d->pressure = qreal(1.);
0
1927 -
1928 // Stationary points might not be delivered down to the receiving item -
1929 // and get their position transformed, keep the old values instead. -
1930 if (touchPoint.state() != Qt::TouchPointStationary)
evaluated: touchPoint.state() != Qt::TouchPointStationary
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
1931 touchInfo.touchPoint = touchPoint;
executed: touchInfo.touchPoint = touchPoint;
Execution Count:3
3
1932 break;
executed: break;
Execution Count:4
4
1933 } -
1934 -
1935 Q_ASSERT(w.data() != 0);
executed (the execution status of this line is deduced): qt_noop();
-
1936 -
1937 // make the *scene* functions return the same as the *screen* functions -
1938 touchPoint.d->sceneRect = touchPoint.screenRect();
executed (the execution status of this line is deduced): touchPoint.d->sceneRect = touchPoint.screenRect();
-
1939 touchPoint.d->startScenePos = touchPoint.startScreenPos();
executed (the execution status of this line is deduced): touchPoint.d->startScenePos = touchPoint.startScreenPos();
-
1940 touchPoint.d->lastScenePos = touchPoint.lastScreenPos();
executed (the execution status of this line is deduced): touchPoint.d->lastScenePos = touchPoint.lastScreenPos();
-
1941 -
1942 StatesAndTouchPoints &maskAndPoints = windowsNeedingEvents[w.data()];
executed (the execution status of this line is deduced): StatesAndTouchPoints &maskAndPoints = windowsNeedingEvents[w.data()];
-
1943 maskAndPoints.first |= touchPoint.state();
executed (the execution status of this line is deduced): maskAndPoints.first |= touchPoint.state();
-
1944 maskAndPoints.second.append(touchPoint);
executed (the execution status of this line is deduced): maskAndPoints.second.append(touchPoint);
-
1945 }
executed: }
Execution Count:32
32
1946 -
1947 if (windowsNeedingEvents.isEmpty())
partially evaluated: windowsNeedingEvents.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23
0-23
1948 return;
never executed: return;
0
1949 -
1950 QHash<QWindow *, StatesAndTouchPoints>::ConstIterator it = windowsNeedingEvents.constBegin();
executed (the execution status of this line is deduced): QHash<QWindow *, StatesAndTouchPoints>::ConstIterator it = windowsNeedingEvents.constBegin();
-
1951 const QHash<QWindow *, StatesAndTouchPoints>::ConstIterator end = windowsNeedingEvents.constEnd();
executed (the execution status of this line is deduced): const QHash<QWindow *, StatesAndTouchPoints>::ConstIterator end = windowsNeedingEvents.constEnd();
-
1952 for (; it != end; ++it) {
evaluated: it != end
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:23
23
1953 QWindow *w = it.key();
executed (the execution status of this line is deduced): QWindow *w = it.key();
-
1954 -
1955 QEvent::Type eventType;
executed (the execution status of this line is deduced): QEvent::Type eventType;
-
1956 switch (it.value().first) { -
1957 case Qt::TouchPointPressed: -
1958 eventType = QEvent::TouchBegin;
executed (the execution status of this line is deduced): eventType = QEvent::TouchBegin;
-
1959 break;
executed: break;
Execution Count:12
12
1960 case Qt::TouchPointReleased: -
1961 eventType = QEvent::TouchEnd;
executed (the execution status of this line is deduced): eventType = QEvent::TouchEnd;
-
1962 break;
executed: break;
Execution Count:8
8
1963 case Qt::TouchPointStationary: -
1964 // don't send the event if nothing changed -
1965 continue;
never executed: continue;
0
1966 default: -
1967 eventType = QEvent::TouchUpdate;
executed (the execution status of this line is deduced): eventType = QEvent::TouchUpdate;
-
1968 break;
executed: break;
Execution Count:3
3
1969 } -
1970 -
1971 if (w->d_func()->blockedByModalWindow) {
partially evaluated: w->d_func()->blockedByModalWindow
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:23
0-23
1972 // a modal window is blocking this window, don't allow touch events through -
1973 continue;
never executed: continue;
0
1974 } -
1975 -
1976 QTouchEvent touchEvent(eventType,
executed (the execution status of this line is deduced): QTouchEvent touchEvent(eventType,
-
1977 e->device,
executed (the execution status of this line is deduced): e->device,
-
1978 e->modifiers,
executed (the execution status of this line is deduced): e->modifiers,
-
1979 it.value().first,
executed (the execution status of this line is deduced): it.value().first,
-
1980 it.value().second);
executed (the execution status of this line is deduced): it.value().second);
-
1981 touchEvent.setTimestamp(e->timestamp);
executed (the execution status of this line is deduced): touchEvent.setTimestamp(e->timestamp);
-
1982 touchEvent.setWindow(w);
executed (the execution status of this line is deduced): touchEvent.setWindow(w);
-
1983 -
1984 const int pointCount = touchEvent.touchPoints().count();
executed (the execution status of this line is deduced): const int pointCount = touchEvent.touchPoints().count();
-
1985 for (int i = 0; i < pointCount; ++i) {
evaluated: i < pointCount
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:23
23-32
1986 QTouchEvent::TouchPoint &touchPoint = touchEvent._touchPoints[i];
executed (the execution status of this line is deduced): QTouchEvent::TouchPoint &touchPoint = touchEvent._touchPoints[i];
-
1987 -
1988 // preserve the sub-pixel resolution -
1989 QRectF rect = touchPoint.screenRect();
executed (the execution status of this line is deduced): QRectF rect = touchPoint.screenRect();
-
1990 const QPointF screenPos = rect.center();
executed (the execution status of this line is deduced): const QPointF screenPos = rect.center();
-
1991 const QPointF delta = screenPos - screenPos.toPoint();
executed (the execution status of this line is deduced): const QPointF delta = screenPos - screenPos.toPoint();
-
1992 -
1993 rect.moveCenter(w->mapFromGlobal(screenPos.toPoint()) + delta);
executed (the execution status of this line is deduced): rect.moveCenter(w->mapFromGlobal(screenPos.toPoint()) + delta);
-
1994 touchPoint.d->rect = rect;
executed (the execution status of this line is deduced): touchPoint.d->rect = rect;
-
1995 if (touchPoint.state() == Qt::TouchPointPressed) {
evaluated: touchPoint.state() == Qt::TouchPointPressed
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:16
16
1996 touchPoint.d->startPos = w->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta;
executed (the execution status of this line is deduced): touchPoint.d->startPos = w->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta;
-
1997 touchPoint.d->lastPos = w->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta;
executed (the execution status of this line is deduced): touchPoint.d->lastPos = w->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta;
-
1998 }
executed: }
Execution Count:16
16
1999 }
executed: }
Execution Count:32
32
2000 -
2001 QGuiApplication::sendSpontaneousEvent(w, &touchEvent);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(w, &touchEvent);
-
2002 if (!e->synthetic && !touchEvent.isAccepted() && qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)) {
evaluated: !e->synthetic
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:4
evaluated: !touchEvent.isAccepted()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:13
evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-19
2003 // exclude touchpads as those generate their own mouse events -
2004 if (touchEvent.device()->type() != QTouchDevice::TouchPad) {
partially evaluated: touchEvent.device()->type() != QTouchDevice::TouchPad
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2005 Qt::MouseButtons b = eventType == QEvent::TouchEnd ? Qt::NoButton : Qt::LeftButton;
evaluated: eventType == QEvent::TouchEnd
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
2006 if (b == Qt::NoButton)
evaluated: b == Qt::NoButton
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:3
1-3
2007 self->synthesizedMousePoints.clear();
executed: self->synthesizedMousePoints.clear();
Execution Count:1
1
2008 -
2009 QList<QTouchEvent::TouchPoint> touchPoints = touchEvent.touchPoints();
executed (the execution status of this line is deduced): QList<QTouchEvent::TouchPoint> touchPoints = touchEvent.touchPoints();
-
2010 if (eventType == QEvent::TouchBegin)
evaluated: eventType == QEvent::TouchBegin
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2
2011 m_fakeMouseSourcePointId = touchPoints.first().id();
executed: m_fakeMouseSourcePointId = touchPoints.first().id();
Execution Count:2
2
2012 -
2013 for (int i = 0; i < touchPoints.count(); ++i) {
partially evaluated: i < touchPoints.count()
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
0-6
2014 const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
executed (the execution status of this line is deduced): const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
-
2015 if (touchPoint.id() == m_fakeMouseSourcePointId) {
evaluated: touchPoint.id() == m_fakeMouseSourcePointId
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-4
2016 if (b != Qt::NoButton)
evaluated: b != Qt::NoButton
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1
1-3
2017 self->synthesizedMousePoints.insert(w, SynthesizedMouseData(
executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w));
Execution Count:3
3
2018 touchPoint.pos(), touchPoint.screenPos(), w));
executed: self->synthesizedMousePoints.insert(w, SynthesizedMouseData( touchPoint.pos(), touchPoint.screenPos(), w));
Execution Count:3
3
2019 QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,
executed (the execution status of this line is deduced): QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,
-
2020 touchPoint.pos(),
executed (the execution status of this line is deduced): touchPoint.pos(),
-
2021 touchPoint.screenPos(),
executed (the execution status of this line is deduced): touchPoint.screenPos(),
-
2022 b, e->modifiers);
executed (the execution status of this line is deduced): b, e->modifiers);
-
2023 fake.synthetic = true;
executed (the execution status of this line is deduced): fake.synthetic = true;
-
2024 processMouseEvent(&fake);
executed (the execution status of this line is deduced): processMouseEvent(&fake);
-
2025 break;
executed: break;
Execution Count:4
4
2026 } -
2027 }
executed: }
Execution Count:2
2
2028 }
executed: }
Execution Count:4
4
2029 }
executed: }
Execution Count:4
4
2030 }
executed: }
Execution Count:23
23
2031 -
2032 // Remove released points from the hash table only after the event is -
2033 // delivered. When the receiver is a widget, QApplication will access -
2034 // activeTouchPoints during delivery and therefore nothing can be removed -
2035 // before sending the event. -
2036 for (int i = 0; i < e->points.count(); ++i) {
evaluated: i < e->points.count()
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:23
23-32
2037 QTouchEvent::TouchPoint touchPoint = e->points.at(i);
executed (the execution status of this line is deduced): QTouchEvent::TouchPoint touchPoint = e->points.at(i);
-
2038 if (touchPoint.state() == Qt::TouchPointReleased)
evaluated: touchPoint.state() == Qt::TouchPointReleased
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:20
12-20
2039 d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id()));
executed: d->activeTouchPoints.remove(ActiveTouchPointsKey(e->device, touchPoint.id()));
Execution Count:12
12
2040 }
executed: }
Execution Count:32
32
2041}
executed: }
Execution Count:23
23
2042 -
2043void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e) -
2044{ -
2045 // This operation only makes sense after the QGuiApplication constructor runs -
2046 if (QCoreApplication::startingUp())
partially evaluated: QCoreApplication::startingUp()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
2047 return;
never executed: return;
0
2048 -
2049 if (!e->screen)
partially evaluated: !e->screen
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
2050 return;
never executed: return;
0
2051 -
2052 QScreen *s = e->screen.data();
executed (the execution status of this line is deduced): QScreen *s = e->screen.data();
-
2053 s->d_func()->orientation = e->orientation;
executed (the execution status of this line is deduced): s->d_func()->orientation = e->orientation;
-
2054 -
2055 updateFilteredScreenOrientation(s);
executed (the execution status of this line is deduced): updateFilteredScreenOrientation(s);
-
2056}
executed: }
Execution Count:7
7
2057 -
2058void QGuiApplicationPrivate::updateFilteredScreenOrientation(QScreen *s) -
2059{ -
2060 Qt::ScreenOrientation o = s->d_func()->orientation;
executed (the execution status of this line is deduced): Qt::ScreenOrientation o = s->d_func()->orientation;
-
2061 if (o == Qt::PrimaryOrientation)
evaluated: o == Qt::PrimaryOrientation
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:8
2-8
2062 o = s->primaryOrientation();
executed: o = s->primaryOrientation();
Execution Count:2
2
2063 o = Qt::ScreenOrientation(o & s->orientationUpdateMask());
executed (the execution status of this line is deduced): o = Qt::ScreenOrientation(o & s->orientationUpdateMask());
-
2064 if (o == Qt::PrimaryOrientation)
evaluated: o == Qt::PrimaryOrientation
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:6
4-6
2065 return;
executed: return;
Execution Count:4
4
2066 if (o == s->d_func()->filteredOrientation)
evaluated: o == s->d_func()->filteredOrientation
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-4
2067 return;
executed: return;
Execution Count:2
2
2068 s->d_func()->filteredOrientation = o;
executed (the execution status of this line is deduced): s->d_func()->filteredOrientation = o;
-
2069 reportScreenOrientationChange(s);
executed (the execution status of this line is deduced): reportScreenOrientationChange(s);
-
2070}
executed: }
Execution Count:4
4
2071 -
2072void QGuiApplicationPrivate::reportScreenOrientationChange(QScreen *s) -
2073{ -
2074 emit s->orientationChanged(s->orientation());
executed (the execution status of this line is deduced): s->orientationChanged(s->orientation());
-
2075 -
2076 QScreenOrientationChangeEvent event(s, s->orientation());
executed (the execution status of this line is deduced): QScreenOrientationChangeEvent event(s, s->orientation());
-
2077 QCoreApplication::sendEvent(QCoreApplication::instance(), &event);
executed (the execution status of this line is deduced): QCoreApplication::sendEvent(QCoreApplication::instance(), &event);
-
2078}
executed: }
Execution Count:4
4
2079 -
2080void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e) -
2081{ -
2082 // This operation only makes sense after the QGuiApplication constructor runs -
2083 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
2084 return;
never executed: return;
0
2085 -
2086 if (!e->screen)
never evaluated: !e->screen
0
2087 return;
never executed: return;
0
2088 -
2089 QScreen *s = e->screen.data();
never executed (the execution status of this line is deduced): QScreen *s = e->screen.data();
-
2090 s->d_func()->geometry = e->geometry;
never executed (the execution status of this line is deduced): s->d_func()->geometry = e->geometry;
-
2091 -
2092 Qt::ScreenOrientation primaryOrientation = s->primaryOrientation();
never executed (the execution status of this line is deduced): Qt::ScreenOrientation primaryOrientation = s->primaryOrientation();
-
2093 s->d_func()->updatePrimaryOrientation();
never executed (the execution status of this line is deduced): s->d_func()->updatePrimaryOrientation();
-
2094 -
2095 emit s->geometryChanged(s->geometry());
never executed (the execution status of this line is deduced): s->geometryChanged(s->geometry());
-
2096 emit s->physicalSizeChanged(s->physicalSize());
never executed (the execution status of this line is deduced): s->physicalSizeChanged(s->physicalSize());
-
2097 emit s->physicalDotsPerInchChanged(s->physicalDotsPerInch());
never executed (the execution status of this line is deduced): s->physicalDotsPerInchChanged(s->physicalDotsPerInch());
-
2098 emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
never executed (the execution status of this line is deduced): s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
-
2099 foreach (QScreen* sibling, s->virtualSiblings())
never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(s->virtualSiblings())> _container_(s->virtualSiblings()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QScreen* sibling = *_container_.i;; __extension__ ({--_container_.brk; break;}))
-
2100 emit sibling->virtualGeometryChanged(sibling->virtualGeometry());
never executed: sibling->virtualGeometryChanged(sibling->virtualGeometry());
0
2101 -
2102 if (s->primaryOrientation() != primaryOrientation)
never evaluated: s->primaryOrientation() != primaryOrientation
0
2103 emit s->primaryOrientationChanged(s->primaryOrientation());
never executed: s->primaryOrientationChanged(s->primaryOrientation());
0
2104 -
2105 if (s->d_func()->orientation == Qt::PrimaryOrientation)
never evaluated: s->d_func()->orientation == Qt::PrimaryOrientation
0
2106 updateFilteredScreenOrientation(s);
never executed: updateFilteredScreenOrientation(s);
0
2107}
never executed: }
0
2108 -
2109void QGuiApplicationPrivate::reportAvailableGeometryChange( -
2110 QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *e) -
2111{ -
2112 // This operation only makes sense after the QGuiApplication constructor runs -
2113 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
2114 return;
never executed: return;
0
2115 -
2116 if (!e->screen)
never evaluated: !e->screen
0
2117 return;
never executed: return;
0
2118 -
2119 QScreen *s = e->screen.data();
never executed (the execution status of this line is deduced): QScreen *s = e->screen.data();
-
2120 s->d_func()->availableGeometry = e->availableGeometry;
never executed (the execution status of this line is deduced): s->d_func()->availableGeometry = e->availableGeometry;
-
2121 -
2122 foreach (QScreen* sibling, s->virtualSiblings())
never executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__(s->virtualSiblings())> _container_(s->virtualSiblings()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QScreen* sibling = *_container_.i;; __extension__ ({--_container_.brk; break;}))
-
2123 emit sibling->virtualGeometryChanged(sibling->virtualGeometry());
never executed: sibling->virtualGeometryChanged(sibling->virtualGeometry());
0
2124}
never executed: }
0
2125 -
2126void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e) -
2127{ -
2128 // This operation only makes sense after the QGuiApplication constructor runs -
2129 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
2130 return;
never executed: return;
0
2131 -
2132 if (!e->screen)
never evaluated: !e->screen
0
2133 return;
never executed: return;
0
2134 -
2135 QScreen *s = e->screen.data();
never executed (the execution status of this line is deduced): QScreen *s = e->screen.data();
-
2136 s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY);
never executed (the execution status of this line is deduced): s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY);
-
2137 -
2138 emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
never executed (the execution status of this line is deduced): s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
-
2139}
never executed: }
0
2140 -
2141void QGuiApplicationPrivate::reportRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e) -
2142{ -
2143 // This operation only makes sense after the QGuiApplication constructor runs -
2144 if (QCoreApplication::startingUp())
never evaluated: QCoreApplication::startingUp()
0
2145 return;
never executed: return;
0
2146 -
2147 if (!e->screen)
never evaluated: !e->screen
0
2148 return;
never executed: return;
0
2149 -
2150 QScreen *s = e->screen.data();
never executed (the execution status of this line is deduced): QScreen *s = e->screen.data();
-
2151 s->d_func()->refreshRate = e->rate;
never executed (the execution status of this line is deduced): s->d_func()->refreshRate = e->rate;
-
2152 -
2153 emit s->refreshRateChanged(s->refreshRate());
never executed (the execution status of this line is deduced): s->refreshRateChanged(s->refreshRate());
-
2154}
never executed: }
0
2155 -
2156void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e) -
2157{ -
2158 if (!e->exposed)
evaluated: !e->exposed
TRUEFALSE
yes
Evaluation Count:37
yes
Evaluation Count:1836
37-1836
2159 return;
executed: return;
Execution Count:37
37
2160 -
2161 QWindow *window = e->exposed.data();
executed (the execution status of this line is deduced): QWindow *window = e->exposed.data();
-
2162 QWindowPrivate *p = qt_window_private(window);
executed (the execution status of this line is deduced): QWindowPrivate *p = qt_window_private(window);
-
2163 -
2164 if (!p->receivedExpose) {
evaluated: !p->receivedExpose
TRUEFALSE
yes
Evaluation Count:738
yes
Evaluation Count:1098
738-1098
2165 if (p->resizeEventPending) {
evaluated: p->resizeEventPending
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:685
53-685
2166 // as a convenience for plugins, send a resize event before the first expose event if they haven't done so -
2167 QSize size = p->geometry.size();
executed (the execution status of this line is deduced): QSize size = p->geometry.size();
-
2168 QResizeEvent e(size, size);
executed (the execution status of this line is deduced): QResizeEvent e(size, size);
-
2169 QGuiApplication::sendSpontaneousEvent(window, &e);
executed (the execution status of this line is deduced): QGuiApplication::sendSpontaneousEvent(window, &e);
-
2170 -
2171 p->resizeEventPending = false;
executed (the execution status of this line is deduced): p->resizeEventPending = false;
-
2172 }
executed: }
Execution Count:53
53
2173 -
2174 p->receivedExpose = true;
executed (the execution status of this line is deduced): p->receivedExpose = true;
-
2175 }
executed: }
Execution Count:738
738
2176 -
2177 p->exposed = e->isExposed;
executed (the execution status of this line is deduced): p->exposed = e->isExposed;
-
2178 -
2179 QExposeEvent exposeEvent(e->region);
executed (the execution status of this line is deduced): QExposeEvent exposeEvent(e->region);
-
2180 QCoreApplication::sendSpontaneousEvent(window, &exposeEvent);
executed (the execution status of this line is deduced): QCoreApplication::sendSpontaneousEvent(window, &exposeEvent);
-
2181}
executed: }
Execution Count:1836
1836
2182 -
2183#ifndef QT_NO_DRAGANDDROP -
2184 -
2185QPlatformDragQtResponse QGuiApplicationPrivate::processDrag(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions) -
2186{ -
2187 static QPointer<QWindow> currentDragWindow; -
2188 static Qt::DropAction lastAcceptedDropAction = Qt::IgnoreAction; -
2189 QPlatformDrag *platformDrag = platformIntegration()->drag();
never executed (the execution status of this line is deduced): QPlatformDrag *platformDrag = platformIntegration()->drag();
-
2190 if (!platformDrag) {
never evaluated: !platformDrag
0
2191 lastAcceptedDropAction = Qt::IgnoreAction;
never executed (the execution status of this line is deduced): lastAcceptedDropAction = Qt::IgnoreAction;
-
2192 return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
0
2193 } -
2194 -
2195 if (!dropData) {
never evaluated: !dropData
0
2196 if (currentDragWindow.data() == w)
never evaluated: currentDragWindow.data() == w
0
2197 currentDragWindow = 0;
never executed: currentDragWindow = 0;
0
2198 QDragLeaveEvent e;
never executed (the execution status of this line is deduced): QDragLeaveEvent e;
-
2199 QGuiApplication::sendEvent(w, &e);
never executed (the execution status of this line is deduced): QGuiApplication::sendEvent(w, &e);
-
2200 lastAcceptedDropAction = Qt::IgnoreAction;
never executed (the execution status of this line is deduced): lastAcceptedDropAction = Qt::IgnoreAction;
-
2201 return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
never executed: return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect());
0
2202 } -
2203 QDragMoveEvent me(p, supportedActions, dropData,
never executed (the execution status of this line is deduced): QDragMoveEvent me(p, supportedActions, dropData,
-
2204 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
never executed (the execution status of this line is deduced): QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
-
2205 -
2206 if (w != currentDragWindow) {
never evaluated: w != currentDragWindow
0
2207 lastAcceptedDropAction = Qt::IgnoreAction;
never executed (the execution status of this line is deduced): lastAcceptedDropAction = Qt::IgnoreAction;
-
2208 if (currentDragWindow) {
never evaluated: currentDragWindow
0
2209 QDragLeaveEvent e;
never executed (the execution status of this line is deduced): QDragLeaveEvent e;
-
2210 QGuiApplication::sendEvent(currentDragWindow, &e);
never executed (the execution status of this line is deduced): QGuiApplication::sendEvent(currentDragWindow, &e);
-
2211 }
never executed: }
0
2212 currentDragWindow = w;
never executed (the execution status of this line is deduced): currentDragWindow = w;
-
2213 QDragEnterEvent e(p, supportedActions, dropData,
never executed (the execution status of this line is deduced): QDragEnterEvent e(p, supportedActions, dropData,
-
2214 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
never executed (the execution status of this line is deduced): QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
-
2215 QGuiApplication::sendEvent(w, &e);
never executed (the execution status of this line is deduced): QGuiApplication::sendEvent(w, &e);
-
2216 if (e.isAccepted() && e.dropAction() != Qt::IgnoreAction)
never evaluated: e.isAccepted()
never evaluated: e.dropAction() != Qt::IgnoreAction
0
2217 lastAcceptedDropAction = e.dropAction();
never executed: lastAcceptedDropAction = e.dropAction();
0
2218 }
never executed: }
0
2219 -
2220 // Handling 'DragEnter' should suffice for the application. -
2221 if (lastAcceptedDropAction != Qt::IgnoreAction
never evaluated: lastAcceptedDropAction != Qt::IgnoreAction
0
2222 && (supportedActions & lastAcceptedDropAction)) {
never evaluated: (supportedActions & lastAcceptedDropAction)
0
2223 me.setDropAction(lastAcceptedDropAction);
never executed (the execution status of this line is deduced): me.setDropAction(lastAcceptedDropAction);
-
2224 me.accept();
never executed (the execution status of this line is deduced): me.accept();
-
2225 }
never executed: }
0
2226 QGuiApplication::sendEvent(w, &me);
never executed (the execution status of this line is deduced): QGuiApplication::sendEvent(w, &me);
-
2227 lastAcceptedDropAction = me.isAccepted() ?
never evaluated: me.isAccepted()
0
2228 me.dropAction() : Qt::IgnoreAction;
never executed (the execution status of this line is deduced): me.dropAction() : Qt::IgnoreAction;
-
2229 return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
never executed: return QPlatformDragQtResponse(me.isAccepted(), lastAcceptedDropAction, me.answerRect());
0
2230} -
2231 -
2232QPlatformDropQtResponse QGuiApplicationPrivate::processDrop(QWindow *w, const QMimeData *dropData, const QPoint &p, Qt::DropActions supportedActions) -
2233{ -
2234 QDropEvent de(p, supportedActions, dropData,
never executed (the execution status of this line is deduced): QDropEvent de(p, supportedActions, dropData,
-
2235 QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
never executed (the execution status of this line is deduced): QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
-
2236 QGuiApplication::sendEvent(w, &de);
never executed (the execution status of this line is deduced): QGuiApplication::sendEvent(w, &de);
-
2237 -
2238 Qt::DropAction acceptedAction = de.isAccepted() ? de.dropAction() : Qt::IgnoreAction;
never evaluated: de.isAccepted()
0
2239 QPlatformDropQtResponse response(de.isAccepted(),acceptedAction);
never executed (the execution status of this line is deduced): QPlatformDropQtResponse response(de.isAccepted(),acceptedAction);
-
2240 return response;
never executed: return response;
0
2241} -
2242 -
2243#endif // QT_NO_DRAGANDDROP -
2244 -
2245#ifndef QT_NO_CLIPBOARD -
2246/*! -
2247 Returns the object for interacting with the clipboard. -
2248*/ -
2249QClipboard * QGuiApplication::clipboard() -
2250{ -
2251 if (QGuiApplicationPrivate::qt_clipboard == 0) {
evaluated: QGuiApplicationPrivate::qt_clipboard == 0
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:62
2-62
2252 if (!qApp) {
partially evaluated: !(static_cast<QGuiApplication *>(QCoreApplication::instance()))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2253 qWarning("QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard");
never executed (the execution status of this line is deduced): QMessageLogger("kernel/qguiapplication.cpp", 2253, __PRETTY_FUNCTION__).warning("QGuiApplication: Must construct a QGuiApplication before accessing a QClipboard");
-
2254 return 0;
never executed: return 0;
0
2255 } -
2256 QGuiApplicationPrivate::qt_clipboard = new QClipboard(0);
executed (the execution status of this line is deduced): QGuiApplicationPrivate::qt_clipboard = new QClipboard(0);
-
2257 }
executed: }
Execution Count:2
2
2258 return QGuiApplicationPrivate::qt_clipboard;
executed: return QGuiApplicationPrivate::qt_clipboard;
Execution Count:64
64
2259} -
2260#endif -
2261 -
2262/*! -
2263 Returns the default application palette. -
2264 -
2265 \sa setPalette() -
2266*/ -
2267 -
2268QPalette QGuiApplication::palette() -
2269{ -
2270 initPalette();
executed (the execution status of this line is deduced): initPalette();
-
2271 return *QGuiApplicationPrivate::app_pal;
executed: return *QGuiApplicationPrivate::app_pal;
Execution Count:121950
121950
2272} -
2273 -
2274/*! -
2275 Changes the default application palette to \a pal. -
2276 -
2277 \sa palette() -
2278*/ -
2279void QGuiApplication::setPalette(const QPalette &pal) -
2280{ -
2281 if (QGuiApplicationPrivate::app_pal && pal.isCopyOf(*QGuiApplicationPrivate::app_pal))
never evaluated: QGuiApplicationPrivate::app_pal
never evaluated: pal.isCopyOf(*QGuiApplicationPrivate::app_pal)
0
2282 return;
never executed: return;
0
2283 if (!QGuiApplicationPrivate::app_pal)
never evaluated: !QGuiApplicationPrivate::app_pal
0
2284 QGuiApplicationPrivate::app_pal = new QPalette(pal);
never executed: QGuiApplicationPrivate::app_pal = new QPalette(pal);
0
2285 else -
2286 *QGuiApplicationPrivate::app_pal = pal;
never executed: *QGuiApplicationPrivate::app_pal = pal;
0
2287 applicationResourceFlags |= ApplicationPaletteExplicitlySet;
never executed (the execution status of this line is deduced): applicationResourceFlags |= ApplicationPaletteExplicitlySet;
-
2288}
never executed: }
0
2289 -
2290/*! -
2291 Returns the default application font. -
2292 -
2293 \sa setFont() -
2294*/ -
2295QFont QGuiApplication::font() -
2296{ -
2297 QMutexLocker locker(&applicationFontMutex);
executed (the execution status of this line is deduced): QMutexLocker locker(&applicationFontMutex);
-
2298 initFontUnlocked();
executed (the execution status of this line is deduced): initFontUnlocked();
-
2299 return *QGuiApplicationPrivate::app_font;
executed: return *QGuiApplicationPrivate::app_font;
Execution Count:806482
806482
2300} -
2301 -
2302/*! -
2303 Changes the default application font to \a font. -
2304 -
2305 \sa font() -
2306*/ -
2307void QGuiApplication::setFont(const QFont &font) -
2308{ -
2309 QMutexLocker locker(&applicationFontMutex);
executed (the execution status of this line is deduced): QMutexLocker locker(&applicationFontMutex);
-
2310 if (!QGuiApplicationPrivate::app_font)
evaluated: !QGuiApplicationPrivate::app_font
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:2
2-12
2311 QGuiApplicationPrivate::app_font = new QFont(font);
executed: QGuiApplicationPrivate::app_font = new QFont(font);
Execution Count:12
12
2312 else -
2313 *QGuiApplicationPrivate::app_font = font;
executed: *QGuiApplicationPrivate::app_font = font;
Execution Count:2
2
2314 applicationResourceFlags |= ApplicationFontExplicitlySet;
executed (the execution status of this line is deduced): applicationResourceFlags |= ApplicationFontExplicitlySet;
-
2315}
executed: }
Execution Count:14
14
2316 -
2317/*! -
2318 \fn bool QGuiApplication::isRightToLeft() -
2319 -
2320 Returns true if the application's layout direction is -
2321 Qt::RightToLeft; otherwise returns false. -
2322 -
2323 \sa layoutDirection(), isLeftToRight() -
2324*/ -
2325 -
2326/*! -
2327 \fn bool QGuiApplication::isLeftToRight() -
2328 -
2329 Returns true if the application's layout direction is -
2330 Qt::LeftToRight; otherwise returns false. -
2331 -
2332 \sa layoutDirection(), isRightToLeft() -
2333*/ -
2334 -
2335void QGuiApplicationPrivate::notifyLayoutDirectionChange() -
2336{ -
2337} -
2338 -
2339void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) -
2340{ -
2341} -
2342 -
2343 -
2344/*! -
2345 \property QGuiApplication::quitOnLastWindowClosed -
2346 -
2347 \brief whether the application implicitly quits when the last window is -
2348 closed. -
2349 -
2350 The default is true. -
2351 -
2352 If this property is true, the applications quits when the last visible -
2353 primary window (i.e. window with no parent) is closed. -
2354 -
2355 \sa quit(), QWindow::close() -
2356 */ -
2357 -
2358void QGuiApplication::setQuitOnLastWindowClosed(bool quit) -
2359{ -
2360 QCoreApplication::setQuitLockEnabled(quit);
never executed (the execution status of this line is deduced): QCoreApplication::setQuitLockEnabled(quit);
-
2361}
never executed: }
0
2362 -
2363 -
2364 -
2365bool QGuiApplication::quitOnLastWindowClosed() -
2366{ -
2367 return QCoreApplication::isQuitLockEnabled();
executed: return QCoreApplication::isQuitLockEnabled();
Execution Count:12
12
2368} -
2369 -
2370 -
2371/*! -
2372 \fn void QGuiApplication::lastWindowClosed() -
2373 -
2374 This signal is emitted from exec() when the last visible -
2375 primary window (i.e. window with no parent) is closed. -
2376 -
2377 By default, QGuiApplication quits after this signal is emitted. This feature -
2378 can be turned off by setting \l quitOnLastWindowClosed to false. -
2379 -
2380 \sa QWindow::close(), QWindow::isTopLevel() -
2381*/ -
2382 -
2383void QGuiApplicationPrivate::emitLastWindowClosed() -
2384{ -
2385 if (qGuiApp && qGuiApp->d_func()->in_exec) {
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))
TRUEFALSE
yes
Evaluation Count:961
no
Evaluation Count:0
evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->in_exec
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:945
0-961
2386 emit qGuiApp->lastWindowClosed();
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->lastWindowClosed();
-
2387 }
executed: }
Execution Count:16
16
2388}
executed: }
Execution Count:961
961
2389 -
2390bool QGuiApplicationPrivate::shouldQuit() -
2391{ -
2392 /* if there is no visible top-level window left, we allow the quit */ -
2393 QWindowList list = QGuiApplication::topLevelWindows();
executed (the execution status of this line is deduced): QWindowList list = QGuiApplication::topLevelWindows();
-
2394 for (int i = 0; i < list.size(); ++i) {
evaluated: i < list.size()
TRUEFALSE
yes
Evaluation Count:47
yes
Evaluation Count:14
14-47
2395 QWindow *w = list.at(i);
executed (the execution status of this line is deduced): QWindow *w = list.at(i);
-
2396 if (w->isVisible() && !w->transientParent())
evaluated: w->isVisible()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:43
evaluated: !w->transientParent()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2-43
2397 return false;
executed: return false;
Execution Count:2
2
2398 }
executed: }
Execution Count:45
45
2399 return true;
executed: return true;
Execution Count:14
14
2400} -
2401 -
2402/*! -
2403 \since 4.2 -
2404 \fn void QGuiApplication::commitDataRequest(QSessionManager &manager) -
2405 -
2406 This signal deals with \l{Session Management}{session management}. It is -
2407 emitted when the QSessionManager wants the application to commit all its -
2408 data. -
2409 -
2410 Usually this means saving all open files, after getting permission from -
2411 the user. Furthermore you may want to provide a means by which the user -
2412 can cancel the shutdown. -
2413 -
2414 You should not exit the application within this signal. Instead, -
2415 the session manager may or may not do this afterwards, depending on the -
2416 context. -
2417 -
2418 \warning Within this signal, no user interaction is possible, \e -
2419 unless you ask the \a manager for explicit permission. See -
2420 QSessionManager::allowsInteraction() and -
2421 QSessionManager::allowsErrorInteraction() for details and example -
2422 usage. -
2423 -
2424 \note You should use Qt::DirectConnection when connecting to this signal. -
2425 -
2426 \sa isSessionRestored(), sessionId(), saveStateRequest(), {Session Management} -
2427*/ -
2428 -
2429/*! -
2430 \since 4.2 -
2431 \fn void QGuiApplication::saveStateRequest(QSessionManager &manager) -
2432 -
2433 This signal deals with \l{Session Management}{session management}. It is -
2434 invoked when the \l{QSessionManager}{session manager} wants the application -
2435 to preserve its state for a future session. -
2436 -
2437 For example, a text editor would create a temporary file that includes the -
2438 current contents of its edit buffers, the location of the cursor and other -
2439 aspects of the current editing session. -
2440 -
2441 You should never exit the application within this signal. Instead, the -
2442 session manager may or may not do this afterwards, depending on the -
2443 context. Futhermore, most session managers will very likely request a saved -
2444 state immediately after the application has been started. This permits the -
2445 session manager to learn about the application's restart policy. -
2446 -
2447 \warning Within this signal, no user interaction is possible, \e -
2448 unless you ask the \a manager for explicit permission. See -
2449 QSessionManager::allowsInteraction() and -
2450 QSessionManager::allowsErrorInteraction() for details. -
2451 -
2452 \note You should use Qt::DirectConnection when connecting to this signal. -
2453 -
2454 \sa isSessionRestored(), sessionId(), commitDataRequest(), {Session Management} -
2455*/ -
2456 -
2457/*! -
2458 \fn bool QGuiApplication::isSessionRestored() const -
2459 -
2460 Returns true if the application has been restored from an earlier -
2461 \l{Session Management}{session}; otherwise returns false. -
2462 -
2463 \sa sessionId(), commitDataRequest(), saveStateRequest() -
2464*/ -
2465 -
2466/*! -
2467 \since 5.0 -
2468 \fn bool QGuiApplication::isSavingSession() const -
2469 -
2470 Returns true if the application is currently saving the -
2471 \l{Session Management}{session}; otherwise returns false. -
2472 -
2473 This is true when commitDataRequest() and saveStateRequest() are emitted, -
2474 but also when the windows are closed afterwards by session management. -
2475 -
2476 \sa sessionId(), commitDataRequest(), saveStateRequest() -
2477*/ -
2478 -
2479/*! -
2480 \fn QString QGuiApplication::sessionId() const -
2481 -
2482 Returns the current \l{Session Management}{session's} identifier. -
2483 -
2484 If the application has been restored from an earlier session, this -
2485 identifier is the same as it was in that previous session. The session -
2486 identifier is guaranteed to be unique both for different applications -
2487 and for different instances of the same application. -
2488 -
2489 \sa isSessionRestored(), sessionKey(), commitDataRequest(), saveStateRequest() -
2490*/ -
2491 -
2492/*! -
2493 \fn QString QGuiApplication::sessionKey() const -
2494 -
2495 Returns the session key in the current \l{Session Management}{session}. -
2496 -
2497 If the application has been restored from an earlier session, this key is -
2498 the same as it was when the previous session ended. -
2499 -
2500 The session key changes every time the session is saved. If the shutdown process -
2501 is cancelled, another session key will be used when shutting down again. -
2502 -
2503 \sa isSessionRestored(), sessionId(), commitDataRequest(), saveStateRequest() -
2504*/ -
2505#ifndef QT_NO_SESSIONMANAGER -
2506bool QGuiApplication::isSessionRestored() const -
2507{ -
2508 Q_D(const QGuiApplication);
never executed (the execution status of this line is deduced): const QGuiApplicationPrivate * const d = d_func();
-
2509 return d->is_session_restored;
never executed: return d->is_session_restored;
0
2510} -
2511 -
2512QString QGuiApplication::sessionId() const -
2513{ -
2514 Q_D(const QGuiApplication);
never executed (the execution status of this line is deduced): const QGuiApplicationPrivate * const d = d_func();
-
2515 return d->session_id;
never executed: return d->session_id;
0
2516} -
2517 -
2518QString QGuiApplication::sessionKey() const -
2519{ -
2520 Q_D(const QGuiApplication);
never executed (the execution status of this line is deduced): const QGuiApplicationPrivate * const d = d_func();
-
2521 return d->session_key;
never executed: return d->session_key;
0
2522} -
2523 -
2524bool QGuiApplication::isSavingSession() const -
2525{ -
2526 Q_D(const QGuiApplication);
never executed (the execution status of this line is deduced): const QGuiApplicationPrivate * const d = d_func();
-
2527 return d->is_saving_session;
never executed: return d->is_saving_session;
0
2528} -
2529 -
2530void QGuiApplicationPrivate::commitData(QSessionManager& manager) -
2531{ -
2532 Q_Q(QGuiApplication);
never executed (the execution status of this line is deduced): QGuiApplication * const q = q_func();
-
2533 is_saving_session = true;
never executed (the execution status of this line is deduced): is_saving_session = true;
-
2534 emit q->commitDataRequest(manager);
never executed (the execution status of this line is deduced): q->commitDataRequest(manager);
-
2535 if (manager.allowsInteraction()) {
never evaluated: manager.allowsInteraction()
0
2536 QWindowList done;
never executed (the execution status of this line is deduced): QWindowList done;
-
2537 QWindowList list = QGuiApplication::topLevelWindows();
never executed (the execution status of this line is deduced): QWindowList list = QGuiApplication::topLevelWindows();
-
2538 bool cancelled = false;
never executed (the execution status of this line is deduced): bool cancelled = false;
-
2539 for (int i = 0; !cancelled && i < list.size(); ++i) {
never evaluated: !cancelled
never evaluated: i < list.size()
0
2540 QWindow* w = list.at(i);
never executed (the execution status of this line is deduced): QWindow* w = list.at(i);
-
2541 if (w->isVisible() && !done.contains(w)) {
never evaluated: w->isVisible()
never evaluated: !done.contains(w)
0
2542 cancelled = !w->close();
never executed (the execution status of this line is deduced): cancelled = !w->close();
-
2543 if (!cancelled)
never evaluated: !cancelled
0
2544 done.append(w);
never executed: done.append(w);
0
2545 list = QGuiApplication::topLevelWindows();
never executed (the execution status of this line is deduced): list = QGuiApplication::topLevelWindows();
-
2546 i = -1;
never executed (the execution status of this line is deduced): i = -1;
-
2547 }
never executed: }
0
2548 }
never executed: }
0
2549 if (cancelled)
never evaluated: cancelled
0
2550 manager.cancel();
never executed: manager.cancel();
0
2551 }
never executed: }
0
2552 is_saving_session = false;
never executed (the execution status of this line is deduced): is_saving_session = false;
-
2553}
never executed: }
0
2554 -
2555 -
2556void QGuiApplicationPrivate::saveState(QSessionManager &manager) -
2557{ -
2558 Q_Q(QGuiApplication);
never executed (the execution status of this line is deduced): QGuiApplication * const q = q_func();
-
2559 is_saving_session = true;
never executed (the execution status of this line is deduced): is_saving_session = true;
-
2560 emit q->saveStateRequest(manager);
never executed (the execution status of this line is deduced): q->saveStateRequest(manager);
-
2561 is_saving_session = false;
never executed (the execution status of this line is deduced): is_saving_session = false;
-
2562}
never executed: }
0
2563#endif //QT_NO_SESSIONMANAGER -
2564 -
2565/*! -
2566 \property QGuiApplication::layoutDirection -
2567 \brief the default layout direction for this application -
2568 -
2569 On system start-up, the default layout direction depends on the -
2570 application's language. -
2571 -
2572 \sa QWidget::layoutDirection, isLeftToRight(), isRightToLeft() -
2573 */ -
2574 -
2575void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction) -
2576{ -
2577 if (layout_direction == direction || direction == Qt::LayoutDirectionAuto)
evaluated: layout_direction == direction
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:11
partially evaluated: direction == Qt::LayoutDirectionAuto
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-52
2578 return;
executed: return;
Execution Count:52
52
2579 -
2580 layout_direction = direction;
executed (the execution status of this line is deduced): layout_direction = direction;
-
2581 -
2582 QGuiApplicationPrivate::self->notifyLayoutDirectionChange();
executed (the execution status of this line is deduced): QGuiApplicationPrivate::self->notifyLayoutDirectionChange();
-
2583}
executed: }
Execution Count:11
11
2584 -
2585Qt::LayoutDirection QGuiApplication::layoutDirection() -
2586{ -
2587 return layout_direction;
executed: return layout_direction;
Execution Count:407304
407304
2588} -
2589 -
2590/*! -
2591 \fn QCursor *QGuiApplication::overrideCursor() -
2592 -
2593 Returns the active application override cursor. -
2594 -
2595 This function returns 0 if no application cursor has been defined (i.e. the -
2596 internal cursor stack is empty). -
2597 -
2598 \sa setOverrideCursor(), restoreOverrideCursor() -
2599*/ -
2600#ifndef QT_NO_CURSOR -
2601QCursor *QGuiApplication::overrideCursor() -
2602{ -
2603 return qGuiApp->d_func()->cursor_list.isEmpty() ? 0 : &qGuiApp->d_func()->cursor_list.first();
executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty() ? 0 : &(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.first();
Execution Count:3619
3619
2604} -
2605 -
2606/*! -
2607 Changes the currently active application override cursor to \a cursor. -
2608 -
2609 This function has no effect if setOverrideCursor() was not called. -
2610 -
2611 \sa setOverrideCursor(), overrideCursor(), restoreOverrideCursor(), -
2612 QWidget::setCursor() -
2613 */ -
2614void QGuiApplication::changeOverrideCursor(const QCursor &cursor) -
2615{ -
2616 if (qGuiApp->d_func()->cursor_list.isEmpty())
never evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty()
0
2617 return;
never executed: return;
0
2618 qGuiApp->d_func()->cursor_list.removeFirst();
never executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst();
-
2619 setOverrideCursor(cursor);
never executed (the execution status of this line is deduced): setOverrideCursor(cursor);
-
2620}
never executed: }
0
2621#endif -
2622 -
2623 -
2624#ifndef QT_NO_CURSOR -
2625static inline void applyCursor(QWindow *w, QCursor c) -
2626{ -
2627 if (const QScreen *screen = w->screen())
partially evaluated: const QScreen *screen = w->screen()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2628 if (QPlatformCursor *cursor = screen->handle()->cursor())
partially evaluated: QPlatformCursor *cursor = screen->handle()->cursor()
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2629 cursor->changeCursor(&c, w);
executed: cursor->changeCursor(&c, w);
Execution Count:4
4
2630}
executed: }
Execution Count:4
4
2631 -
2632static inline void applyCursor(const QList<QWindow *> &l, const QCursor &c) -
2633{ -
2634 for (int i = 0; i < l.size(); ++i) {
evaluated: i < l.size()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:2
2-6
2635 QWindow *w = l.at(i);
executed (the execution status of this line is deduced): QWindow *w = l.at(i);
-
2636 if (w->handle() && w->type() != Qt::Desktop)
evaluated: w->handle()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
evaluated: w->type() != Qt::Desktop
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2-4
2637 applyCursor(w, c);
executed: applyCursor(w, c);
Execution Count:2
2
2638 }
executed: }
Execution Count:6
6
2639}
executed: }
Execution Count:2
2
2640 -
2641static inline void applyWindowCursor(const QList<QWindow *> &l) -
2642{ -
2643 for (int i = 0; i < l.size(); ++i) {
evaluated: i < l.size()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:2
2-6
2644 QWindow *w = l.at(i);
executed (the execution status of this line is deduced): QWindow *w = l.at(i);
-
2645 if (w->handle() && w->type() != Qt::Desktop)
evaluated: w->handle()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
evaluated: w->type() != Qt::Desktop
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
2-4
2646 applyCursor(w, w->cursor());
executed: applyCursor(w, w->cursor());
Execution Count:2
2
2647 }
executed: }
Execution Count:6
6
2648}
executed: }
Execution Count:2
2
2649 -
2650/*! -
2651 \fn void QGuiApplication::setOverrideCursor(const QCursor &cursor) -
2652 -
2653 Sets the application override cursor to \a cursor. -
2654 -
2655 Application override cursors are intended for showing the user that the -
2656 application is in a special state, for example during an operation that -
2657 might take some time. -
2658 -
2659 This cursor will be displayed in all the application's widgets until -
2660 restoreOverrideCursor() or another setOverrideCursor() is called. -
2661 -
2662 Application cursors are stored on an internal stack. setOverrideCursor() -
2663 pushes the cursor onto the stack, and restoreOverrideCursor() pops the -
2664 active cursor off the stack. changeOverrideCursor() changes the curently -
2665 active application override cursor. -
2666 -
2667 Every setOverrideCursor() must eventually be followed by a corresponding -
2668 restoreOverrideCursor(), otherwise the stack will never be emptied. -
2669 -
2670 Example: -
2671 \snippet code/src_gui_kernel_qapplication_x11.cpp 0 -
2672 -
2673 \sa overrideCursor(), restoreOverrideCursor(), changeOverrideCursor(), -
2674 QWidget::setCursor() -
2675*/ -
2676void QGuiApplication::setOverrideCursor(const QCursor &cursor) -
2677{ -
2678 qGuiApp->d_func()->cursor_list.prepend(cursor);
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.prepend(cursor);
-
2679 applyCursor(QGuiApplicationPrivate::window_list, cursor);
executed (the execution status of this line is deduced): applyCursor(QGuiApplicationPrivate::window_list, cursor);
-
2680}
executed: }
Execution Count:2
2
2681 -
2682/*! -
2683 \fn void QGuiApplication::restoreOverrideCursor() -
2684 -
2685 Undoes the last setOverrideCursor(). -
2686 -
2687 If setOverrideCursor() has been called twice, calling -
2688 restoreOverrideCursor() will activate the first cursor set. Calling this -
2689 function a second time restores the original widgets' cursors. -
2690 -
2691 \sa setOverrideCursor(), overrideCursor() -
2692*/ -
2693void QGuiApplication::restoreOverrideCursor() -
2694{ -
2695 if (qGuiApp->d_func()->cursor_list.isEmpty())
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2696 return;
never executed: return;
0
2697 qGuiApp->d_func()->cursor_list.removeFirst();
executed (the execution status of this line is deduced): (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.removeFirst();
-
2698 if (qGuiApp->d_func()->cursor_list.size() > 0) {
partially evaluated: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.size() > 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2699 QCursor c(qGuiApp->d_func()->cursor_list.value(0));
never executed (the execution status of this line is deduced): QCursor c((static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->cursor_list.value(0));
-
2700 applyCursor(QGuiApplicationPrivate::window_list, c);
never executed (the execution status of this line is deduced): applyCursor(QGuiApplicationPrivate::window_list, c);
-
2701 } else {
never executed: }
0
2702 applyWindowCursor(QGuiApplicationPrivate::window_list);
executed (the execution status of this line is deduced): applyWindowCursor(QGuiApplicationPrivate::window_list);
-
2703 }
executed: }
Execution Count:2
2
2704} -
2705#endif// QT_NO_CURSOR -
2706 -
2707/*! -
2708 Returns the application's style hints. -
2709 -
2710 The style hints encapsulate a set of platform dependent properties -
2711 such as double click intervals, full width selection and others. -
2712 -
2713 The hints can be used to integrate tighter with the underlying platform. -
2714 -
2715 \sa QStyleHints -
2716 */ -
2717QStyleHints *QGuiApplication::styleHints() -
2718{ -
2719 if (!qGuiApp->d_func()->styleHints)
evaluated: !(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints
TRUEFALSE
yes
Evaluation Count:111
yes
Evaluation Count:4828
111-4828
2720 qGuiApp->d_func()->styleHints = new QStyleHints();
executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints = new QStyleHints();
Execution Count:111
111
2721 return qGuiApp->d_func()->styleHints;
executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->styleHints;
Execution Count:4939
4939
2722} -
2723 -
2724/*! -
2725 Sets whether Qt should use the system's standard colors, fonts, etc., to -
2726 \a on. By default, this is true. -
2727 -
2728 This function must be called before creating the QGuiApplication object, like -
2729 this: -
2730 -
2731 \snippet code/src_gui_kernel_qapplication.cpp 6 -
2732 -
2733 \sa desktopSettingsAware() -
2734*/ -
2735void QGuiApplication::setDesktopSettingsAware(bool on) -
2736{ -
2737 QGuiApplicationPrivate::obey_desktop_settings = on;
executed (the execution status of this line is deduced): QGuiApplicationPrivate::obey_desktop_settings = on;
-
2738}
executed: }
Execution Count:1
1
2739 -
2740/*! -
2741 Returns true if Qt is set to use the system's standard colors, fonts, etc.; -
2742 otherwise returns false. The default is true. -
2743 -
2744 \sa setDesktopSettingsAware() -
2745*/ -
2746bool QGuiApplication::desktopSettingsAware() -
2747{ -
2748 return QGuiApplicationPrivate::obey_desktop_settings;
executed: return QGuiApplicationPrivate::obey_desktop_settings;
Execution Count:6667
6667
2749} -
2750 -
2751/*! -
2752 returns the input method. -
2753 -
2754 The input method returns properties about the state and position of -
2755 the virtual keyboard. It also provides information about the position of the -
2756 current focused input element. -
2757 -
2758 \sa QInputMethod -
2759 */ -
2760QInputMethod *QGuiApplication::inputMethod() -
2761{ -
2762 if (!qGuiApp->d_func()->inputMethod)
evaluated: !(static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod
TRUEFALSE
yes
Evaluation Count:276
yes
Evaluation Count:17812
276-17812
2763 qGuiApp->d_func()->inputMethod = new QInputMethod();
executed: (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod = new QInputMethod();
Execution Count:276
276
2764 return qGuiApp->d_func()->inputMethod;
executed: return (static_cast<QGuiApplication *>(QCoreApplication::instance()))->d_func()->inputMethod;
Execution Count:18088
18088
2765} -
2766 -
2767/*! -
2768 \fn void QGuiApplication::fontDatabaseChanged() -
2769 -
2770 This signal is emitted when application fonts are loaded or removed. -
2771 -
2772 \sa QFontDatabase::addApplicationFont(), -
2773 QFontDatabase::addApplicationFontFromData(), -
2774 QFontDatabase::removeAllApplicationFonts(), -
2775 QFontDatabase::removeApplicationFont() -
2776*/ -
2777 -
2778// These pixmaps approximate the images in the Windows User Interface Guidelines. -
2779 -
2780// XPM -
2781 -
2782static const char * const move_xpm[] = { -
2783"11 20 3 1", -
2784". c None", -
2785"a c #FFFFFF", -
2786"X c #000000", // X11 cursor is traditionally black -
2787"aa.........", -
2788"aXa........", -
2789"aXXa.......", -
2790"aXXXa......", -
2791"aXXXXa.....", -
2792"aXXXXXa....", -
2793"aXXXXXXa...", -
2794"aXXXXXXXa..", -
2795"aXXXXXXXXa.", -
2796"aXXXXXXXXXa", -
2797"aXXXXXXaaaa", -
2798"aXXXaXXa...", -
2799"aXXaaXXa...", -
2800"aXa..aXXa..", -
2801"aa...aXXa..", -
2802"a.....aXXa.", -
2803"......aXXa.", -
2804".......aXXa", -
2805".......aXXa", -
2806"........aa."}; -
2807 -
2808 -
2809/* XPM */ -
2810static const char * const copy_xpm[] = { -
2811"24 30 3 1", -
2812". c None", -
2813"a c #000000", -
2814"X c #FFFFFF", -
2815"XX......................", -
2816"XaX.....................", -
2817"XaaX....................", -
2818"XaaaX...................", -
2819"XaaaaX..................", -
2820"XaaaaaX.................", -
2821"XaaaaaaX................", -
2822"XaaaaaaaX...............", -
2823"XaaaaaaaaX..............", -
2824"XaaaaaaaaaX.............", -
2825"XaaaaaaXXXX.............", -
2826"XaaaXaaX................", -
2827"XaaXXaaX................", -
2828"XaX..XaaX...............", -
2829"XX...XaaX...............", -
2830"X.....XaaX..............", -
2831"......XaaX..............", -
2832".......XaaX.............", -
2833".......XaaX.............", -
2834"........XX...aaaaaaaaaaa", -
2835".............aXXXXXXXXXa", -
2836".............aXXXXXXXXXa", -
2837".............aXXXXaXXXXa", -
2838".............aXXXXaXXXXa", -
2839".............aXXaaaaaXXa", -
2840".............aXXXXaXXXXa", -
2841".............aXXXXaXXXXa", -
2842".............aXXXXXXXXXa", -
2843".............aXXXXXXXXXa", -
2844".............aaaaaaaaaaa"}; -
2845 -
2846/* XPM */ -
2847static const char * const link_xpm[] = { -
2848"24 30 3 1", -
2849". c None", -
2850"a c #000000", -
2851"X c #FFFFFF", -
2852"XX......................", -
2853"XaX.....................", -
2854"XaaX....................", -
2855"XaaaX...................", -
2856"XaaaaX..................", -
2857"XaaaaaX.................", -
2858"XaaaaaaX................", -
2859"XaaaaaaaX...............", -
2860"XaaaaaaaaX..............", -
2861"XaaaaaaaaaX.............", -
2862"XaaaaaaXXXX.............", -
2863"XaaaXaaX................", -
2864"XaaXXaaX................", -
2865"XaX..XaaX...............", -
2866"XX...XaaX...............", -
2867"X.....XaaX..............", -
2868"......XaaX..............", -
2869".......XaaX.............", -
2870".......XaaX.............", -
2871"........XX...aaaaaaaaaaa", -
2872".............aXXXXXXXXXa", -
2873".............aXXXaaaaXXa", -
2874".............aXXXXaaaXXa", -
2875".............aXXXaaaaXXa", -
2876".............aXXaaaXaXXa", -
2877".............aXXaaXXXXXa", -
2878".............aXXaXXXXXXa", -
2879".............aXXXaXXXXXa", -
2880".............aXXXXXXXXXa", -
2881".............aaaaaaaaaaa"}; -
2882 -
2883QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) -
2884{ -
2885 Q_UNUSED(cshape);
never executed (the execution status of this line is deduced): (void)cshape;;
-
2886 return QPixmap();
never executed: return QPixmap();
0
2887} -
2888 -
2889void QGuiApplicationPrivate::notifyThemeChanged() -
2890{ -
2891 if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)) {
never evaluated: !(applicationResourceFlags & ApplicationPaletteExplicitlySet)
0
2892 clearPalette();
never executed (the execution status of this line is deduced): clearPalette();
-
2893 initPalette();
never executed (the execution status of this line is deduced): initPalette();
-
2894 }
never executed: }
0
2895 if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
never evaluated: !(applicationResourceFlags & ApplicationFontExplicitlySet)
0
2896 QMutexLocker locker(&applicationFontMutex);
never executed (the execution status of this line is deduced): QMutexLocker locker(&applicationFontMutex);
-
2897 clearFontUnlocked();
never executed (the execution status of this line is deduced): clearFontUnlocked();
-
2898 initFontUnlocked();
never executed (the execution status of this line is deduced): initFontUnlocked();
-
2899 }
never executed: }
0
2900}
never executed: }
0
2901 -
2902#ifndef QT_NO_DRAGANDDROP -
2903void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag) -
2904{ -
2905 Q_UNUSED(drag)
never executed (the execution status of this line is deduced): (void)drag;
-
2906 -
2907}
never executed: }
0
2908#endif -
2909 -
2910const QDrawHelperGammaTables *QGuiApplicationPrivate::gammaTables() -
2911{ -
2912 QDrawHelperGammaTables *result = m_gammaTables.load();
never executed (the execution status of this line is deduced): QDrawHelperGammaTables *result = m_gammaTables.load();
-
2913 if (!result){
never evaluated: !result
0
2914 QDrawHelperGammaTables *tables = new QDrawHelperGammaTables(fontSmoothingGamma);
never executed (the execution status of this line is deduced): QDrawHelperGammaTables *tables = new QDrawHelperGammaTables(fontSmoothingGamma);
-
2915 if (!m_gammaTables.testAndSetRelease(0, tables))
never evaluated: !m_gammaTables.testAndSetRelease(0, tables)
0
2916 delete tables;
never executed: delete tables;
0
2917 result = m_gammaTables.load();
never executed (the execution status of this line is deduced): result = m_gammaTables.load();
-
2918 }
never executed: }
0
2919 return result;
never executed: return result;
0
2920} -
2921 -
2922void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object) -
2923{ -
2924 Q_Q(QGuiApplication);
executed (the execution status of this line is deduced): QGuiApplication * const q = q_func();
-
2925 -
2926 bool enabled = false;
executed (the execution status of this line is deduced): bool enabled = false;
-
2927 if (object) {
evaluated: object
TRUEFALSE
yes
Evaluation Count:1462
yes
Evaluation Count:45
45-1462
2928 QInputMethodQueryEvent query(Qt::ImEnabled);
executed (the execution status of this line is deduced): QInputMethodQueryEvent query(Qt::ImEnabled);
-
2929 QGuiApplication::sendEvent(object, &query);
executed (the execution status of this line is deduced): QGuiApplication::sendEvent(object, &query);
-
2930 enabled = query.value(Qt::ImEnabled).toBool();
executed (the execution status of this line is deduced): enabled = query.value(Qt::ImEnabled).toBool();
-
2931 }
executed: }
Execution Count:1462
1462
2932 -
2933 QPlatformInputContextPrivate::setInputMethodAccepted(enabled);
executed (the execution status of this line is deduced): QPlatformInputContextPrivate::setInputMethodAccepted(enabled);
-
2934 QPlatformInputContext *inputContext = platformIntegration()->inputContext();
executed (the execution status of this line is deduced): QPlatformInputContext *inputContext = platformIntegration()->inputContext();
-
2935 if (inputContext)
partially evaluated: inputContext
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1507
0-1507
2936 inputContext->setFocusObject(object);
never executed: inputContext->setFocusObject(object);
0
2937 emit q->focusObjectChanged(object);
executed (the execution status of this line is deduced): q->focusObjectChanged(object);
-
2938}
executed: }
Execution Count:1507
1507
2939 -
2940int QGuiApplicationPrivate::mouseEventCaps(QMouseEvent *event) -
2941{ -
2942 return event->caps;
never executed: return event->caps;
0
2943} -
2944 -
2945QVector2D QGuiApplicationPrivate::mouseEventVelocity(QMouseEvent *event) -
2946{ -
2947 return event->velocity;
never executed: return event->velocity;
0
2948} -
2949 -
2950void QGuiApplicationPrivate::setMouseEventCapsAndVelocity(QMouseEvent *event, int caps, const QVector2D &velocity) -
2951{ -
2952 event->caps = caps;
never executed (the execution status of this line is deduced): event->caps = caps;
-
2953 event->velocity = velocity;
never executed (the execution status of this line is deduced): event->velocity = velocity;
-
2954}
never executed: }
0
2955 -
2956void QGuiApplicationPrivate::setMouseEventCapsAndVelocity(QMouseEvent *event, QMouseEvent *other) -
2957{ -
2958 event->caps = other->caps;
never executed (the execution status of this line is deduced): event->caps = other->caps;
-
2959 event->velocity = other->velocity;
never executed (the execution status of this line is deduced): event->velocity = other->velocity;
-
2960}
never executed: }
0
2961 -
2962 -
2963#include "moc_qguiapplication.cpp" -
2964 -
2965QT_END_NAMESPACE -
2966 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial