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