| 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 "qapplication_p.h" | - |
| 43 | #include "qcolormap.h" | - |
| 44 | #include "qpalette.h" | - |
| 45 | #include "qpixmapcache.h" | - |
| 46 | #ifndef QT_NO_CURSOR | - |
| 47 | #include "private/qcursor_p.h" | - |
| 48 | #endif | - |
| 49 | #include "qscreen.h" | - |
| 50 | | - |
| 51 | #include "private/qwidget_p.h" | - |
| 52 | #include "private/qevent_p.h" | - |
| 53 | | - |
| 54 | #include <qpa/qplatformintegrationfactory_p.h> | - |
| 55 | #include <qdesktopwidget.h> | - |
| 56 | #include <qpa/qplatformcursor.h> | - |
| 57 | #include <qpa/qplatformtheme.h> | - |
| 58 | | - |
| 59 | #include <qdebug.h> | - |
| 60 | #include <qpa/qwindowsysteminterface.h> | - |
| 61 | #include <qpa/qwindowsysteminterface_p.h> | - |
| 62 | #include <qpa/qplatformintegration.h> | - |
| 63 | | - |
| 64 | #include "qdesktopwidget_qpa_p.h" | - |
| 65 | #include "qwidgetwindow_qpa_p.h" | - |
| 66 | #include "qtooltip.h" | - |
| 67 | | - |
| 68 | #ifdef Q_OS_WIN | - |
| 69 | # include <QtCore/qt_windows.h> // for qt_win_display_dc() | - |
| 70 | #endif | - |
| 71 | | - |
| 72 | QT_BEGIN_NAMESPACE | - |
| 73 | | - |
| 74 | static QString appFont; | - |
| 75 | static bool popupGrabOk; | - |
| 76 | extern QWidget *qt_button_down; | - |
| 77 | extern QWidget *qt_popup_down; | - |
| 78 | extern bool qt_replay_popup_mouse_event; | - |
| 79 | int openPopupCount = 0; | - |
| 80 | extern QPointer<QWidget> qt_last_mouse_receiver; | - |
| 81 | | - |
| 82 | void QApplicationPrivate::createEventDispatcher() | - |
| 83 | { | - |
| 84 | QGuiApplicationPrivate::createEventDispatcher(); executed (the execution status of this line is deduced): QGuiApplicationPrivate::createEventDispatcher(); | - |
| 85 | } executed: }Execution Count:215 | 215 |
| 86 | | - |
| 87 | bool qt_try_modal(QWidget *widget, QEvent::Type type) | - |
| 88 | { | - |
| 89 | QWidget * top = 0; executed (the execution status of this line is deduced): QWidget * top = 0; | - |
| 90 | | - |
| 91 | if (QApplicationPrivate::tryModalHelper(widget, &top)) partially evaluated: QApplicationPrivate::tryModalHelper(widget, &top)| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 92 | return true; executed: return true;Execution Count:3 | 3 |
| 93 | | - |
| 94 | bool block_event = false; never executed (the execution status of this line is deduced): bool block_event = false; | - |
| 95 | bool paint_event = false; never executed (the execution status of this line is deduced): bool paint_event = false; | - |
| 96 | | - |
| 97 | switch (type) { | - |
| 98 | #if 0 | - |
| 99 | case QEvent::Focus: | - |
| 100 | if (!static_cast<QWSFocusEvent*>(event)->simpleData.get_focus) | - |
| 101 | break; | - |
| 102 | // drop through | - |
| 103 | #endif | - |
| 104 | case QEvent::MouseButtonPress: // disallow mouse/key events | - |
| 105 | case QEvent::MouseButtonRelease: | - |
| 106 | case QEvent::MouseMove: | - |
| 107 | case QEvent::KeyPress: | - |
| 108 | case QEvent::KeyRelease: | - |
| 109 | block_event = true; never executed (the execution status of this line is deduced): block_event = true; | - |
| 110 | break; | 0 |
| 111 | default: | - |
| 112 | break; | 0 |
| 113 | } | - |
| 114 | | - |
| 115 | if ((block_event || paint_event) && top->parentWidget() == 0) never evaluated: block_event never evaluated: paint_event never evaluated: top->parentWidget() == 0 | 0 |
| 116 | top->raise(); never executed: top->raise(); | 0 |
| 117 | | - |
| 118 | return !block_event; never executed: return !block_event; | 0 |
| 119 | } | - |
| 120 | | - |
| 121 | bool QApplicationPrivate::modalState() | - |
| 122 | { | - |
| 123 | return !self->modalWindowList.isEmpty(); executed: return !self->modalWindowList.isEmpty();Execution Count:479 | 479 |
| 124 | } | - |
| 125 | | - |
| 126 | QWidget *qt_tlw_for_window(QWindow *wnd) | - |
| 127 | { | - |
| 128 | if (wnd) evaluated: wnd| yes Evaluation Count:1685 | yes Evaluation Count:44 |
| 44-1685 |
| 129 | foreach (QWidget *tlw, qApp->topLevelWidgets()) executed (the execution status of this line is deduced): for (QForeachContainer<__typeof__((static_cast<QApplication *>(QCoreApplication::instance()))->topLevelWidgets())> _container_((static_cast<QApplication *>(QCoreApplication::instance()))->topLevelWidgets()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QWidget *tlw = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
| 130 | if (tlw->windowHandle() == wnd) evaluated: tlw->windowHandle() == wnd| yes Evaluation Count:1681 | yes Evaluation Count:1564 |
| 1564-1681 |
| 131 | return tlw; executed: return tlw;Execution Count:1681 | 1681 |
| 132 | return 0; executed: return 0;Execution Count:48 | 48 |
| 133 | } | - |
| 134 | | - |
| 135 | void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous) | - |
| 136 | { | - |
| 137 | Q_UNUSED(previous); executed (the execution status of this line is deduced): (void)previous;; | - |
| 138 | QWindow *wnd = QGuiApplicationPrivate::focus_window; executed (the execution status of this line is deduced): QWindow *wnd = QGuiApplicationPrivate::focus_window; | - |
| 139 | if (inPopupMode()) // some delayed focus event to ignore evaluated: inPopupMode()| yes Evaluation Count:65 | yes Evaluation Count:1729 |
| 65-1729 |
| 140 | return; executed: return;Execution Count:65 | 65 |
| 141 | QWidget *tlw = qt_tlw_for_window(wnd); executed (the execution status of this line is deduced): QWidget *tlw = qt_tlw_for_window(wnd); | - |
| 142 | QApplication::setActiveWindow(tlw); executed (the execution status of this line is deduced): QApplication::setActiveWindow(tlw); | - |
| 143 | } executed: }Execution Count:1729 | 1729 |
| 144 | | - |
| 145 | static void ungrabKeyboardForPopup(QWidget *popup) | - |
| 146 | { | - |
| 147 | if (QWidget::keyboardGrabber()) evaluated: QWidget::keyboardGrabber()| yes Evaluation Count:1 | yes Evaluation Count:88 |
| 1-88 |
| 148 | qt_widget_private(QWidget::keyboardGrabber())->stealKeyboardGrab(true); executed: qt_widget_private(QWidget::keyboardGrabber())->stealKeyboardGrab(true);Execution Count:1 | 1 |
| 149 | else | - |
| 150 | qt_widget_private(popup)->stealKeyboardGrab(false); executed: qt_widget_private(popup)->stealKeyboardGrab(false);Execution Count:88 | 88 |
| 151 | } | - |
| 152 | | - |
| 153 | static void ungrabMouseForPopup(QWidget *popup) | - |
| 154 | { | - |
| 155 | if (QWidget::mouseGrabber()) partially evaluated: QWidget::mouseGrabber()| no Evaluation Count:0 | yes Evaluation Count:89 |
| 0-89 |
| 156 | qt_widget_private(QWidget::mouseGrabber())->stealMouseGrab(true); never executed: qt_widget_private(QWidget::mouseGrabber())->stealMouseGrab(true); | 0 |
| 157 | else | - |
| 158 | qt_widget_private(popup)->stealMouseGrab(false); executed: qt_widget_private(popup)->stealMouseGrab(false);Execution Count:89 | 89 |
| 159 | } | - |
| 160 | | - |
| 161 | static void grabForPopup(QWidget *popup) | - |
| 162 | { | - |
| 163 | Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created)); executed (the execution status of this line is deduced): qt_noop(); | - |
| 164 | popupGrabOk = qt_widget_private(popup)->stealKeyboardGrab(true); executed (the execution status of this line is deduced): popupGrabOk = qt_widget_private(popup)->stealKeyboardGrab(true); | - |
| 165 | if (popupGrabOk) { partially evaluated: popupGrabOk| yes Evaluation Count:110 | no Evaluation Count:0 |
| 0-110 |
| 166 | popupGrabOk = qt_widget_private(popup)->stealMouseGrab(true); executed (the execution status of this line is deduced): popupGrabOk = qt_widget_private(popup)->stealMouseGrab(true); | - |
| 167 | if (!popupGrabOk) { partially evaluated: !popupGrabOk| no Evaluation Count:0 | yes Evaluation Count:110 |
| 0-110 |
| 168 | // transfer grab back to the keyboard grabber if any | - |
| 169 | ungrabKeyboardForPopup(popup); never executed (the execution status of this line is deduced): ungrabKeyboardForPopup(popup); | - |
| 170 | } | 0 |
| 171 | } executed: }Execution Count:110 | 110 |
| 172 | } executed: }Execution Count:110 | 110 |
| 173 | | - |
| 174 | void QApplicationPrivate::closePopup(QWidget *popup) | - |
| 175 | { | - |
| 176 | if (!popupWidgets) evaluated: !popupWidgets| yes Evaluation Count:622 | yes Evaluation Count:114 |
| 114-622 |
| 177 | return; executed: return;Execution Count:622 | 622 |
| 178 | popupWidgets->removeAll(popup); executed (the execution status of this line is deduced): popupWidgets->removeAll(popup); | - |
| 179 | | - |
| 180 | if (popup == qt_popup_down) { partially evaluated: popup == qt_popup_down| no Evaluation Count:0 | yes Evaluation Count:114 |
| 0-114 |
| 181 | qt_button_down = 0; never executed (the execution status of this line is deduced): qt_button_down = 0; | - |
| 182 | qt_popup_down = 0; never executed (the execution status of this line is deduced): qt_popup_down = 0; | - |
| 183 | } | 0 |
| 184 | | - |
| 185 | if (QApplicationPrivate::popupWidgets->count() == 0) { // this was the last popup evaluated: QApplicationPrivate::popupWidgets->count() == 0| yes Evaluation Count:89 | yes Evaluation Count:25 |
| 25-89 |
| 186 | delete QApplicationPrivate::popupWidgets; executed (the execution status of this line is deduced): delete QApplicationPrivate::popupWidgets; | - |
| 187 | QApplicationPrivate::popupWidgets = 0; executed (the execution status of this line is deduced): QApplicationPrivate::popupWidgets = 0; | - |
| 188 | | - |
| 189 | if (popupGrabOk) { partially evaluated: popupGrabOk| yes Evaluation Count:89 | no Evaluation Count:0 |
| 0-89 |
| 190 | popupGrabOk = false; executed (the execution status of this line is deduced): popupGrabOk = false; | - |
| 191 | | - |
| 192 | if (popup->geometry().contains(QPoint(QGuiApplicationPrivate::mousePressX, evaluated: popup->geometry().contains(QPoint(QGuiApplicationPrivate::mousePressX, QGuiApplicationPrivate::mousePressY))| yes Evaluation Count:11 | yes Evaluation Count:78 |
| 11-78 |
| 193 | QGuiApplicationPrivate::mousePressY)) evaluated: popup->geometry().contains(QPoint(QGuiApplicationPrivate::mousePressX, QGuiApplicationPrivate::mousePressY))| yes Evaluation Count:11 | yes Evaluation Count:78 |
| 11-78 |
| 194 | || popup->testAttribute(Qt::WA_NoMouseReplay)) { partially evaluated: popup->testAttribute(Qt::WA_NoMouseReplay)| no Evaluation Count:0 | yes Evaluation Count:78 |
| 0-78 |
| 195 | // mouse release event or inside | - |
| 196 | qt_replay_popup_mouse_event = false; executed (the execution status of this line is deduced): qt_replay_popup_mouse_event = false; | - |
| 197 | } else { // mouse press event executed: }Execution Count:11 | 11 |
| 198 | QGuiApplicationPrivate::mousePressTime -= 10000; // avoid double click executed (the execution status of this line is deduced): QGuiApplicationPrivate::mousePressTime -= 10000; | - |
| 199 | qt_replay_popup_mouse_event = true; executed (the execution status of this line is deduced): qt_replay_popup_mouse_event = true; | - |
| 200 | } executed: }Execution Count:78 | 78 |
| 201 | | - |
| 202 | // transfer grab back to mouse grabber if any, otherwise release the grab | - |
| 203 | ungrabMouseForPopup(popup); executed (the execution status of this line is deduced): ungrabMouseForPopup(popup); | - |
| 204 | | - |
| 205 | // transfer grab back to keyboard grabber if any, otherwise release the grab | - |
| 206 | ungrabKeyboardForPopup(popup); executed (the execution status of this line is deduced): ungrabKeyboardForPopup(popup); | - |
| 207 | } executed: }Execution Count:89 | 89 |
| 208 | | - |
| 209 | if (active_window) { evaluated: active_window| yes Evaluation Count:55 | yes Evaluation Count:34 |
| 34-55 |
| 210 | if (QWidget *fw = active_window->focusWidget()) { evaluated: QWidget *fw = active_window->focusWidget()| yes Evaluation Count:43 | yes Evaluation Count:12 |
| 12-43 |
| 211 | if (fw != QApplication::focusWidget()) { evaluated: fw != QApplication::focusWidget()| yes Evaluation Count:3 | yes Evaluation Count:40 |
| 3-40 |
| 212 | fw->setFocus(Qt::PopupFocusReason); executed (the execution status of this line is deduced): fw->setFocus(Qt::PopupFocusReason); | - |
| 213 | } else { executed: }Execution Count:3 | 3 |
| 214 | QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason); executed (the execution status of this line is deduced): QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason); | - |
| 215 | QCoreApplication::sendEvent(fw, &e); executed (the execution status of this line is deduced): QCoreApplication::sendEvent(fw, &e); | - |
| 216 | } executed: }Execution Count:40 | 40 |
| 217 | } | - |
| 218 | } executed: }Execution Count:55 | 55 |
| 219 | | - |
| 220 | } else { executed: }Execution Count:89 | 89 |
| 221 | // A popup was closed, so the previous popup gets the focus. | - |
| 222 | QWidget* aw = QApplicationPrivate::popupWidgets->last(); executed (the execution status of this line is deduced): QWidget* aw = QApplicationPrivate::popupWidgets->last(); | - |
| 223 | if (QWidget *fw = aw->focusWidget()) evaluated: QWidget *fw = aw->focusWidget()| yes Evaluation Count:3 | yes Evaluation Count:22 |
| 3-22 |
| 224 | fw->setFocus(Qt::PopupFocusReason); executed: fw->setFocus(Qt::PopupFocusReason);Execution Count:3 | 3 |
| 225 | | - |
| 226 | if (QApplicationPrivate::popupWidgets->count() == 1) // grab mouse/keyboard evaluated: QApplicationPrivate::popupWidgets->count() == 1| yes Evaluation Count:21 | yes Evaluation Count:4 |
| 4-21 |
| 227 | grabForPopup(aw); executed: grabForPopup(aw);Execution Count:21 | 21 |
| 228 | } executed: }Execution Count:25 | 25 |
| 229 | | - |
| 230 | } | - |
| 231 | | - |
| 232 | void QApplicationPrivate::openPopup(QWidget *popup) | - |
| 233 | { | - |
| 234 | openPopupCount++; executed (the execution status of this line is deduced): openPopupCount++; | - |
| 235 | if (!popupWidgets) // create list evaluated: !popupWidgets| yes Evaluation Count:89 | yes Evaluation Count:7 |
| 7-89 |
| 236 | popupWidgets = new QWidgetList; executed: popupWidgets = new QWidgetList;Execution Count:89 | 89 |
| 237 | popupWidgets->append(popup); // add to end of list executed (the execution status of this line is deduced): popupWidgets->append(popup); | - |
| 238 | | - |
| 239 | if (QApplicationPrivate::popupWidgets->count() == 1) // grab mouse/keyboard evaluated: QApplicationPrivate::popupWidgets->count() == 1| yes Evaluation Count:89 | yes Evaluation Count:7 |
| 7-89 |
| 240 | grabForPopup(popup); executed: grabForPopup(popup);Execution Count:89 | 89 |
| 241 | | - |
| 242 | // popups are not focus-handled by the window system (the first | - |
| 243 | // popup grabbed the keyboard), so we have to do that manually: A | - |
| 244 | // new popup gets the focus | - |
| 245 | if (popup->focusWidget()) { evaluated: popup->focusWidget()| yes Evaluation Count:3 | yes Evaluation Count:93 |
| 3-93 |
| 246 | popup->focusWidget()->setFocus(Qt::PopupFocusReason); executed (the execution status of this line is deduced): popup->focusWidget()->setFocus(Qt::PopupFocusReason); | - |
| 247 | } else if (popupWidgets->count() == 1) { // this was the first popup executed: }Execution Count:3 evaluated: popupWidgets->count() == 1| yes Evaluation Count:86 | yes Evaluation Count:7 |
| 3-86 |
| 248 | if (QWidget *fw = QApplication::focusWidget()) { evaluated: QWidget *fw = QApplication::focusWidget()| yes Evaluation Count:55 | yes Evaluation Count:31 |
| 31-55 |
| 249 | QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); executed (the execution status of this line is deduced): QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); | - |
| 250 | QApplication::sendEvent(fw, &e); executed (the execution status of this line is deduced): QApplication::sendEvent(fw, &e); | - |
| 251 | } executed: }Execution Count:55 | 55 |
| 252 | } executed: }Execution Count:86 | 86 |
| 253 | } | - |
| 254 | | - |
| 255 | void QApplicationPrivate::initializeMultitouch_sys() | - |
| 256 | { | - |
| 257 | } | - |
| 258 | | - |
| 259 | void QApplicationPrivate::cleanupMultitouch_sys() | - |
| 260 | { | - |
| 261 | } | - |
| 262 | | - |
| 263 | static void setPossiblePalette(const QPalette *palette, const char *className) | - |
| 264 | { | - |
| 265 | if (palette == 0) partially evaluated: palette == 0| yes Evaluation Count:832 | no Evaluation Count:0 |
| 0-832 |
| 266 | return; executed: return;Execution Count:832 | 832 |
| 267 | QApplicationPrivate::setPalette_helper(*palette, className, false); never executed (the execution status of this line is deduced): QApplicationPrivate::setPalette_helper(*palette, className, false); | - |
| 268 | } | 0 |
| 269 | | - |
| 270 | | - |
| 271 | void QApplicationPrivate::initializeWidgetPaletteHash() | - |
| 272 | { | - |
| 273 | QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme(); executed (the execution status of this line is deduced): QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme(); | - |
| 274 | if (!platformTheme) partially evaluated: !platformTheme| no Evaluation Count:0 | yes Evaluation Count:64 |
| 0-64 |
| 275 | return; | 0 |
| 276 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton"); | - |
| 277 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton"); | - |
| 278 | setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView"); | - |
| 279 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView"); | - |
| 280 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPelette), "QMessageBoxLabel"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPelette), "QMessageBoxLabel"); | - |
| 281 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar"); | - |
| 282 | setPossiblePalette(platformTheme->palette(QPlatformTheme::LabelPalette), "QLabel"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::LabelPalette), "QLabel"); | - |
| 283 | setPossiblePalette(platformTheme->palette(QPlatformTheme::GroupBoxPalette), "QGroupBox"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::GroupBoxPalette), "QGroupBox"); | - |
| 284 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuPalette), "QMenu"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuPalette), "QMenu"); | - |
| 285 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuBarPalette), "QMenuBar"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuBarPalette), "QMenuBar"); | - |
| 286 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextEdit"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextEdit"); | - |
| 287 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextControl"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextControl"); | - |
| 288 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextLineEditPalette), "QLineEdit"); executed (the execution status of this line is deduced): setPossiblePalette(platformTheme->palette(QPlatformTheme::TextLineEditPalette), "QLineEdit"); | - |
| 289 | } executed: }Execution Count:64 | 64 |
| 290 | | - |
| 291 | void QApplicationPrivate::initializeWidgetFontHash() | - |
| 292 | { | - |
| 293 | const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); executed (the execution status of this line is deduced): const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); | - |
| 294 | if (!theme) partially evaluated: !theme| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 295 | return; | 0 |
| 296 | FontHash *fontHash = qt_app_fonts_hash(); executed (the execution status of this line is deduced): FontHash *fontHash = qt_app_fonts_hash(); | - |
| 297 | if (const QFont *font = theme->font(QPlatformTheme::MenuFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::MenuFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 298 | fontHash->insert(QByteArrayLiteral("QMenu"), *font); never executed: fontHash->insert(QByteArray("QMenu", sizeof("QMenu") - 1), *font); | 0 |
| 299 | if (const QFont *font = theme->font(QPlatformTheme::MenuBarFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::MenuBarFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 300 | fontHash->insert(QByteArrayLiteral("QMenuBar"), *font); never executed: fontHash->insert(QByteArray("QMenuBar", sizeof("QMenuBar") - 1), *font); | 0 |
| 301 | if (const QFont *font = theme->font(QPlatformTheme::MenuItemFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::MenuItemFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 302 | fontHash->insert(QByteArrayLiteral("QMenuItem"), *font); never executed: fontHash->insert(QByteArray("QMenuItem", sizeof("QMenuItem") - 1), *font); | 0 |
| 303 | if (const QFont *font = theme->font(QPlatformTheme::MessageBoxFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::MessageBoxFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 304 | fontHash->insert(QByteArrayLiteral("QMessageBox"), *font); never executed: fontHash->insert(QByteArray("QMessageBox", sizeof("QMessageBox") - 1), *font); | 0 |
| 305 | if (const QFont *font = theme->font(QPlatformTheme::LabelFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::LabelFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 306 | fontHash->insert(QByteArrayLiteral("QLabel"), *font); never executed: fontHash->insert(QByteArray("QLabel", sizeof("QLabel") - 1), *font); | 0 |
| 307 | if (const QFont *font = theme->font(QPlatformTheme::TipLabelFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::TipLabelFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 308 | fontHash->insert(QByteArrayLiteral("QTipLabel"), *font); never executed: fontHash->insert(QByteArray("QTipLabel", sizeof("QTipLabel") - 1), *font); | 0 |
| 309 | if (const QFont *font = theme->font(QPlatformTheme::TitleBarFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::TitleBarFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 310 | fontHash->insert(QByteArrayLiteral("QTitleBar"), *font); never executed: fontHash->insert(QByteArray("QTitleBar", sizeof("QTitleBar") - 1), *font); | 0 |
| 311 | if (const QFont *font = theme->font(QPlatformTheme::StatusBarFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::StatusBarFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 312 | fontHash->insert(QByteArrayLiteral("QStatusBar"), *font); never executed: fontHash->insert(QByteArray("QStatusBar", sizeof("QStatusBar") - 1), *font); | 0 |
| 313 | if (const QFont *font = theme->font(QPlatformTheme::MdiSubWindowTitleFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::MdiSubWindowTitleFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 314 | fontHash->insert(QByteArrayLiteral("QMdiSubWindowTitleBar"), *font); never executed: fontHash->insert(QByteArray("QMdiSubWindowTitleBar", sizeof("QMdiSubWindowTitleBar") - 1), *font); | 0 |
| 315 | if (const QFont *font = theme->font(QPlatformTheme::DockWidgetTitleFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::DockWidgetTitleFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 316 | fontHash->insert(QByteArrayLiteral("QDockWidgetTitle"), *font); never executed: fontHash->insert(QByteArray("QDockWidgetTitle", sizeof("QDockWidgetTitle") - 1), *font); | 0 |
| 317 | if (const QFont *font = theme->font(QPlatformTheme::PushButtonFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::PushButtonFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 318 | fontHash->insert(QByteArrayLiteral("QPushButton"), *font); never executed: fontHash->insert(QByteArray("QPushButton", sizeof("QPushButton") - 1), *font); | 0 |
| 319 | if (const QFont *font = theme->font(QPlatformTheme::ToolButtonFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::ToolButtonFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 320 | fontHash->insert(QByteArrayLiteral("QToolButton"), *font); never executed: fontHash->insert(QByteArray("QToolButton", sizeof("QToolButton") - 1), *font); | 0 |
| 321 | if (const QFont *font = theme->font(QPlatformTheme::ItemViewFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::ItemViewFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 322 | fontHash->insert(QByteArrayLiteral("QAbstractItemView"), *font); never executed: fontHash->insert(QByteArray("QAbstractItemView", sizeof("QAbstractItemView") - 1), *font); | 0 |
| 323 | if (const QFont *font = theme->font(QPlatformTheme::ListViewFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::ListViewFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 324 | fontHash->insert(QByteArrayLiteral("QListViewFont"), *font); never executed: fontHash->insert(QByteArray("QListViewFont", sizeof("QListViewFont") - 1), *font); | 0 |
| 325 | if (const QFont *font = theme->font(QPlatformTheme::HeaderViewFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::HeaderViewFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 326 | fontHash->insert(QByteArrayLiteral("QHeaderViewFont"), *font); never executed: fontHash->insert(QByteArray("QHeaderViewFont", sizeof("QHeaderViewFont") - 1), *font); | 0 |
| 327 | if (const QFont *font = theme->font(QPlatformTheme::ListBoxFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::ListBoxFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 328 | fontHash->insert(QByteArrayLiteral("QListBox"), *font); never executed: fontHash->insert(QByteArray("QListBox", sizeof("QListBox") - 1), *font); | 0 |
| 329 | if (const QFont *font = theme->font(QPlatformTheme::ComboMenuItemFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::ComboMenuItemFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 330 | fontHash->insert(QByteArrayLiteral("QComboMenuItemFont"), *font); never executed: fontHash->insert(QByteArray("QComboMenuItemFont", sizeof("QComboMenuItemFont") - 1), *font); | 0 |
| 331 | if (const QFont *font = theme->font(QPlatformTheme::ComboLineEditFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::ComboLineEditFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 332 | fontHash->insert(QByteArrayLiteral("QComboLineEditFont"), *font); never executed: fontHash->insert(QByteArray("QComboLineEditFont", sizeof("QComboLineEditFont") - 1), *font); | 0 |
| 333 | if (const QFont *font = theme->font(QPlatformTheme::SmallFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::SmallFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 334 | fontHash->insert(QByteArrayLiteral("QSmallFont"), *font); never executed: fontHash->insert(QByteArray("QSmallFont", sizeof("QSmallFont") - 1), *font); | 0 |
| 335 | if (const QFont *font = theme->font(QPlatformTheme::MiniFont)) partially evaluated: const QFont *font = theme->font(QPlatformTheme::MiniFont)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 336 | fontHash->insert(QByteArrayLiteral("QMiniFont"), *font); never executed: fontHash->insert(QByteArray("QMiniFont", sizeof("QMiniFont") - 1), *font); | 0 |
| 337 | } executed: }Execution Count:215 | 215 |
| 338 | | - |
| 339 | #ifndef QT_NO_WHEELEVENT | - |
| 340 | void QApplication::setWheelScrollLines(int lines) | - |
| 341 | { | - |
| 342 | QApplicationPrivate::wheel_scroll_lines = lines; executed (the execution status of this line is deduced): QApplicationPrivate::wheel_scroll_lines = lines; | - |
| 343 | } executed: }Execution Count:8 | 8 |
| 344 | | - |
| 345 | int QApplication::wheelScrollLines() | - |
| 346 | { | - |
| 347 | return QApplicationPrivate::wheel_scroll_lines; executed: return QApplicationPrivate::wheel_scroll_lines;Execution Count:30 | 30 |
| 348 | } | - |
| 349 | #endif | - |
| 350 | | - |
| 351 | static inline int uiEffectToFlag(Qt::UIEffect effect) | - |
| 352 | { | - |
| 353 | switch (effect) { | - |
| 354 | case Qt::UI_General: | - |
| 355 | return QPlatformTheme::GeneralUiEffect; never executed: return QPlatformTheme::GeneralUiEffect; | 0 |
| 356 | case Qt::UI_AnimateMenu: | - |
| 357 | return QPlatformTheme::AnimateMenuUiEffect; executed: return QPlatformTheme::AnimateMenuUiEffect;Execution Count:2 | 2 |
| 358 | case Qt::UI_FadeMenu: | - |
| 359 | return QPlatformTheme::FadeMenuUiEffect; never executed: return QPlatformTheme::FadeMenuUiEffect; | 0 |
| 360 | case Qt::UI_AnimateCombo: | - |
| 361 | return QPlatformTheme::AnimateComboUiEffect; never executed: return QPlatformTheme::AnimateComboUiEffect; | 0 |
| 362 | case Qt::UI_AnimateTooltip: | - |
| 363 | return QPlatformTheme::AnimateTooltipUiEffect; never executed: return QPlatformTheme::AnimateTooltipUiEffect; | 0 |
| 364 | case Qt::UI_FadeTooltip: | - |
| 365 | return QPlatformTheme::FadeTooltipUiEffect; never executed: return QPlatformTheme::FadeTooltipUiEffect; | 0 |
| 366 | case Qt::UI_AnimateToolBox: | - |
| 367 | return QPlatformTheme::AnimateToolBoxUiEffect; never executed: return QPlatformTheme::AnimateToolBoxUiEffect; | 0 |
| 368 | } | - |
| 369 | return 0; never executed: return 0; | 0 |
| 370 | } | - |
| 371 | | - |
| 372 | void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) | - |
| 373 | { | - |
| 374 | int effectFlags = uiEffectToFlag(effect); executed (the execution status of this line is deduced): int effectFlags = uiEffectToFlag(effect); | - |
| 375 | if (enable) { partially evaluated: enable| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 376 | if (effectFlags & QPlatformTheme::FadeMenuUiEffect) never evaluated: effectFlags & QPlatformTheme::FadeMenuUiEffect | 0 |
| 377 | effectFlags |= QPlatformTheme::AnimateMenuUiEffect; never executed: effectFlags |= QPlatformTheme::AnimateMenuUiEffect; | 0 |
| 378 | if (effectFlags & QPlatformTheme::FadeTooltipUiEffect) never evaluated: effectFlags & QPlatformTheme::FadeTooltipUiEffect | 0 |
| 379 | effectFlags |= QPlatformTheme::AnimateTooltipUiEffect; never executed: effectFlags |= QPlatformTheme::AnimateTooltipUiEffect; | 0 |
| 380 | QApplicationPrivate::enabledAnimations |= effectFlags; never executed (the execution status of this line is deduced): QApplicationPrivate::enabledAnimations |= effectFlags; | - |
| 381 | } else { | 0 |
| 382 | QApplicationPrivate::enabledAnimations &= ~effectFlags; executed (the execution status of this line is deduced): QApplicationPrivate::enabledAnimations &= ~effectFlags; | - |
| 383 | } executed: }Execution Count:2 | 2 |
| 384 | } | - |
| 385 | | - |
| 386 | bool QApplication::isEffectEnabled(Qt::UIEffect effect) | - |
| 387 | { | - |
| 388 | return QColormap::instance().depth() >= 16 executed: return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));Execution Count:79 | 79 |
| 389 | && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) executed: return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));Execution Count:79 | 79 |
| 390 | && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect)); executed: return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));Execution Count:79 | 79 |
| 391 | } | - |
| 392 | | - |
| 393 | QWidget *QApplication::topLevelAt(const QPoint &pos) | - |
| 394 | { | - |
| 395 | QList<QScreen *> screens = QGuiApplication::screens(); executed (the execution status of this line is deduced): QList<QScreen *> screens = QGuiApplication::screens(); | - |
| 396 | QList<QScreen *>::const_iterator screen = screens.constBegin(); executed (the execution status of this line is deduced): QList<QScreen *>::const_iterator screen = screens.constBegin(); | - |
| 397 | QList<QScreen *>::const_iterator end = screens.constEnd(); executed (the execution status of this line is deduced): QList<QScreen *>::const_iterator end = screens.constEnd(); | - |
| 398 | | - |
| 399 | while (screen != end) { partially evaluated: screen != end| yes Evaluation Count:156 | no Evaluation Count:0 |
| 0-156 |
| 400 | if ((*screen)->geometry().contains(pos)) { partially evaluated: (*screen)->geometry().contains(pos)| yes Evaluation Count:156 | no Evaluation Count:0 |
| 0-156 |
| 401 | QWidgetWindow *w = qobject_cast<QWidgetWindow *>((*screen)->handle()->topLevelAt(pos)); executed (the execution status of this line is deduced): QWidgetWindow *w = qobject_cast<QWidgetWindow *>((*screen)->handle()->topLevelAt(pos)); | - |
| 402 | return w ? w->widget() : 0; executed: return w ? w->widget() : 0;Execution Count:156 | 156 |
| 403 | } | - |
| 404 | ++screen; never executed (the execution status of this line is deduced): ++screen; | - |
| 405 | } | 0 |
| 406 | return 0; never executed: return 0; | 0 |
| 407 | } | - |
| 408 | | - |
| 409 | void QApplication::beep() | - |
| 410 | { | - |
| 411 | } | - |
| 412 | | - |
| 413 | void QApplication::alert(QWidget *, int) | - |
| 414 | { | - |
| 415 | } | - |
| 416 | | - |
| 417 | void qt_init(QApplicationPrivate *priv, int type) | - |
| 418 | { | - |
| 419 | Q_UNUSED(priv); executed (the execution status of this line is deduced): (void)priv;; | - |
| 420 | Q_UNUSED(type); executed (the execution status of this line is deduced): (void)type;; | - |
| 421 | | - |
| 422 | QColormap::initialize(); executed (the execution status of this line is deduced): QColormap::initialize(); | - |
| 423 | | - |
| 424 | #ifndef QT_NO_TOOLTIP | - |
| 425 | if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette)) partially evaluated: const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette)| no Evaluation Count:0 | yes Evaluation Count:215 |
| 0-215 |
| 426 | QToolTip::setPalette(*toolTipPalette); never executed: QToolTip::setPalette(*toolTipPalette); | 0 |
| 427 | #endif | - |
| 428 | | - |
| 429 | QApplicationPrivate::initializeWidgetFontHash(); executed (the execution status of this line is deduced): QApplicationPrivate::initializeWidgetFontHash(); | - |
| 430 | } executed: }Execution Count:215 | 215 |
| 431 | | - |
| 432 | #ifdef Q_OS_WIN | - |
| 433 | // #fixme: Remove. | - |
| 434 | static HDC displayDC = 0; // display device context | - |
| 435 | | - |
| 436 | Q_WIDGETS_EXPORT HDC qt_win_display_dc() // get display DC | - |
| 437 | { | - |
| 438 | Q_ASSERT(qApp && qApp->thread() == QThread::currentThread()); | - |
| 439 | if (!displayDC) | - |
| 440 | displayDC = GetDC(0); | - |
| 441 | return displayDC; | - |
| 442 | } | - |
| 443 | #endif | - |
| 444 | | - |
| 445 | void qt_cleanup() | - |
| 446 | { | - |
| 447 | QPixmapCache::clear(); executed (the execution status of this line is deduced): QPixmapCache::clear(); | - |
| 448 | QColormap::cleanup(); executed (the execution status of this line is deduced): QColormap::cleanup(); | - |
| 449 | | - |
| 450 | QApplicationPrivate::active_window = 0; //### this should not be necessary executed (the execution status of this line is deduced): QApplicationPrivate::active_window = 0; | - |
| 451 | #ifdef Q_OS_WIN | - |
| 452 | if (displayDC) { | - |
| 453 | ReleaseDC(0, displayDC); | - |
| 454 | displayDC = 0; | - |
| 455 | } | - |
| 456 | #endif | - |
| 457 | } executed: }Execution Count:213 | 213 |
| 458 | | - |
| 459 | | - |
| 460 | QT_END_NAMESPACE | - |
| 461 | | - |
| | |