| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qapplication.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | static void initResources() | - | ||||||||||||||||||||||||
| 26 | { | - | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | do { extern int qInitResources_qstyle (); qInitResources_qstyle (); } while (0); | - | ||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||
| 32 | do { extern int qInitResources_qmessagebox (); qInitResources_qmessagebox (); } while (0); | - | ||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||
| 34 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | __attribute__((visibility("default"))) void qt_call_post_routines(); | - | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | QApplicationPrivate *QApplicationPrivate::self = 0; | - | ||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | static void initSystemPalette() | - | ||||||||||||||||||||||||
| 42 | { | - | ||||||||||||||||||||||||
| 43 | if (!QApplicationPrivate::sys_pal
| 0 | ||||||||||||||||||||||||
| 44 | QPalette defaultPlatte; | - | ||||||||||||||||||||||||
| 45 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
| 46 | defaultPlatte = QApplicationPrivate::app_style->standardPalette(); never executed: defaultPlatte = QApplicationPrivate::app_style->standardPalette(); | 0 | ||||||||||||||||||||||||
| 47 | if (const
| 0 | ||||||||||||||||||||||||
| 48 | QApplicationPrivate::setSystemPalette(themePalette->resolve(defaultPlatte)); | - | ||||||||||||||||||||||||
| 49 | QApplicationPrivate::initializeWidgetPaletteHash(); | - | ||||||||||||||||||||||||
| 50 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 51 | QApplicationPrivate::setSystemPalette(defaultPlatte); | - | ||||||||||||||||||||||||
| 52 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 53 | } | - | ||||||||||||||||||||||||
| 54 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | static void clearSystemPalette() | - | ||||||||||||||||||||||||
| 57 | { | - | ||||||||||||||||||||||||
| 58 | delete QApplicationPrivate::sys_pal; | - | ||||||||||||||||||||||||
| 59 | QApplicationPrivate::sys_pal = 0; | - | ||||||||||||||||||||||||
| 60 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||
| 62 | static QByteArray get_style_class_name() | - | ||||||||||||||||||||||||
| 63 | { | - | ||||||||||||||||||||||||
| 64 | QScopedPointer<QStyle> s(QStyleFactory::create(QApplicationPrivate::desktopStyleKey())); | - | ||||||||||||||||||||||||
| 65 | if (!s.isNull()
| 0 | ||||||||||||||||||||||||
| 66 | return never executed: s->metaObject()->className();return s->metaObject()->className();never executed: return s->metaObject()->className(); | 0 | ||||||||||||||||||||||||
| 67 | return never executed: QByteArray();return QByteArray();never executed: return QByteArray(); | 0 | ||||||||||||||||||||||||
| 68 | } | - | ||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | static QByteArray nativeStyleClassName() | - | ||||||||||||||||||||||||
| 71 | { | - | ||||||||||||||||||||||||
| 72 | static QByteArray name = get_style_class_name(); | - | ||||||||||||||||||||||||
| 73 | return never executed: name;return name;never executed: return name; | 0 | ||||||||||||||||||||||||
| 74 | } | - | ||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | bool QApplicationPrivate::autoSipEnabled = true; | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||
| 83 | QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, int flags) | - | ||||||||||||||||||||||||
| 84 | : QGuiApplicationPrivate(argc, argv, flags) | - | ||||||||||||||||||||||||
| 85 | { | - | ||||||||||||||||||||||||
| 86 | application_type = QApplicationPrivate::Gui; | - | ||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | gestureManager = 0; | - | ||||||||||||||||||||||||
| 90 | gestureWidget = 0; | - | ||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||
| 93 | if (!self
| 0 | ||||||||||||||||||||||||
| 94 | self = this; never executed: self = this; | 0 | ||||||||||||||||||||||||
| 95 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | QApplicationPrivate::~QApplicationPrivate() | - | ||||||||||||||||||||||||
| 98 | { | - | ||||||||||||||||||||||||
| 99 | if (self == this
| 0 | ||||||||||||||||||||||||
| 100 | self = 0; never executed: self = 0; | 0 | ||||||||||||||||||||||||
| 101 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | void QApplicationPrivate::createEventDispatcher() | - | ||||||||||||||||||||||||
| 104 | { | - | ||||||||||||||||||||||||
| 105 | QGuiApplicationPrivate::createEventDispatcher(); | - | ||||||||||||||||||||||||
| 106 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 107 | QWidget *QApplication::topLevelAt(const QPoint &pos) | - | ||||||||||||||||||||||||
| 108 | { | - | ||||||||||||||||||||||||
| 109 | if (const
| 0 | ||||||||||||||||||||||||
| 110 | if (const
| 0 | ||||||||||||||||||||||||
| 111 | return never executed: widgetWindow->widget();return widgetWindow->widget();never executed: return widgetWindow->widget(); | 0 | ||||||||||||||||||||||||
| 112 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 113 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 114 | } | - | ||||||||||||||||||||||||
| 115 | void qt_init(QApplicationPrivate *priv, int type | - | ||||||||||||||||||||||||
| 116 | ); | - | ||||||||||||||||||||||||
| 117 | void qt_init_tooltip_palette(); | - | ||||||||||||||||||||||||
| 118 | void qt_cleanup(); | - | ||||||||||||||||||||||||
| 119 | - | |||||||||||||||||||||||||
| 120 | QStyle *QApplicationPrivate::app_style = 0; | - | ||||||||||||||||||||||||
| 121 | bool QApplicationPrivate::overrides_native_style = false; | - | ||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||
| 124 | QString QApplicationPrivate::styleSheet; | - | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | QPointer<QWidget> QApplicationPrivate::leaveAfterRelease = 0; | - | ||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | int QApplicationPrivate::app_cspec = QApplication::NormalColor; | - | ||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | QPalette *QApplicationPrivate::sys_pal = 0; | - | ||||||||||||||||||||||||
| 131 | QPalette *QApplicationPrivate::set_pal = 0; | - | ||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | QFont *QApplicationPrivate::sys_font = 0; | - | ||||||||||||||||||||||||
| 134 | QFont *QApplicationPrivate::set_font = 0; | - | ||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | QWidget *QApplicationPrivate::main_widget = 0; | - | ||||||||||||||||||||||||
| 137 | QWidget *QApplicationPrivate::focus_widget = 0; | - | ||||||||||||||||||||||||
| 138 | QWidget *QApplicationPrivate::hidden_focus_widget = 0; | - | ||||||||||||||||||||||||
| 139 | QWidget *QApplicationPrivate::active_window = 0; | - | ||||||||||||||||||||||||
| 140 | - | |||||||||||||||||||||||||
| 141 | int QApplicationPrivate::wheel_scroll_lines; | - | ||||||||||||||||||||||||
| 142 | QPointer<QWidget> QApplicationPrivate::wheel_widget; | - | ||||||||||||||||||||||||
| 143 | - | |||||||||||||||||||||||||
| 144 | bool qt_in_tab_key_event = false; | - | ||||||||||||||||||||||||
| 145 | int qt_antialiasing_threshold = -1; | - | ||||||||||||||||||||||||
| 146 | QSize QApplicationPrivate::app_strut = QSize(0,0); | - | ||||||||||||||||||||||||
| 147 | int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; | - | ||||||||||||||||||||||||
| 148 | bool QApplicationPrivate::widgetCount = false; | - | ||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | - | |||||||||||||||||||||||||
| 154 | inline bool QApplicationPrivate::isAlien(QWidget *widget) | - | ||||||||||||||||||||||||
| 155 | { | - | ||||||||||||||||||||||||
| 156 | return never executed: widget && !widget->isWindow();return widget && !widget->isWindow();never executed: return widget && !widget->isWindow(); | 0 | ||||||||||||||||||||||||
| 157 | } | - | ||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||
| 159 | bool __attribute__((visibility("default"))) qt_tab_all_widgets() | - | ||||||||||||||||||||||||
| 160 | { | - | ||||||||||||||||||||||||
| 161 | return never executed: QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls;return QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls;never executed: return QGuiApplication::styleHints()->tabFocusBehavior() == Qt::TabFocusAllControls; | 0 | ||||||||||||||||||||||||
| 162 | } | - | ||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||
| 164 | - | |||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||
| 166 | namespace { namespace Q_QGS_app_palettes { typedef PaletteHash Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<PaletteHash, Q_QGS_app_palettes::innerFunction, Q_QGS_app_palettes::guard> app_palettes;return &holder.value; | 0 | ||||||||||||||||||||||||
| 167 | PaletteHash *qt_app_palettes_hash() | - | ||||||||||||||||||||||||
| 168 | { | - | ||||||||||||||||||||||||
| 169 | return never executed: app_palettes();return app_palettes();never executed: return app_palettes(); | 0 | ||||||||||||||||||||||||
| 170 | } | - | ||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | namespace { namespace Q_QGS_app_fonts { typedef FontHash Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<FontHash, Q_QGS_app_fonts::innerFunction, Q_QGS_app_fonts::guard> app_fonts;return &holder.value; | 0 | ||||||||||||||||||||||||
| 173 | FontHash *qt_app_fonts_hash() | - | ||||||||||||||||||||||||
| 174 | { | - | ||||||||||||||||||||||||
| 175 | return never executed: app_fonts();return app_fonts();never executed: return app_fonts(); | 0 | ||||||||||||||||||||||||
| 176 | } | - | ||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||
| 178 | QWidgetList *QApplicationPrivate::popupWidgets = 0; | - | ||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||
| 180 | QDesktopWidget *qt_desktopWidget = 0; | - | ||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||
| 185 | void QApplicationPrivate::process_cmdline() | - | ||||||||||||||||||||||||
| 186 | { | - | ||||||||||||||||||||||||
| 187 | if (styleOverride.isEmpty()
| 0 | ||||||||||||||||||||||||
| 188 | styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); never executed: styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); | 0 | ||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | if (!styleOverride.isEmpty()
| 0 | ||||||||||||||||||||||||
| 191 | if (app_style
| 0 | ||||||||||||||||||||||||
| 192 | delete app_style; | - | ||||||||||||||||||||||||
| 193 | app_style = 0; | - | ||||||||||||||||||||||||
| 194 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 195 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 196 | - | |||||||||||||||||||||||||
| 197 | - | |||||||||||||||||||||||||
| 198 | if (!qt_is_gui_used
| 0 | ||||||||||||||||||||||||
| 199 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 200 | - | |||||||||||||||||||||||||
| 201 | int i, j; | - | ||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 | j = 1; | - | ||||||||||||||||||||||||
| 204 | for (i=1; i<argc
| 0 | ||||||||||||||||||||||||
| 205 | if (!argv[i]
| 0 | ||||||||||||||||||||||||
| 206 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 207 | if (*
| 0 | ||||||||||||||||||||||||
| 208 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||
| 209 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 210 | } | - | ||||||||||||||||||||||||
| 211 | const char *arg = argv[i]; | - | ||||||||||||||||||||||||
| 212 | if (arg[1] == '-'
| 0 | ||||||||||||||||||||||||
| 213 | ++ never executed: arg;++arg;never executed: ++arg; | 0 | ||||||||||||||||||||||||
| 214 | if (strcmp(arg, "-qdevel") == 0
| 0 | ||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | } never executed: else if (strcmp(arg, "-stylesheet") == 0end of block
| 0 | ||||||||||||||||||||||||
| 218 | styleSheet = QLatin1String("file:///"); | - | ||||||||||||||||||||||||
| 219 | styleSheet.append(QString::fromLocal8Bit(argv[++i])); | - | ||||||||||||||||||||||||
| 220 | } never executed: else if (strncmp(arg, "-stylesheet=", 12) == 0end of block
| 0 | ||||||||||||||||||||||||
| 221 | styleSheet = QLatin1String("file:///"); | - | ||||||||||||||||||||||||
| 222 | styleSheet.append(QString::fromLocal8Bit(arg + 12)); | - | ||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||
| 224 | } never executed: else if (qstrcmp(arg, "-widgetcount") == 0end of block
| 0 | ||||||||||||||||||||||||
| 225 | widgetCount = true; | - | ||||||||||||||||||||||||
| 226 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 227 | argv[j++] = argv[i]; | - | ||||||||||||||||||||||||
| 228 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 229 | } | - | ||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | if(j < argc
| 0 | ||||||||||||||||||||||||
| 232 | argv[j] = 0; | - | ||||||||||||||||||||||||
| 233 | argc = j; | - | ||||||||||||||||||||||||
| 234 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 235 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 236 | QApplication::QApplication(int &argc, char **argv, int _internal) | - | ||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||
| 238 | : QGuiApplication(*new QApplicationPrivate(argc, argv, _internal)) | - | ||||||||||||||||||||||||
| 239 | { | - | ||||||||||||||||||||||||
| 240 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 241 | d->init(); | - | ||||||||||||||||||||||||
| 242 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | - | |||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||
| 246 | - | |||||||||||||||||||||||||
| 247 | void QApplicationPrivate::init() | - | ||||||||||||||||||||||||
| 248 | { | - | ||||||||||||||||||||||||
| 249 | QGuiApplicationPrivate::init(); | - | ||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||
| 251 | initResources(); | - | ||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 | qt_is_gui_used = (application_type != QApplicationPrivate::Tty); | - | ||||||||||||||||||||||||
| 254 | process_cmdline(); | - | ||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||
| 256 | - | |||||||||||||||||||||||||
| 257 | qt_init(this, application_type); | - | ||||||||||||||||||||||||
| 258 | initialize(); | - | ||||||||||||||||||||||||
| 259 | eventDispatcher->startingUp(); | - | ||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||
| 267 | QAccessible::installFactory(&qAccessibleFactory); | - | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | void qt_init(QApplicationPrivate *priv, int type) | - | ||||||||||||||||||||||||
| 273 | { | - | ||||||||||||||||||||||||
| 274 | (void)priv;; | - | ||||||||||||||||||||||||
| 275 | (void)type;; | - | ||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||
| 277 | QColormap::initialize(); | - | ||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||
| 279 | qt_init_tooltip_palette(); | - | ||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||
| 281 | QApplicationPrivate::initializeWidgetFontHash(); | - | ||||||||||||||||||||||||
| 282 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||
| 284 | void qt_init_tooltip_palette() | - | ||||||||||||||||||||||||
| 285 | { | - | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | if (const
| 0 | ||||||||||||||||||||||||
| 288 | QToolTip::setPalette(*toolTipPalette); never executed: QToolTip::setPalette(*toolTipPalette); | 0 | ||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||
| 290 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 | void qRegisterGuiStateMachine(); | - | ||||||||||||||||||||||||
| 294 | void qUnregisterGuiStateMachine(); | - | ||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||
| 296 | extern void qRegisterWidgetsVariant(); | - | ||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||
| 303 | void QApplicationPrivate::initialize() | - | ||||||||||||||||||||||||
| 304 | { | - | ||||||||||||||||||||||||
| 305 | is_app_running = false; | - | ||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||
| 307 | QWidgetPrivate::mapper = new QWidgetMapper; | - | ||||||||||||||||||||||||
| 308 | QWidgetPrivate::allWidgets = new QWidgetSet; | - | ||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | qRegisterWidgetsVariant(); | - | ||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | QAbstractDeclarativeData::setWidgetParent = QWidgetPrivate::setWidgetParentHelper; | - | ||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | if (application_type != QApplicationPrivate::Tty
| 0 | ||||||||||||||||||||||||
| 317 | ( never executed: void) QApplication::style();(void) QApplication::style();never executed: (void) QApplication::style(); | 0 | ||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | qRegisterGuiStateMachine(); | - | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | if (qEnvironmentVariableIntValue("QT_USE_NATIVE_WINDOWS") > 0
| 0 | ||||||||||||||||||||||||
| 324 | QCoreApplication::setAttribute(Qt::AA_NativeWindows); never executed: QCoreApplication::setAttribute(Qt::AA_NativeWindows); | 0 | ||||||||||||||||||||||||
| 325 | QApplicationPrivate::wheel_scroll_lines = 3; | - | ||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | if (qt_is_gui_used
| 0 | ||||||||||||||||||||||||
| 329 | initializeMultitouch(); never executed: initializeMultitouch(); | 0 | ||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||
| 331 | if (QApplication::desktopSettingsAware()
| 0 | ||||||||||||||||||||||||
| 332 | if (const
| 0 | ||||||||||||||||||||||||
| 333 | QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); | - | ||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||
| 335 | QApplicationPrivate::wheel_scroll_lines = theme->themeHint(QPlatformTheme::WheelScrollLines).toInt(); | - | ||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||
| 337 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 338 | - | |||||||||||||||||||||||||
| 339 | is_app_running = true; | - | ||||||||||||||||||||||||
| 340 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||
| 342 | static void setPossiblePalette(const QPalette *palette, const char *className) | - | ||||||||||||||||||||||||
| 343 | { | - | ||||||||||||||||||||||||
| 344 | if (palette == 0
| 0 | ||||||||||||||||||||||||
| 345 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 346 | QApplicationPrivate::setPalette_helper(*palette, className, false); | - | ||||||||||||||||||||||||
| 347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||
| 349 | void QApplicationPrivate::initializeWidgetPaletteHash() | - | ||||||||||||||||||||||||
| 350 | { | - | ||||||||||||||||||||||||
| 351 | QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme(); | - | ||||||||||||||||||||||||
| 352 | if (!platformTheme
| 0 | ||||||||||||||||||||||||
| 353 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 354 | qt_app_palettes_hash()->clear(); | - | ||||||||||||||||||||||||
| 355 | - | |||||||||||||||||||||||||
| 356 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton"); | - | ||||||||||||||||||||||||
| 357 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton"); | - | ||||||||||||||||||||||||
| 358 | setPossiblePalette(platformTheme->palette(QPlatformTheme::CheckBoxPalette), "QCheckBox"); | - | ||||||||||||||||||||||||
| 359 | setPossiblePalette(platformTheme->palette(QPlatformTheme::RadioButtonPalette), "QRadioButton"); | - | ||||||||||||||||||||||||
| 360 | setPossiblePalette(platformTheme->palette(QPlatformTheme::HeaderPalette), "QHeaderView"); | - | ||||||||||||||||||||||||
| 361 | setPossiblePalette(platformTheme->palette(QPlatformTheme::ItemViewPalette), "QAbstractItemView"); | - | ||||||||||||||||||||||||
| 362 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MessageBoxLabelPalette), "QMessageBoxLabel"); | - | ||||||||||||||||||||||||
| 363 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TabBarPalette), "QTabBar"); | - | ||||||||||||||||||||||||
| 364 | setPossiblePalette(platformTheme->palette(QPlatformTheme::LabelPalette), "QLabel"); | - | ||||||||||||||||||||||||
| 365 | setPossiblePalette(platformTheme->palette(QPlatformTheme::GroupBoxPalette), "QGroupBox"); | - | ||||||||||||||||||||||||
| 366 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuPalette), "QMenu"); | - | ||||||||||||||||||||||||
| 367 | setPossiblePalette(platformTheme->palette(QPlatformTheme::MenuBarPalette), "QMenuBar"); | - | ||||||||||||||||||||||||
| 368 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextEdit"); | - | ||||||||||||||||||||||||
| 369 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextEditPalette), "QTextControl"); | - | ||||||||||||||||||||||||
| 370 | setPossiblePalette(platformTheme->palette(QPlatformTheme::TextLineEditPalette), "QLineEdit"); | - | ||||||||||||||||||||||||
| 371 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||
| 373 | void QApplicationPrivate::initializeWidgetFontHash() | - | ||||||||||||||||||||||||
| 374 | { | - | ||||||||||||||||||||||||
| 375 | const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); | - | ||||||||||||||||||||||||
| 376 | if (!theme
| 0 | ||||||||||||||||||||||||
| 377 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 378 | FontHash *fontHash = qt_app_fonts_hash(); | - | ||||||||||||||||||||||||
| 379 | fontHash->clear(); | - | ||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||
| 381 | if (const
| 0 | ||||||||||||||||||||||||
| 382 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenu") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenu" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenu") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenu" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 383 | if (const
| 0 | ||||||||||||||||||||||||
| 384 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 385 | if (const
| 0 | ||||||||||||||||||||||||
| 386 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 387 | if (const
| 0 | ||||||||||||||||||||||||
| 388 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMessageBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMessageBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMessageBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMessageBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 389 | if (const
| 0 | ||||||||||||||||||||||||
| 390 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 391 | if (const
| 0 | ||||||||||||||||||||||||
| 392 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTipLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTipLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTipLabel") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTipLabel" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 393 | if (const
| 0 | ||||||||||||||||||||||||
| 394 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 395 | if (const
| 0 | ||||||||||||||||||||||||
| 396 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QStatusBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QStatusBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QStatusBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QStatusBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 397 | if (const
| 0 | ||||||||||||||||||||||||
| 398 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMdiSubWindowTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMdiSubWindowTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMdiSubWindowTitleBar") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMdiSubWindowTitleBar" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 399 | if (const
| 0 | ||||||||||||||||||||||||
| 400 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QDockWidgetTitle") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QDockWidgetTitle" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QDockWidgetTitle") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QDockWidgetTitle" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 401 | if (const
| 0 | ||||||||||||||||||||||||
| 402 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QPushButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QPushButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QPushButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QPushButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 403 | if (const
| 0 | ||||||||||||||||||||||||
| 404 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QCheckBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QCheckBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QCheckBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QCheckBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 405 | if (const
| 0 | ||||||||||||||||||||||||
| 406 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QRadioButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QRadioButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QRadioButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QRadioButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 407 | if (const
| 0 | ||||||||||||||||||||||||
| 408 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QToolButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QToolButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QToolButton") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QToolButton" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 409 | if (const
| 0 | ||||||||||||||||||||||||
| 410 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QAbstractItemView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QAbstractItemView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QAbstractItemView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QAbstractItemView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 411 | if (const
| 0 | ||||||||||||||||||||||||
| 412 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 413 | if (const
| 0 | ||||||||||||||||||||||||
| 414 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QHeaderView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QHeaderView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QHeaderView") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QHeaderView" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 415 | if (const
| 0 | ||||||||||||||||||||||||
| 416 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QListBox") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QListBox" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 417 | if (const
| 0 | ||||||||||||||||||||||||
| 418 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboMenuItem") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboMenuItem" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 419 | if (const
| 0 | ||||||||||||||||||||||||
| 420 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboLineEdit") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboLineEdit" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QComboLineEdit") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QComboLineEdit" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 421 | if (const
| 0 | ||||||||||||||||||||||||
| 422 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QSmallFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QSmallFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QSmallFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QSmallFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 423 | if (const
| 0 | ||||||||||||||||||||||||
| 424 | fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMiniFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMiniFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed: ba;return ba;never executed: }()), *font);return ba;never executed: fontHash->insert(([]() -> QByteArray { enum { Size = sizeof("QMiniFont") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "QMiniFont" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return ba; }()), *font); | 0 | ||||||||||||||||||||||||
| 425 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 426 | QWidget *QApplication::activePopupWidget() | - | ||||||||||||||||||||||||
| 427 | { | - | ||||||||||||||||||||||||
| 428 | return never executed: QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ?return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->constLast() : nullptr;never executed: return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->constLast() : nullptr; | 0 | ||||||||||||||||||||||||
| 429 | QApplicationPrivate::popupWidgets->constLast() : nullptr; never executed: return QApplicationPrivate::popupWidgets && !QApplicationPrivate::popupWidgets->isEmpty() ? QApplicationPrivate::popupWidgets->constLast() : nullptr; | 0 | ||||||||||||||||||||||||
| 430 | } | - | ||||||||||||||||||||||||
| 431 | QWidget *QApplication::activeModalWidget() | - | ||||||||||||||||||||||||
| 432 | { | - | ||||||||||||||||||||||||
| 433 | QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(modalWindow()); | - | ||||||||||||||||||||||||
| 434 | return never executed: widgetWindow ? widgetWindow->widget() : 0;return widgetWindow ? widgetWindow->widget() : 0;never executed: return widgetWindow ? widgetWindow->widget() : 0; | 0 | ||||||||||||||||||||||||
| 435 | } | - | ||||||||||||||||||||||||
| 436 | - | |||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||
| 440 | - | |||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||
| 442 | QApplication::~QApplication() | - | ||||||||||||||||||||||||
| 443 | { | - | ||||||||||||||||||||||||
| 444 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||
| 447 | qt_call_post_routines(); | - | ||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||
| 450 | d->toolTipWakeUp.stop(); | - | ||||||||||||||||||||||||
| 451 | d->toolTipFallAsleep.stop(); | - | ||||||||||||||||||||||||
| 452 | - | |||||||||||||||||||||||||
| 453 | QApplicationPrivate::is_app_closing = true; | - | ||||||||||||||||||||||||
| 454 | QApplicationPrivate::is_app_running = false; | - | ||||||||||||||||||||||||
| 455 | - | |||||||||||||||||||||||||
| 456 | delete QWidgetPrivate::mapper; | - | ||||||||||||||||||||||||
| 457 | QWidgetPrivate::mapper = 0; | - | ||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||
| 460 | if (QWidgetPrivate::allWidgets
| 0 | ||||||||||||||||||||||||
| 461 | QWidgetSet *mySet = QWidgetPrivate::allWidgets; | - | ||||||||||||||||||||||||
| 462 | QWidgetPrivate::allWidgets = 0; | - | ||||||||||||||||||||||||
| 463 | for (QWidgetSet::ConstIterator it = mySet->constBegin(), cend = mySet->constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 464 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 465 | if (!w->parent()
| 0 | ||||||||||||||||||||||||
| 466 | w->destroy(true, true); never executed: w->destroy(true, true); | 0 | ||||||||||||||||||||||||
| 467 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 468 | delete mySet; | - | ||||||||||||||||||||||||
| 469 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||
| 471 | delete qt_desktopWidget; | - | ||||||||||||||||||||||||
| 472 | qt_desktopWidget = 0; | - | ||||||||||||||||||||||||
| 473 | - | |||||||||||||||||||||||||
| 474 | delete QApplicationPrivate::app_pal; | - | ||||||||||||||||||||||||
| 475 | QApplicationPrivate::app_pal = 0; | - | ||||||||||||||||||||||||
| 476 | clearSystemPalette(); | - | ||||||||||||||||||||||||
| 477 | delete QApplicationPrivate::set_pal; | - | ||||||||||||||||||||||||
| 478 | QApplicationPrivate::set_pal = 0; | - | ||||||||||||||||||||||||
| 479 | app_palettes()->clear(); | - | ||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||
| 481 | delete QApplicationPrivate::sys_font; | - | ||||||||||||||||||||||||
| 482 | QApplicationPrivate::sys_font = 0; | - | ||||||||||||||||||||||||
| 483 | delete QApplicationPrivate::set_font; | - | ||||||||||||||||||||||||
| 484 | QApplicationPrivate::set_font = 0; | - | ||||||||||||||||||||||||
| 485 | app_fonts()->clear(); | - | ||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||
| 487 | delete QApplicationPrivate::app_style; | - | ||||||||||||||||||||||||
| 488 | QApplicationPrivate::app_style = 0; | - | ||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||
| 490 | - | |||||||||||||||||||||||||
| 491 | if (qt_is_gui_used
| 0 | ||||||||||||||||||||||||
| 492 | delete QDragManager::self(); never executed: delete QDragManager::self(); | 0 | ||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||
| 495 | d->cleanupMultitouch(); | - | ||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||
| 497 | qt_cleanup(); | - | ||||||||||||||||||||||||
| 498 | - | |||||||||||||||||||||||||
| 499 | if (QApplicationPrivate::widgetCount
| 0 | ||||||||||||||||||||||||
| 500 | QMessageLogger(__FILE__, 883, __PRETTY_FUNCTION__).debug("Widgets left: %i Max widgets: %i \n", QWidgetPrivate::instanceCounter, QWidgetPrivate::maxInstances); never executed: QMessageLogger(__FILE__, 883, __PRETTY_FUNCTION__).debug("Widgets left: %i Max widgets: %i \n", QWidgetPrivate::instanceCounter, QWidgetPrivate::maxInstances); | 0 | ||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||
| 502 | QApplicationPrivate::obey_desktop_settings = true; | - | ||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||
| 504 | QApplicationPrivate::app_strut = QSize(0, 0); | - | ||||||||||||||||||||||||
| 505 | QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; | - | ||||||||||||||||||||||||
| 506 | QApplicationPrivate::widgetCount = false; | - | ||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||
| 508 | - | |||||||||||||||||||||||||
| 509 | - | |||||||||||||||||||||||||
| 510 | qUnregisterGuiStateMachine(); | - | ||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||
| 512 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 513 | void qt_cleanup() | - | ||||||||||||||||||||||||
| 514 | { | - | ||||||||||||||||||||||||
| 515 | QPixmapCache::clear(); | - | ||||||||||||||||||||||||
| 516 | QColormap::cleanup(); | - | ||||||||||||||||||||||||
| 517 | - | |||||||||||||||||||||||||
| 518 | QApplicationPrivate::active_window = 0; | - | ||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||
| 521 | - | |||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||
| 524 | - | |||||||||||||||||||||||||
| 525 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 526 | QWidget *QApplication::widgetAt(const QPoint &p) | - | ||||||||||||||||||||||||
| 527 | { | - | ||||||||||||||||||||||||
| 528 | QWidget *window = QApplication::topLevelAt(p); | - | ||||||||||||||||||||||||
| 529 | if (!window
| 0 | ||||||||||||||||||||||||
| 530 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||
| 532 | QWidget *child = 0; | - | ||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||
| 534 | if (!window->testAttribute(Qt::WA_TransparentForMouseEvents)
| 0 | ||||||||||||||||||||||||
| 535 | child = window->childAt(window->mapFromGlobal(p)); never executed: child = window->childAt(window->mapFromGlobal(p)); | 0 | ||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||
| 537 | if (child
| 0 | ||||||||||||||||||||||||
| 538 | return never executed: child;return child;never executed: return child; | 0 | ||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||
| 540 | if (window->testAttribute(Qt::WA_TransparentForMouseEvents)
| 0 | ||||||||||||||||||||||||
| 541 | - | |||||||||||||||||||||||||
| 542 | - | |||||||||||||||||||||||||
| 543 | - | |||||||||||||||||||||||||
| 544 | int x = p.x(); | - | ||||||||||||||||||||||||
| 545 | int y = p.y(); | - | ||||||||||||||||||||||||
| 546 | QRegion oldmask = window->mask(); | - | ||||||||||||||||||||||||
| 547 | QPoint wpoint = window->mapFromGlobal(QPoint(x, y)); | - | ||||||||||||||||||||||||
| 548 | QRegion newmask = (oldmask.isEmpty()
| 0 | ||||||||||||||||||||||||
| 549 | - QRegion(wpoint.x(), wpoint.y(), 1, 1); | - | ||||||||||||||||||||||||
| 550 | window->setMask(newmask); | - | ||||||||||||||||||||||||
| 551 | QWidget *recurse = 0; | - | ||||||||||||||||||||||||
| 552 | if (QApplication::topLevelAt(p) != window
| 0 | ||||||||||||||||||||||||
| 553 | recurse = widgetAt(x, y); never executed: recurse = widgetAt(x, y); | 0 | ||||||||||||||||||||||||
| 554 | if (oldmask.isEmpty()
| 0 | ||||||||||||||||||||||||
| 555 | window->clearMask(); never executed: window->clearMask(); | 0 | ||||||||||||||||||||||||
| 556 | else | - | ||||||||||||||||||||||||
| 557 | window->setMask(oldmask); never executed: window->setMask(oldmask); | 0 | ||||||||||||||||||||||||
| 558 | return never executed: recurse;return recurse;never executed: return recurse; | 0 | ||||||||||||||||||||||||
| 559 | } | - | ||||||||||||||||||||||||
| 560 | return never executed: window;return window;never executed: return window; | 0 | ||||||||||||||||||||||||
| 561 | } | - | ||||||||||||||||||||||||
| 562 | bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventList *postedEvents) | - | ||||||||||||||||||||||||
| 563 | { | - | ||||||||||||||||||||||||
| 564 | if ((event->type() == QEvent::UpdateRequest
| 0 | ||||||||||||||||||||||||
| 565 | || event->type() == QEvent::LayoutRequest
| 0 | ||||||||||||||||||||||||
| 566 | || event->type() == QEvent::Resize
| 0 | ||||||||||||||||||||||||
| 567 | || event->type() == QEvent::Move
| 0 | ||||||||||||||||||||||||
| 568 | || event->type() == QEvent::LanguageChange
| 0 | ||||||||||||||||||||||||
| 569 | for (QPostEventList::const_iterator it = postedEvents->constBegin(); it != postedEvents->constEnd()
| 0 | ||||||||||||||||||||||||
| 570 | const QPostEvent &cur = *it; | - | ||||||||||||||||||||||||
| 571 | if (cur.receiver != receiver
| 0 | ||||||||||||||||||||||||
| 572 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 573 | if (cur.event->type() == QEvent::LayoutRequest
| 0 | ||||||||||||||||||||||||
| 574 | || cur.event->type() == QEvent::UpdateRequest
| 0 | ||||||||||||||||||||||||
| 575 | ; | - | ||||||||||||||||||||||||
| 576 | } never executed: else if (cur.event->type() == QEvent::Resizeend of block
| 0 | ||||||||||||||||||||||||
| 577 | ((QResizeEvent *)(cur.event))->s = ((QResizeEvent *)event)->s; | - | ||||||||||||||||||||||||
| 578 | } never executed: else if (cur.event->type() == QEvent::Moveend of block
| 0 | ||||||||||||||||||||||||
| 579 | ((QMoveEvent *)(cur.event))->p = ((QMoveEvent *)event)->p; | - | ||||||||||||||||||||||||
| 580 | } never executed: else if (cur.event->type() == QEvent::LanguageChangeend of block
| 0 | ||||||||||||||||||||||||
| 581 | ; | - | ||||||||||||||||||||||||
| 582 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 583 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 584 | } | - | ||||||||||||||||||||||||
| 585 | delete event; | - | ||||||||||||||||||||||||
| 586 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 587 | } | - | ||||||||||||||||||||||||
| 588 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 589 | } | - | ||||||||||||||||||||||||
| 590 | return never executed: QGuiApplication::compressEvent(event, receiver, postedEvents);return QGuiApplication::compressEvent(event, receiver, postedEvents);never executed: return QGuiApplication::compressEvent(event, receiver, postedEvents); | 0 | ||||||||||||||||||||||||
| 591 | } | - | ||||||||||||||||||||||||
| 592 | void QApplication::setAutoSipEnabled(const bool enabled) | - | ||||||||||||||||||||||||
| 593 | { | - | ||||||||||||||||||||||||
| 594 | QApplicationPrivate::autoSipEnabled = enabled; | - | ||||||||||||||||||||||||
| 595 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||
| 597 | bool QApplication::autoSipEnabled() const | - | ||||||||||||||||||||||||
| 598 | { | - | ||||||||||||||||||||||||
| 599 | return never executed: QApplicationPrivate::autoSipEnabled;return QApplicationPrivate::autoSipEnabled;never executed: return QApplicationPrivate::autoSipEnabled; | 0 | ||||||||||||||||||||||||
| 600 | } | - | ||||||||||||||||||||||||
| 601 | - | |||||||||||||||||||||||||
| 602 | - | |||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||
| 604 | QString QApplication::styleSheet() const | - | ||||||||||||||||||||||||
| 605 | { | - | ||||||||||||||||||||||||
| 606 | return never executed: QApplicationPrivate::styleSheet;return QApplicationPrivate::styleSheet;never executed: return QApplicationPrivate::styleSheet; | 0 | ||||||||||||||||||||||||
| 607 | } | - | ||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||
| 609 | void QApplication::setStyleSheet(const QString& styleSheet) | - | ||||||||||||||||||||||||
| 610 | { | - | ||||||||||||||||||||||||
| 611 | QApplicationPrivate::styleSheet = styleSheet; | - | ||||||||||||||||||||||||
| 612 | QStyleSheetStyle *proxy = qobject_cast<QStyleSheetStyle*>(QApplicationPrivate::app_style); | - | ||||||||||||||||||||||||
| 613 | if (styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||
| 614 | if (!proxy
| 0 | ||||||||||||||||||||||||
| 615 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 616 | setStyle(proxy->base); | - | ||||||||||||||||||||||||
| 617 | } never executed: else if (proxyend of block
| 0 | ||||||||||||||||||||||||
| 618 | proxy->repolish((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
| 619 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 620 | QStyleSheetStyle *newProxy = new QStyleSheetStyle(QApplicationPrivate::app_style); | - | ||||||||||||||||||||||||
| 621 | QApplicationPrivate::app_style->setParent(newProxy); | - | ||||||||||||||||||||||||
| 622 | setStyle(newProxy); | - | ||||||||||||||||||||||||
| 623 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 624 | } | - | ||||||||||||||||||||||||
| 625 | QStyle *QApplication::style() | - | ||||||||||||||||||||||||
| 626 | { | - | ||||||||||||||||||||||||
| 627 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
| 628 | return never executed: QApplicationPrivate::app_style;return QApplicationPrivate::app_style;never executed: return QApplicationPrivate::app_style; | 0 | ||||||||||||||||||||||||
| 629 | if (!qobject_cast<QApplication *>(QCoreApplication::instance())
| 0 | ||||||||||||||||||||||||
| 630 | ((!(!"No style available without QApplication!")) ? qt_assert("!\"No style available without QApplication!\"",__FILE__,1123) : qt_noop()); | - | ||||||||||||||||||||||||
| 631 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 632 | } | - | ||||||||||||||||||||||||
| 633 | - | |||||||||||||||||||||||||
| 634 | if (!QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||
| 637 | QString style; | - | ||||||||||||||||||||||||
| 638 | if (!QApplicationPrivate::styleOverride.isEmpty()
| 0 | ||||||||||||||||||||||||
| 639 | style = QApplicationPrivate::styleOverride.toLower(); | - | ||||||||||||||||||||||||
| 640 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 641 | style = QApplicationPrivate::desktopStyleKey(); | - | ||||||||||||||||||||||||
| 642 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | QStyle *&app_style = QApplicationPrivate::app_style; | - | ||||||||||||||||||||||||
| 645 | app_style = QStyleFactory::create(style); | - | ||||||||||||||||||||||||
| 646 | if (!app_style
| 0 | ||||||||||||||||||||||||
| 647 | const QStringList styles = QStyleFactory::keys(); | - | ||||||||||||||||||||||||
| 648 | for (const auto &style : styles) { | - | ||||||||||||||||||||||||
| 649 | if ((
| 0 | ||||||||||||||||||||||||
| 650 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 651 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 652 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 653 | if (!app_style
| 0 | ||||||||||||||||||||||||
| 654 | ((!(!"No styles available!")) ? qt_assert("!\"No styles available!\"",__FILE__,1147) : qt_noop()); | - | ||||||||||||||||||||||||
| 655 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 656 | } | - | ||||||||||||||||||||||||
| 657 | QApplicationPrivate::overrides_native_style = | - | ||||||||||||||||||||||||
| 658 | app_style->objectName() != QApplicationPrivate::desktopStyleKey(); | - | ||||||||||||||||||||||||
| 659 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 660 | - | |||||||||||||||||||||||||
| 661 | QApplicationPrivate::app_style->setParent((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||
| 663 | initSystemPalette(); | - | ||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||
| 665 | if (QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
| 666 | QApplication::setPalette(*QApplicationPrivate::set_pal); never executed: QApplication::setPalette(*QApplicationPrivate::set_pal); | 0 | ||||||||||||||||||||||||
| 667 | - | |||||||||||||||||||||||||
| 668 | - | |||||||||||||||||||||||||
| 669 | if (!QApplicationPrivate::styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||
| 670 | (static_cast<QApplication *>(QCoreApplication::instance()))->setStyleSheet(QApplicationPrivate::styleSheet); | - | ||||||||||||||||||||||||
| 671 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 672 | - | |||||||||||||||||||||||||
| 673 | QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); never executed: QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); | 0 | ||||||||||||||||||||||||
| 674 | - | |||||||||||||||||||||||||
| 675 | return never executed: QApplicationPrivate::app_style;return QApplicationPrivate::app_style;never executed: return QApplicationPrivate::app_style; | 0 | ||||||||||||||||||||||||
| 676 | } | - | ||||||||||||||||||||||||
| 677 | void QApplication::setStyle(QStyle *style) | - | ||||||||||||||||||||||||
| 678 | { | - | ||||||||||||||||||||||||
| 679 | if (!style
| 0 | ||||||||||||||||||||||||
| 680 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||
| 682 | QWidgetList all = allWidgets(); | - | ||||||||||||||||||||||||
| 683 | - | |||||||||||||||||||||||||
| 684 | - | |||||||||||||||||||||||||
| 685 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
| 686 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
| 687 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 688 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 689 | if (!(w->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
| 690 | w->testAttribute(Qt::WA_WState_Polished)
| 0 | ||||||||||||||||||||||||
| 691 | QApplicationPrivate::app_style->unpolish(w); | - | ||||||||||||||||||||||||
| 692 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 693 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 694 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 695 | QApplicationPrivate::app_style->unpolish((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
| 696 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 697 | - | |||||||||||||||||||||||||
| 698 | QStyle *old = QApplicationPrivate::app_style; | - | ||||||||||||||||||||||||
| 699 | - | |||||||||||||||||||||||||
| 700 | QApplicationPrivate::overrides_native_style = | - | ||||||||||||||||||||||||
| 701 | nativeStyleClassName() == QByteArray(style->metaObject()->className()); | - | ||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||
| 704 | if (!QApplicationPrivate::styleSheet.isEmpty()
| 0 | ||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||
| 706 | QStyleSheetStyle *newProxy = new QStyleSheetStyle(style); | - | ||||||||||||||||||||||||
| 707 | style->setParent(newProxy); | - | ||||||||||||||||||||||||
| 708 | QApplicationPrivate::app_style = newProxy; | - | ||||||||||||||||||||||||
| 709 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||
| 711 | QApplicationPrivate::app_style = style; never executed: QApplicationPrivate::app_style = style; | 0 | ||||||||||||||||||||||||
| 712 | QApplicationPrivate::app_style->setParent((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
| 713 | - | |||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||
| 716 | - | |||||||||||||||||||||||||
| 717 | if (QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
| 718 | QApplication::setPalette(*QApplicationPrivate::set_pal); | - | ||||||||||||||||||||||||
| 719 | } never executed: else if (QApplicationPrivate::sys_palend of block
| 0 | ||||||||||||||||||||||||
| 720 | clearSystemPalette(); | - | ||||||||||||||||||||||||
| 721 | initSystemPalette(); | - | ||||||||||||||||||||||||
| 722 | QApplicationPrivate::initializeWidgetPaletteHash(); | - | ||||||||||||||||||||||||
| 723 | QApplicationPrivate::initializeWidgetFontHash(); | - | ||||||||||||||||||||||||
| 724 | QApplicationPrivate::setPalette_helper(*QApplicationPrivate::sys_pal, 0, false); | - | ||||||||||||||||||||||||
| 725 | } never executed: else if (!QApplicationPrivate::sys_palend of block
| 0 | ||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||
| 727 | QApplicationPrivate::setSystemPalette(QApplicationPrivate::app_style->standardPalette()); | - | ||||||||||||||||||||||||
| 728 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 729 | - | |||||||||||||||||||||||||
| 730 | - | |||||||||||||||||||||||||
| 731 | QApplicationPrivate::app_style->polish((static_cast<QApplication *>(QCoreApplication::instance()))); | - | ||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||
| 734 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
| 735 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 736 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 737 | if (w->windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||
| 738 | if (w->style() == QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
| 739 | QApplicationPrivate::app_style->polish(w); never executed: QApplicationPrivate::app_style->polish(w); | 0 | ||||||||||||||||||||||||
| 740 | - | |||||||||||||||||||||||||
| 741 | else | - | ||||||||||||||||||||||||
| 742 | w->setStyleSheet(w->styleSheet()); never executed: w->setStyleSheet(w->styleSheet()); | 0 | ||||||||||||||||||||||||
| 743 | - | |||||||||||||||||||||||||
| 744 | } | - | ||||||||||||||||||||||||
| 745 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 746 | - | |||||||||||||||||||||||||
| 747 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 748 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 749 | if (w->windowType() != Qt::Desktop
| 0 | ||||||||||||||||||||||||
| 750 | QEvent e(QEvent::StyleChange); | - | ||||||||||||||||||||||||
| 751 | QApplication::sendEvent(w, &e); | - | ||||||||||||||||||||||||
| 752 | w->update(); | - | ||||||||||||||||||||||||
| 753 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 754 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 755 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 756 | - | |||||||||||||||||||||||||
| 757 | - | |||||||||||||||||||||||||
| 758 | if (QStyleSheetStyle *oldProxy = qobject_cast<QStyleSheetStyle *>(old)
| 0 | ||||||||||||||||||||||||
| 759 | oldProxy->deref(); | - | ||||||||||||||||||||||||
| 760 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 761 | - | |||||||||||||||||||||||||
| 762 | if (old
| 0 | ||||||||||||||||||||||||
| 763 | delete old; | - | ||||||||||||||||||||||||
| 764 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||
| 766 | if (QApplicationPrivate::focus_widget
| 0 | ||||||||||||||||||||||||
| 767 | QFocusEvent in(QEvent::FocusIn, Qt::OtherFocusReason); | - | ||||||||||||||||||||||||
| 768 | QApplication::sendEvent(QApplicationPrivate::focus_widget->style(), &in); | - | ||||||||||||||||||||||||
| 769 | QApplicationPrivate::focus_widget->update(); | - | ||||||||||||||||||||||||
| 770 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 771 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 772 | QStyle* QApplication::setStyle(const QString& style) | - | ||||||||||||||||||||||||
| 773 | { | - | ||||||||||||||||||||||||
| 774 | QStyle *s = QStyleFactory::create(style); | - | ||||||||||||||||||||||||
| 775 | if (!s
| 0 | ||||||||||||||||||||||||
| 776 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||
| 778 | setStyle(s); | - | ||||||||||||||||||||||||
| 779 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||||||||
| 780 | } | - | ||||||||||||||||||||||||
| 781 | - | |||||||||||||||||||||||||
| 782 | - | |||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||
| 784 | - | |||||||||||||||||||||||||
| 785 | - | |||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||
| 788 | int QApplication::colorSpec() | - | ||||||||||||||||||||||||
| 789 | { | - | ||||||||||||||||||||||||
| 790 | return never executed: QApplicationPrivate::app_cspec;return QApplicationPrivate::app_cspec;never executed: return QApplicationPrivate::app_cspec; | 0 | ||||||||||||||||||||||||
| 791 | } | - | ||||||||||||||||||||||||
| 792 | void QApplication::setColorSpec(int spec) | - | ||||||||||||||||||||||||
| 793 | { | - | ||||||||||||||||||||||||
| 794 | if (__builtin_expect(!!((static_cast<QApplication *>(QCoreApplication::instance()))), false)
| 0 | ||||||||||||||||||||||||
| 795 | QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " never executed: QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " "called before the QApplication object is created"); | 0 | ||||||||||||||||||||||||
| 796 | "called before the QApplication object is created"); never executed: QMessageLogger(__FILE__, 1384, __PRETTY_FUNCTION__).warning("QApplication::setColorSpec: This function must be " "called before the QApplication object is created"); | 0 | ||||||||||||||||||||||||
| 797 | QApplicationPrivate::app_cspec = spec; | - | ||||||||||||||||||||||||
| 798 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 799 | QSize QApplication::globalStrut() | - | ||||||||||||||||||||||||
| 800 | { | - | ||||||||||||||||||||||||
| 801 | return never executed: QApplicationPrivate::app_strut;return QApplicationPrivate::app_strut;never executed: return QApplicationPrivate::app_strut; | 0 | ||||||||||||||||||||||||
| 802 | } | - | ||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||
| 804 | void QApplication::setGlobalStrut(const QSize& strut) | - | ||||||||||||||||||||||||
| 805 | { | - | ||||||||||||||||||||||||
| 806 | QApplicationPrivate::app_strut = strut; | - | ||||||||||||||||||||||||
| 807 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 808 | QPalette QApplication::palette(const QWidget* w) | - | ||||||||||||||||||||||||
| 809 | { | - | ||||||||||||||||||||||||
| 810 | typedef PaletteHash::const_iterator PaletteHashConstIt; | - | ||||||||||||||||||||||||
| 811 | - | |||||||||||||||||||||||||
| 812 | PaletteHash *hash = app_palettes(); | - | ||||||||||||||||||||||||
| 813 | if (w
| 0 | ||||||||||||||||||||||||
| 814 | PaletteHashConstIt it = hash->constFind(w->metaObject()->className()); | - | ||||||||||||||||||||||||
| 815 | const PaletteHashConstIt cend = hash->constEnd(); | - | ||||||||||||||||||||||||
| 816 | if (it != cend
| 0 | ||||||||||||||||||||||||
| 817 | return never executed: *it;return *it;never executed: return *it; | 0 | ||||||||||||||||||||||||
| 818 | for (it = hash->constBegin(); it != cend
| 0 | ||||||||||||||||||||||||
| 819 | if (w->inherits(it.key())
| 0 | ||||||||||||||||||||||||
| 820 | return never executed: it.value();return it.value();never executed: return it.value(); | 0 | ||||||||||||||||||||||||
| 821 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 822 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 823 | return never executed: palette();return palette();never executed: return palette(); | 0 | ||||||||||||||||||||||||
| 824 | } | - | ||||||||||||||||||||||||
| 825 | QPalette QApplication::palette(const char *className) | - | ||||||||||||||||||||||||
| 826 | { | - | ||||||||||||||||||||||||
| 827 | if (!QApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||
| 828 | palette(); never executed: palette(); | 0 | ||||||||||||||||||||||||
| 829 | PaletteHash *hash = app_palettes(); | - | ||||||||||||||||||||||||
| 830 | if (className
| 0 | ||||||||||||||||||||||||
| 831 | QHash<QByteArray, QPalette>::ConstIterator it = hash->constFind(className); | - | ||||||||||||||||||||||||
| 832 | if (it != hash->constEnd()
| 0 | ||||||||||||||||||||||||
| 833 | return never executed: *it;return *it;never executed: return *it; | 0 | ||||||||||||||||||||||||
| 834 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 835 | return never executed: *QApplicationPrivate::app_pal;return *QApplicationPrivate::app_pal;never executed: return *QApplicationPrivate::app_pal; | 0 | ||||||||||||||||||||||||
| 836 | } | - | ||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||
| 838 | void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash) | - | ||||||||||||||||||||||||
| 839 | { | - | ||||||||||||||||||||||||
| 840 | QPalette pal = palette; | - | ||||||||||||||||||||||||
| 841 | - | |||||||||||||||||||||||||
| 842 | if (QApplicationPrivate::app_style
| 0 | ||||||||||||||||||||||||
| 843 | QApplicationPrivate::app_style->polish(pal); never executed: QApplicationPrivate::app_style->polish(pal); | 0 | ||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||
| 845 | bool all = false; | - | ||||||||||||||||||||||||
| 846 | PaletteHash *hash = app_palettes(); | - | ||||||||||||||||||||||||
| 847 | if (!className
| 0 | ||||||||||||||||||||||||
| 848 | if (QApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||
| 849 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 850 | if (!QApplicationPrivate::app_pal
| 0 | ||||||||||||||||||||||||
| 851 | QApplicationPrivate::app_pal = new QPalette(pal); never executed: QApplicationPrivate::app_pal = new QPalette(pal); | 0 | ||||||||||||||||||||||||
| 852 | else | - | ||||||||||||||||||||||||
| 853 | * never executed: QApplicationPrivate::app_pal = pal;*QApplicationPrivate::app_pal = pal;never executed: *QApplicationPrivate::app_pal = pal; | 0 | ||||||||||||||||||||||||
| 854 | if (hash
| 0 | ||||||||||||||||||||||||
| 855 | all = true; | - | ||||||||||||||||||||||||
| 856 | if (clearWidgetPaletteHash
| 0 | ||||||||||||||||||||||||
| 857 | hash->clear(); never executed: hash->clear(); | 0 | ||||||||||||||||||||||||
| 858 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 859 | } never executed: else if (hashend of block
| 0 | ||||||||||||||||||||||||
| 860 | hash->insert(className, pal); | - | ||||||||||||||||||||||||
| 861 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 862 | - | |||||||||||||||||||||||||
| 863 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
| 864 | - | |||||||||||||||||||||||||
| 865 | QEvent e(QEvent::ApplicationPaletteChange); | - | ||||||||||||||||||||||||
| 866 | QApplication::sendEvent(QApplication::instance(), &e); | - | ||||||||||||||||||||||||
| 867 | - | |||||||||||||||||||||||||
| 868 | QWidgetList wids = QApplication::allWidgets(); | - | ||||||||||||||||||||||||
| 869 | for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 870 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 871 | if (all
| 0 | ||||||||||||||||||||||||
| 872 | QApplication::sendEvent(w, &e); never executed: QApplication::sendEvent(w, &e); | 0 | ||||||||||||||||||||||||
| 873 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||
| 877 | QList<QGraphicsScene *> &scenes = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->scene_list; | - | ||||||||||||||||||||||||
| 878 | for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin(); | - | ||||||||||||||||||||||||
| 879 | it != scenes.constEnd()
| 0 | ||||||||||||||||||||||||
| 880 | QApplication::sendEvent(*it, &e); | - | ||||||||||||||||||||||||
| 881 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 882 | - | |||||||||||||||||||||||||
| 883 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 884 | if (!className
| 0 | ||||||||||||||||||||||||
| 885 | if (!QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
| 886 | QApplicationPrivate::set_pal = new QPalette(palette); never executed: QApplicationPrivate::set_pal = new QPalette(palette); | 0 | ||||||||||||||||||||||||
| 887 | else | - | ||||||||||||||||||||||||
| 888 | * never executed: QApplicationPrivate::set_pal = palette;*QApplicationPrivate::set_pal = palette;never executed: *QApplicationPrivate::set_pal = palette; | 0 | ||||||||||||||||||||||||
| 889 | QCoreApplication::setAttribute(Qt::AA_SetPalette); | - | ||||||||||||||||||||||||
| 890 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 891 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 892 | void QApplication::setPalette(const QPalette &palette, const char* className) | - | ||||||||||||||||||||||||
| 893 | { | - | ||||||||||||||||||||||||
| 894 | QApplicationPrivate::setPalette_helper(palette, className, true); | - | ||||||||||||||||||||||||
| 895 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||
| 897 | - | |||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||
| 899 | void QApplicationPrivate::setSystemPalette(const QPalette &pal) | - | ||||||||||||||||||||||||
| 900 | { | - | ||||||||||||||||||||||||
| 901 | QPalette adjusted; | - | ||||||||||||||||||||||||
| 902 | adjusted = pal; | - | ||||||||||||||||||||||||
| 903 | - | |||||||||||||||||||||||||
| 904 | - | |||||||||||||||||||||||||
| 905 | if (!sys_pal
| 0 | ||||||||||||||||||||||||
| 906 | sys_pal = new QPalette(adjusted); never executed: sys_pal = new QPalette(adjusted); | 0 | ||||||||||||||||||||||||
| 907 | else | - | ||||||||||||||||||||||||
| 908 | * never executed: sys_pal = adjusted;*sys_pal = adjusted;never executed: *sys_pal = adjusted; | 0 | ||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||
| 910 | - | |||||||||||||||||||||||||
| 911 | if (!QApplicationPrivate::set_pal
| 0 | ||||||||||||||||||||||||
| 912 | QApplication::setPalette(*sys_pal); never executed: QApplication::setPalette(*sys_pal); | 0 | ||||||||||||||||||||||||
| 913 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 914 | - | |||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||
| 916 | - | |||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||
| 918 | - | |||||||||||||||||||||||||
| 919 | - | |||||||||||||||||||||||||
| 920 | QFont QApplication::font() | - | ||||||||||||||||||||||||
| 921 | { | - | ||||||||||||||||||||||||
| 922 | return never executed: QGuiApplication::font();return QGuiApplication::font();never executed: return QGuiApplication::font(); | 0 | ||||||||||||||||||||||||
| 923 | } | - | ||||||||||||||||||||||||
| 924 | QFont QApplication::font(const QWidget *widget) | - | ||||||||||||||||||||||||
| 925 | { | - | ||||||||||||||||||||||||
| 926 | typedef FontHash::const_iterator FontHashConstIt; | - | ||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||
| 928 | FontHash *hash = app_fonts(); | - | ||||||||||||||||||||||||
| 929 | - | |||||||||||||||||||||||||
| 930 | if (widget
| 0 | ||||||||||||||||||||||||
| 931 | FontHashConstIt it = hash->constFind(widget->metaObject()->className()); | - | ||||||||||||||||||||||||
| 932 | const FontHashConstIt cend = hash->constEnd(); | - | ||||||||||||||||||||||||
| 933 | if (it != cend
| 0 | ||||||||||||||||||||||||
| 934 | return never executed: it.value();return it.value();never executed: return it.value(); | 0 | ||||||||||||||||||||||||
| 935 | for (it = hash->constBegin(); it != cend
| 0 | ||||||||||||||||||||||||
| 936 | if (widget->inherits(it.key())
| 0 | ||||||||||||||||||||||||
| 937 | return never executed: it.value();return it.value();never executed: return it.value(); | 0 | ||||||||||||||||||||||||
| 938 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 939 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 940 | return never executed: font();return font();never executed: return font(); | 0 | ||||||||||||||||||||||||
| 941 | } | - | ||||||||||||||||||||||||
| 942 | QFont QApplication::font(const char *className) | - | ||||||||||||||||||||||||
| 943 | { | - | ||||||||||||||||||||||||
| 944 | FontHash *hash = app_fonts(); | - | ||||||||||||||||||||||||
| 945 | if (className
| 0 | ||||||||||||||||||||||||
| 946 | QHash<QByteArray, QFont>::ConstIterator it = hash->constFind(className); | - | ||||||||||||||||||||||||
| 947 | if (it != hash->constEnd()
| 0 | ||||||||||||||||||||||||
| 948 | return never executed: *it;return *it;never executed: return *it; | 0 | ||||||||||||||||||||||||
| 949 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 950 | return never executed: font();return font();never executed: return font(); | 0 | ||||||||||||||||||||||||
| 951 | } | - | ||||||||||||||||||||||||
| 952 | void QApplication::setFont(const QFont &font, const char *className) | - | ||||||||||||||||||||||||
| 953 | { | - | ||||||||||||||||||||||||
| 954 | bool all = false; | - | ||||||||||||||||||||||||
| 955 | FontHash *hash = app_fonts(); | - | ||||||||||||||||||||||||
| 956 | if (!className
| 0 | ||||||||||||||||||||||||
| 957 | QGuiApplication::setFont(font); | - | ||||||||||||||||||||||||
| 958 | if (hash
| 0 | ||||||||||||||||||||||||
| 959 | all = true; | - | ||||||||||||||||||||||||
| 960 | hash->clear(); | - | ||||||||||||||||||||||||
| 961 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 962 | } never executed: else if (hashend of block
| 0 | ||||||||||||||||||||||||
| 963 | hash->insert(className, font); | - | ||||||||||||||||||||||||
| 964 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 965 | if (QApplicationPrivate::is_app_running
| 0 | ||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||
| 967 | QEvent e(QEvent::ApplicationFontChange); | - | ||||||||||||||||||||||||
| 968 | QApplication::sendEvent(QApplication::instance(), &e); | - | ||||||||||||||||||||||||
| 969 | - | |||||||||||||||||||||||||
| 970 | QWidgetList wids = QApplication::allWidgets(); | - | ||||||||||||||||||||||||
| 971 | for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 972 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 973 | if (all
| 0 | ||||||||||||||||||||||||
| 974 | sendEvent(w, &e); never executed: sendEvent(w, &e); | 0 | ||||||||||||||||||||||||
| 975 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||
| 977 | - | |||||||||||||||||||||||||
| 978 | - | |||||||||||||||||||||||||
| 979 | QList<QGraphicsScene *> &scenes = (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->scene_list; | - | ||||||||||||||||||||||||
| 980 | for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin(); | - | ||||||||||||||||||||||||
| 981 | it != scenes.constEnd()
| 0 | ||||||||||||||||||||||||
| 982 | QApplication::sendEvent(*it, &e); | - | ||||||||||||||||||||||||
| 983 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 984 | - | |||||||||||||||||||||||||
| 985 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 986 | if (!className
| 0 | ||||||||||||||||||||||||
| 987 | if (!QApplicationPrivate::set_font
| 0 | ||||||||||||||||||||||||
| 988 | QApplicationPrivate::set_font = new QFont(font); never executed: QApplicationPrivate::set_font = new QFont(font); | 0 | ||||||||||||||||||||||||
| 989 | else | - | ||||||||||||||||||||||||
| 990 | * never executed: QApplicationPrivate::set_font = font;*QApplicationPrivate::set_font = font;never executed: *QApplicationPrivate::set_font = font; | 0 | ||||||||||||||||||||||||
| 991 | } | - | ||||||||||||||||||||||||
| 992 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 993 | - | |||||||||||||||||||||||||
| 994 | - | |||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||
| 996 | void QApplicationPrivate::setSystemFont(const QFont &font) | - | ||||||||||||||||||||||||
| 997 | { | - | ||||||||||||||||||||||||
| 998 | if (!sys_font
| 0 | ||||||||||||||||||||||||
| 999 | sys_font = new QFont(font); never executed: sys_font = new QFont(font); | 0 | ||||||||||||||||||||||||
| 1000 | else | - | ||||||||||||||||||||||||
| 1001 | * never executed: sys_font = font;*sys_font = font;never executed: *sys_font = font; | 0 | ||||||||||||||||||||||||
| 1002 | - | |||||||||||||||||||||||||
| 1003 | if (!QApplicationPrivate::set_font
| 0 | ||||||||||||||||||||||||
| 1004 | QApplication::setFont(*sys_font); never executed: QApplication::setFont(*sys_font); | 0 | ||||||||||||||||||||||||
| 1005 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1006 | - | |||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||
| 1008 | - | |||||||||||||||||||||||||
| 1009 | QString QApplicationPrivate::desktopStyleKey() | - | ||||||||||||||||||||||||
| 1010 | { | - | ||||||||||||||||||||||||
| 1011 | - | |||||||||||||||||||||||||
| 1012 | - | |||||||||||||||||||||||||
| 1013 | if (const
| 0 | ||||||||||||||||||||||||
| 1014 | const QStringList availableKeys = QStyleFactory::keys(); | - | ||||||||||||||||||||||||
| 1015 | const auto styles = theme->themeHint(QPlatformTheme::StyleNames).toStringList(); | - | ||||||||||||||||||||||||
| 1016 | for (const QString &style : styles) { | - | ||||||||||||||||||||||||
| 1017 | if (availableKeys.contains(style, Qt::CaseInsensitive)
| 0 | ||||||||||||||||||||||||
| 1018 | return never executed: style;return style;never executed: return style; | 0 | ||||||||||||||||||||||||
| 1019 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1020 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1021 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 1022 | } | - | ||||||||||||||||||||||||
| 1023 | QIcon QApplication::windowIcon() | - | ||||||||||||||||||||||||
| 1024 | { | - | ||||||||||||||||||||||||
| 1025 | return never executed: QGuiApplication::windowIcon();return QGuiApplication::windowIcon();never executed: return QGuiApplication::windowIcon(); | 0 | ||||||||||||||||||||||||
| 1026 | } | - | ||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||
| 1028 | void QApplication::setWindowIcon(const QIcon &icon) | - | ||||||||||||||||||||||||
| 1029 | { | - | ||||||||||||||||||||||||
| 1030 | QGuiApplication::setWindowIcon(icon); | - | ||||||||||||||||||||||||
| 1031 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||
| 1034 | void QApplicationPrivate::notifyWindowIconChanged() | - | ||||||||||||||||||||||||
| 1035 | { | - | ||||||||||||||||||||||||
| 1036 | QEvent ev(QEvent::ApplicationWindowIconChange); | - | ||||||||||||||||||||||||
| 1037 | const QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1038 | QWindowList windowList = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||
| 1039 | - | |||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||
| 1041 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1042 | windowList.removeOne(w->windowHandle()); | - | ||||||||||||||||||||||||
| 1043 | QCoreApplication::sendEvent(w, &ev); | - | ||||||||||||||||||||||||
| 1044 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1045 | - | |||||||||||||||||||||||||
| 1046 | - | |||||||||||||||||||||||||
| 1047 | - | |||||||||||||||||||||||||
| 1048 | for (int i = 0; i < windowList.size()
| 0 | ||||||||||||||||||||||||
| 1049 | QCoreApplication::sendEvent(windowList.at(i), &ev); never executed: QCoreApplication::sendEvent(windowList.at(i), &ev); | 0 | ||||||||||||||||||||||||
| 1050 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1051 | QWidgetList QApplication::topLevelWidgets() | - | ||||||||||||||||||||||||
| 1052 | { | - | ||||||||||||||||||||||||
| 1053 | QWidgetList list; | - | ||||||||||||||||||||||||
| 1054 | QWidgetList all = allWidgets(); | - | ||||||||||||||||||||||||
| 1055 | - | |||||||||||||||||||||||||
| 1056 | for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend
| 0 | ||||||||||||||||||||||||
| 1057 | QWidget *w = *it; | - | ||||||||||||||||||||||||
| 1058 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
| 1059 | list.append(w); never executed: list.append(w); | 0 | ||||||||||||||||||||||||
| 1060 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1061 | return never executed: list;return list;never executed: return list; | 0 | ||||||||||||||||||||||||
| 1062 | } | - | ||||||||||||||||||||||||
| 1063 | QWidgetList QApplication::allWidgets() | - | ||||||||||||||||||||||||
| 1064 | { | - | ||||||||||||||||||||||||
| 1065 | if (QWidgetPrivate::allWidgets
| 0 | ||||||||||||||||||||||||
| 1066 | return never executed: QWidgetPrivate::allWidgets->toList();return QWidgetPrivate::allWidgets->toList();never executed: return QWidgetPrivate::allWidgets->toList(); | 0 | ||||||||||||||||||||||||
| 1067 | return never executed: QWidgetList();return QWidgetList();never executed: return QWidgetList(); | 0 | ||||||||||||||||||||||||
| 1068 | } | - | ||||||||||||||||||||||||
| 1069 | QWidget *QApplication::focusWidget() | - | ||||||||||||||||||||||||
| 1070 | { | - | ||||||||||||||||||||||||
| 1071 | return never executed: QApplicationPrivate::focus_widget;return QApplicationPrivate::focus_widget;never executed: return QApplicationPrivate::focus_widget; | 0 | ||||||||||||||||||||||||
| 1072 | } | - | ||||||||||||||||||||||||
| 1073 | - | |||||||||||||||||||||||||
| 1074 | void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) | - | ||||||||||||||||||||||||
| 1075 | { | - | ||||||||||||||||||||||||
| 1076 | - | |||||||||||||||||||||||||
| 1077 | if (focus
| 0 | ||||||||||||||||||||||||
| 1078 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1079 | - | |||||||||||||||||||||||||
| 1080 | - | |||||||||||||||||||||||||
| 1081 | hidden_focus_widget = 0; | - | ||||||||||||||||||||||||
| 1082 | - | |||||||||||||||||||||||||
| 1083 | if (focus != focus_widget
| 0 | ||||||||||||||||||||||||
| 1084 | if (focus
| 0 | ||||||||||||||||||||||||
| 1085 | hidden_focus_widget = focus; | - | ||||||||||||||||||||||||
| 1086 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1087 | } | - | ||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||
| 1089 | if (focus
| 0 | ||||||||||||||||||||||||
| 1090 | && qt_in_tab_key_event
| 0 | ||||||||||||||||||||||||
| 1091 | focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); never executed: focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); | 0 | ||||||||||||||||||||||||
| 1092 | else if (focus
| 0 | ||||||||||||||||||||||||
| 1093 | focus->window()->setAttribute(Qt::WA_KeyboardFocusChange); | - | ||||||||||||||||||||||||
| 1094 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1095 | QWidget *prev = focus_widget; | - | ||||||||||||||||||||||||
| 1096 | focus_widget = focus; | - | ||||||||||||||||||||||||
| 1097 | - | |||||||||||||||||||||||||
| 1098 | if(focus_widget
| 0 | ||||||||||||||||||||||||
| 1099 | focus_widget->d_func()->setFocus_sys(); never executed: focus_widget->d_func()->setFocus_sys(); | 0 | ||||||||||||||||||||||||
| 1100 | - | |||||||||||||||||||||||||
| 1101 | if (reason != Qt::NoFocusReason
| 0 | ||||||||||||||||||||||||
| 1102 | - | |||||||||||||||||||||||||
| 1103 | - | |||||||||||||||||||||||||
| 1104 | if (prev
| 0 | ||||||||||||||||||||||||
| 1105 | - | |||||||||||||||||||||||||
| 1106 | - | |||||||||||||||||||||||||
| 1107 | - | |||||||||||||||||||||||||
| 1108 | - | |||||||||||||||||||||||||
| 1109 | - | |||||||||||||||||||||||||
| 1110 | - | |||||||||||||||||||||||||
| 1111 | QFocusEvent out(QEvent::FocusOut, reason); | - | ||||||||||||||||||||||||
| 1112 | QPointer<QWidget> that = prev; | - | ||||||||||||||||||||||||
| 1113 | QApplication::sendEvent(prev, &out); | - | ||||||||||||||||||||||||
| 1114 | if (that
| 0 | ||||||||||||||||||||||||
| 1115 | QApplication::sendEvent(that->style(), &out); never executed: QApplication::sendEvent(that->style(), &out); | 0 | ||||||||||||||||||||||||
| 1116 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1117 | if(focus
| 0 | ||||||||||||||||||||||||
| 1118 | QFocusEvent in(QEvent::FocusIn, reason); | - | ||||||||||||||||||||||||
| 1119 | QPointer<QWidget> that = focus; | - | ||||||||||||||||||||||||
| 1120 | QApplication::sendEvent(focus, &in); | - | ||||||||||||||||||||||||
| 1121 | if (that
| 0 | ||||||||||||||||||||||||
| 1122 | QApplication::sendEvent(that->style(), &in); never executed: QApplication::sendEvent(that->style(), &in); | 0 | ||||||||||||||||||||||||
| 1123 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1124 | (static_cast<QApplication *>(QCoreApplication::instance()))->focusChanged(prev, focus_widget); | - | ||||||||||||||||||||||||
| 1125 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1126 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1127 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1128 | QWidget *QApplication::activeWindow() | - | ||||||||||||||||||||||||
| 1129 | { | - | ||||||||||||||||||||||||
| 1130 | return never executed: QApplicationPrivate::active_window;return QApplicationPrivate::active_window;never executed: return QApplicationPrivate::active_window; | 0 | ||||||||||||||||||||||||
| 1131 | } | - | ||||||||||||||||||||||||
| 1132 | - | |||||||||||||||||||||||||
| 1133 | - | |||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||
| 1136 | - | |||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||
| 1138 | - | |||||||||||||||||||||||||
| 1139 | QFontMetrics QApplication::fontMetrics() | - | ||||||||||||||||||||||||
| 1140 | { | - | ||||||||||||||||||||||||
| 1141 | return never executed: desktop()->fontMetrics();return desktop()->fontMetrics();never executed: return desktop()->fontMetrics(); | 0 | ||||||||||||||||||||||||
| 1142 | } | - | ||||||||||||||||||||||||
| 1143 | - | |||||||||||||||||||||||||
| 1144 | bool QApplicationPrivate::tryCloseAllWidgetWindows(QWindowList *processedWindows) | - | ||||||||||||||||||||||||
| 1145 | { | - | ||||||||||||||||||||||||
| 1146 | ((!(processedWindows)) ? qt_assert("processedWindows",__FILE__,1910) : qt_noop()); | - | ||||||||||||||||||||||||
| 1147 | while (QWidget *w = QApplication::activeModalWidget()
| 0 | ||||||||||||||||||||||||
| 1148 | if (!w->isVisible()
| 0 | ||||||||||||||||||||||||
| 1149 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1150 | QWindow *window = w->windowHandle(); | - | ||||||||||||||||||||||||
| 1151 | if (!window->close()
| 0 | ||||||||||||||||||||||||
| 1152 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1153 | if (window
| 0 | ||||||||||||||||||||||||
| 1154 | processedWindows->append(window); never executed: processedWindows->append(window); | 0 | ||||||||||||||||||||||||
| 1155 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1156 | - | |||||||||||||||||||||||||
| 1157 | retry: code before this statement never executed: retry: | 0 | ||||||||||||||||||||||||
| 1158 | const QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1159 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1160 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
| 1161 | !w->testAttribute(Qt::WA_DontShowOnScreen)
| 0 | ||||||||||||||||||||||||
| 1162 | QWindow *window = w->windowHandle(); | - | ||||||||||||||||||||||||
| 1163 | if (!window->close()
| 0 | ||||||||||||||||||||||||
| 1164 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1165 | if (window
| 0 | ||||||||||||||||||||||||
| 1166 | processedWindows->append(window); never executed: processedWindows->append(window); | 0 | ||||||||||||||||||||||||
| 1167 | goto never executed: retry;goto retry;never executed: goto retry; | 0 | ||||||||||||||||||||||||
| 1168 | } | - | ||||||||||||||||||||||||
| 1169 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1170 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1171 | } | - | ||||||||||||||||||||||||
| 1172 | - | |||||||||||||||||||||||||
| 1173 | bool QApplicationPrivate::tryCloseAllWindows() | - | ||||||||||||||||||||||||
| 1174 | { | - | ||||||||||||||||||||||||
| 1175 | QWindowList processedWindows; | - | ||||||||||||||||||||||||
| 1176 | return never executed: QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows)return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows) && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows);never executed: return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows) && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); | 0 | ||||||||||||||||||||||||
| 1177 | && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); never executed: return QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows) && QGuiApplicationPrivate::tryCloseRemainingWindows(processedWindows); | 0 | ||||||||||||||||||||||||
| 1178 | } | - | ||||||||||||||||||||||||
| 1179 | void QApplication::closeAllWindows() | - | ||||||||||||||||||||||||
| 1180 | { | - | ||||||||||||||||||||||||
| 1181 | QWindowList processedWindows; | - | ||||||||||||||||||||||||
| 1182 | QApplicationPrivate::tryCloseAllWidgetWindows(&processedWindows); | - | ||||||||||||||||||||||||
| 1183 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1184 | void QApplication::aboutQt() | - | ||||||||||||||||||||||||
| 1185 | { | - | ||||||||||||||||||||||||
| 1186 | - | |||||||||||||||||||||||||
| 1187 | QMessageBox::aboutQt(activeWindow()); | - | ||||||||||||||||||||||||
| 1188 | - | |||||||||||||||||||||||||
| 1189 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1190 | bool QApplication::event(QEvent *e) | - | ||||||||||||||||||||||||
| 1191 | { | - | ||||||||||||||||||||||||
| 1192 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1193 | if(e->type() == QEvent::Close
| 0 | ||||||||||||||||||||||||
| 1194 | QCloseEvent *ce = static_cast<QCloseEvent*>(e); | - | ||||||||||||||||||||||||
| 1195 | ce->accept(); | - | ||||||||||||||||||||||||
| 1196 | closeAllWindows(); | - | ||||||||||||||||||||||||
| 1197 | - | |||||||||||||||||||||||||
| 1198 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1199 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1200 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
| 1201 | (!(w->windowType() == Qt::Dialog)
| 0 | ||||||||||||||||||||||||
| 1202 | ce->ignore(); | - | ||||||||||||||||||||||||
| 1203 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1204 | } | - | ||||||||||||||||||||||||
| 1205 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1206 | if (ce->isAccepted()
| 0 | ||||||||||||||||||||||||
| 1207 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1208 | } | - | ||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||
| 1210 | } never executed: else if (e->type() == QEvent::LocaleChangeend of block
| 0 | ||||||||||||||||||||||||
| 1211 | - | |||||||||||||||||||||||||
| 1212 | - | |||||||||||||||||||||||||
| 1213 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1214 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1215 | if (!(w->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
| 1216 | if (!w->testAttribute(Qt::WA_SetLocale)
| 0 | ||||||||||||||||||||||||
| 1217 | w->d_func()->setLocale_helper(QLocale(), true); never executed: w->d_func()->setLocale_helper(QLocale(), true); | 0 | ||||||||||||||||||||||||
| 1218 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1219 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1220 | - | |||||||||||||||||||||||||
| 1221 | } never executed: else if (e->type() == QEvent::Timerend of block
| 0 | ||||||||||||||||||||||||
| 1222 | QTimerEvent *te = static_cast<QTimerEvent*>(e); | - | ||||||||||||||||||||||||
| 1223 | ((!(te != 0)) ? qt_assert("te != 0",__FILE__,2035) : qt_noop()); | - | ||||||||||||||||||||||||
| 1224 | if (te->timerId() == d->toolTipWakeUp.timerId()
| 0 | ||||||||||||||||||||||||
| 1225 | d->toolTipWakeUp.stop(); | - | ||||||||||||||||||||||||
| 1226 | if (d->toolTipWidget
| 0 | ||||||||||||||||||||||||
| 1227 | QWidget *w = d->toolTipWidget->window(); | - | ||||||||||||||||||||||||
| 1228 | - | |||||||||||||||||||||||||
| 1229 | - | |||||||||||||||||||||||||
| 1230 | - | |||||||||||||||||||||||||
| 1231 | bool showToolTip = w->testAttribute(Qt::WA_AlwaysShowToolTips); | - | ||||||||||||||||||||||||
| 1232 | while (w
| 0 | ||||||||||||||||||||||||
| 1233 | showToolTip = w->isActiveWindow(); | - | ||||||||||||||||||||||||
| 1234 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 1235 | w = w
| 0 | ||||||||||||||||||||||||
| 1236 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1237 | if (showToolTip
| 0 | ||||||||||||||||||||||||
| 1238 | QHelpEvent e(QEvent::ToolTip, d->toolTipPos, d->toolTipGlobalPos); | - | ||||||||||||||||||||||||
| 1239 | QApplication::sendEvent(d->toolTipWidget, &e); | - | ||||||||||||||||||||||||
| 1240 | if (e.isAccepted()
| 0 | ||||||||||||||||||||||||
| 1241 | QStyle *s = d->toolTipWidget->style(); | - | ||||||||||||||||||||||||
| 1242 | int sleepDelay = s->styleHint(QStyle::SH_ToolTip_FallAsleepDelay, 0, d->toolTipWidget, 0); | - | ||||||||||||||||||||||||
| 1243 | d->toolTipFallAsleep.start(sleepDelay, this); | - | ||||||||||||||||||||||||
| 1244 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1245 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1246 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1247 | } never executed: else if (te->timerId() == d->toolTipFallAsleep.timerId()end of block
| 0 | ||||||||||||||||||||||||
| 1248 | d->toolTipFallAsleep.stop(); | - | ||||||||||||||||||||||||
| 1249 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1250 | - | |||||||||||||||||||||||||
| 1251 | } never executed: else if (e->type() == QEvent::EnterWhatsThisModeend of block
| 0 | ||||||||||||||||||||||||
| 1252 | QWhatsThis::enterWhatsThisMode(); | - | ||||||||||||||||||||||||
| 1253 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1254 | - | |||||||||||||||||||||||||
| 1255 | } | - | ||||||||||||||||||||||||
| 1256 | - | |||||||||||||||||||||||||
| 1257 | if(e->type() == QEvent::LanguageChange
| 0 | ||||||||||||||||||||||||
| 1258 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1259 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1260 | if (!(w->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
| 1261 | postEvent(w, new QEvent(QEvent::LanguageChange)); never executed: postEvent(w, new QEvent(QEvent::LanguageChange)); | 0 | ||||||||||||||||||||||||
| 1262 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1263 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1264 | - | |||||||||||||||||||||||||
| 1265 | return never executed: QGuiApplication::event(e);return QGuiApplication::event(e);never executed: return QGuiApplication::event(e); | 0 | ||||||||||||||||||||||||
| 1266 | } | - | ||||||||||||||||||||||||
| 1267 | void QApplicationPrivate::notifyLayoutDirectionChange() | - | ||||||||||||||||||||||||
| 1268 | { | - | ||||||||||||||||||||||||
| 1269 | const QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1270 | QWindowList windowList = QGuiApplication::topLevelWindows(); | - | ||||||||||||||||||||||||
| 1271 | - | |||||||||||||||||||||||||
| 1272 | - | |||||||||||||||||||||||||
| 1273 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1274 | windowList.removeAll(w->windowHandle()); | - | ||||||||||||||||||||||||
| 1275 | QEvent ev(QEvent::ApplicationLayoutDirectionChange); | - | ||||||||||||||||||||||||
| 1276 | QCoreApplication::sendEvent(w, &ev); | - | ||||||||||||||||||||||||
| 1277 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1278 | - | |||||||||||||||||||||||||
| 1279 | - | |||||||||||||||||||||||||
| 1280 | - | |||||||||||||||||||||||||
| 1281 | for (int i = 0; i < windowList.size()
| 0 | ||||||||||||||||||||||||
| 1282 | QEvent ev(QEvent::ApplicationLayoutDirectionChange); | - | ||||||||||||||||||||||||
| 1283 | QCoreApplication::sendEvent(windowList.at(i), &ev); | - | ||||||||||||||||||||||||
| 1284 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1285 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1286 | void QApplication::setActiveWindow(QWidget* act) | - | ||||||||||||||||||||||||
| 1287 | { | - | ||||||||||||||||||||||||
| 1288 | QWidget* window = act
| 0 | ||||||||||||||||||||||||
| 1289 | - | |||||||||||||||||||||||||
| 1290 | if (QApplicationPrivate::active_window == window
| 0 | ||||||||||||||||||||||||
| 1291 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1292 | - | |||||||||||||||||||||||||
| 1293 | - | |||||||||||||||||||||||||
| 1294 | if (window
| 0 | ||||||||||||||||||||||||
| 1295 | - | |||||||||||||||||||||||||
| 1296 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1297 | } | - | ||||||||||||||||||||||||
| 1298 | - | |||||||||||||||||||||||||
| 1299 | - | |||||||||||||||||||||||||
| 1300 | QWidgetList toBeActivated; | - | ||||||||||||||||||||||||
| 1301 | QWidgetList toBeDeactivated; | - | ||||||||||||||||||||||||
| 1302 | - | |||||||||||||||||||||||||
| 1303 | if (QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||
| 1304 | if (style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window)
| 0 | ||||||||||||||||||||||||
| 1305 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1306 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1307 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
| 1308 | toBeDeactivated.append(w); never executed: toBeDeactivated.append(w); | 0 | ||||||||||||||||||||||||
| 1309 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1310 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1311 | toBeDeactivated.append(QApplicationPrivate::active_window); | - | ||||||||||||||||||||||||
| 1312 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1313 | } | - | ||||||||||||||||||||||||
| 1314 | - | |||||||||||||||||||||||||
| 1315 | if (QApplicationPrivate::focus_widget
| 0 | ||||||||||||||||||||||||
| 1316 | if (QApplicationPrivate::focus_widget->testAttribute(Qt::WA_InputMethodEnabled)
| 0 | ||||||||||||||||||||||||
| 1317 | QGuiApplication::inputMethod()->commit(); never executed: QGuiApplication::inputMethod()->commit(); | 0 | ||||||||||||||||||||||||
| 1318 | - | |||||||||||||||||||||||||
| 1319 | QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, Qt::ActiveWindowFocusReason); | - | ||||||||||||||||||||||||
| 1320 | QApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange); | - | ||||||||||||||||||||||||
| 1321 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1322 | - | |||||||||||||||||||||||||
| 1323 | QApplicationPrivate::active_window = window; | - | ||||||||||||||||||||||||
| 1324 | - | |||||||||||||||||||||||||
| 1325 | if (QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||
| 1326 | if (style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, QApplicationPrivate::active_window)
| 0 | ||||||||||||||||||||||||
| 1327 | const QWidgetList list = topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1328 | for (auto *w : list) { | - | ||||||||||||||||||||||||
| 1329 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
| 1330 | toBeActivated.append(w); never executed: toBeActivated.append(w); | 0 | ||||||||||||||||||||||||
| 1331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1332 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1333 | toBeActivated.append(QApplicationPrivate::active_window); | - | ||||||||||||||||||||||||
| 1334 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1335 | - | |||||||||||||||||||||||||
| 1336 | } | - | ||||||||||||||||||||||||
| 1337 | - | |||||||||||||||||||||||||
| 1338 | - | |||||||||||||||||||||||||
| 1339 | QEvent activationChange(QEvent::ActivationChange); | - | ||||||||||||||||||||||||
| 1340 | QEvent windowActivate(QEvent::WindowActivate); | - | ||||||||||||||||||||||||
| 1341 | QEvent windowDeactivate(QEvent::WindowDeactivate); | - | ||||||||||||||||||||||||
| 1342 | - | |||||||||||||||||||||||||
| 1343 | for (int i = 0; i < toBeActivated.size()
| 0 | ||||||||||||||||||||||||
| 1344 | QWidget *w = toBeActivated.at(i); | - | ||||||||||||||||||||||||
| 1345 | sendSpontaneousEvent(w, &windowActivate); | - | ||||||||||||||||||||||||
| 1346 | sendSpontaneousEvent(w, &activationChange); | - | ||||||||||||||||||||||||
| 1347 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1348 | - | |||||||||||||||||||||||||
| 1349 | for(int i = 0; i < toBeDeactivated.size()
| 0 | ||||||||||||||||||||||||
| 1350 | QWidget *w = toBeDeactivated.at(i); | - | ||||||||||||||||||||||||
| 1351 | sendSpontaneousEvent(w, &windowDeactivate); | - | ||||||||||||||||||||||||
| 1352 | sendSpontaneousEvent(w, &activationChange); | - | ||||||||||||||||||||||||
| 1353 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1354 | - | |||||||||||||||||||||||||
| 1355 | if (QApplicationPrivate::popupWidgets == 0
| 0 | ||||||||||||||||||||||||
| 1356 | - | |||||||||||||||||||||||||
| 1357 | if (!QApplicationPrivate::active_window
| 0 | ||||||||||||||||||||||||
| 1358 | QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); | - | ||||||||||||||||||||||||
| 1359 | } never executed: else if (QApplicationPrivate::active_windowend of block
| 0 | ||||||||||||||||||||||||
| 1360 | QWidget *w = QApplicationPrivate::active_window->focusWidget(); | - | ||||||||||||||||||||||||
| 1361 | if (w
| 0 | ||||||||||||||||||||||||
| 1362 | w->setFocus(Qt::ActiveWindowFocusReason); never executed: w->setFocus(Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
| 1363 | else { | - | ||||||||||||||||||||||||
| 1364 | w = QApplicationPrivate::focusNextPrevChild_helper(QApplicationPrivate::active_window, true); | - | ||||||||||||||||||||||||
| 1365 | if (w
| 0 | ||||||||||||||||||||||||
| 1366 | w->setFocus(Qt::ActiveWindowFocusReason); | - | ||||||||||||||||||||||||
| 1367 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1368 | - | |||||||||||||||||||||||||
| 1369 | w = QApplicationPrivate::focus_widget; | - | ||||||||||||||||||||||||
| 1370 | if (!w
| 0 | ||||||||||||||||||||||||
| 1371 | QApplicationPrivate::setFocusWidget(QApplicationPrivate::active_window, Qt::ActiveWindowFocusReason); never executed: QApplicationPrivate::setFocusWidget(QApplicationPrivate::active_window, Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
| 1372 | else if (!QApplicationPrivate::active_window->isAncestorOf(w)
| 0 | ||||||||||||||||||||||||
| 1373 | QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); never executed: QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
| 1374 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1375 | } | - | ||||||||||||||||||||||||
| 1376 | } | - | ||||||||||||||||||||||||
| 1377 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1378 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1379 | - | |||||||||||||||||||||||||
| 1380 | QWidget *qt_tlw_for_window(QWindow *wnd) | - | ||||||||||||||||||||||||
| 1381 | { | - | ||||||||||||||||||||||||
| 1382 | - | |||||||||||||||||||||||||
| 1383 | while (wnd
| 0 | ||||||||||||||||||||||||
| 1384 | QWindow *parent = wnd->parent(); | - | ||||||||||||||||||||||||
| 1385 | - | |||||||||||||||||||||||||
| 1386 | if (parent
| 0 | ||||||||||||||||||||||||
| 1387 | wnd = wnd->parent(); never executed: wnd = wnd->parent(); | 0 | ||||||||||||||||||||||||
| 1388 | else | - | ||||||||||||||||||||||||
| 1389 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1390 | } | - | ||||||||||||||||||||||||
| 1391 | if (wnd
| 0 | ||||||||||||||||||||||||
| 1392 | const auto tlws = (static_cast<QApplication *>(QCoreApplication::instance()))->topLevelWidgets(); | - | ||||||||||||||||||||||||
| 1393 | for (QWidget *tlw : tlws) { | - | ||||||||||||||||||||||||
| 1394 | if (tlw->windowHandle() == wnd
| 0 | ||||||||||||||||||||||||
| 1395 | return never executed: tlw;return tlw;never executed: return tlw; | 0 | ||||||||||||||||||||||||
| 1396 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1397 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1398 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 1399 | } | - | ||||||||||||||||||||||||
| 1400 | - | |||||||||||||||||||||||||
| 1401 | void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous) | - | ||||||||||||||||||||||||
| 1402 | { | - | ||||||||||||||||||||||||
| 1403 | (void)previous;; | - | ||||||||||||||||||||||||
| 1404 | QWindow *wnd = QGuiApplicationPrivate::focus_window; | - | ||||||||||||||||||||||||
| 1405 | if (inPopupMode()
| 0 | ||||||||||||||||||||||||
| 1406 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1407 | QWidget *tlw = qt_tlw_for_window(wnd); | - | ||||||||||||||||||||||||
| 1408 | QApplication::setActiveWindow(tlw); | - | ||||||||||||||||||||||||
| 1409 | - | |||||||||||||||||||||||||
| 1410 | if (wnd
| 0 | ||||||||||||||||||||||||
| 1411 | if (QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(wnd)
| 0 | ||||||||||||||||||||||||
| 1412 | if (QWidget *widget = widgetWindow->widget()
| 0 | ||||||||||||||||||||||||
| 1413 | if (widget->inherits("QAxHostWidget")
| 0 | ||||||||||||||||||||||||
| 1414 | widget->setFocus(Qt::ActiveWindowFocusReason); never executed: widget->setFocus(Qt::ActiveWindowFocusReason); | 0 | ||||||||||||||||||||||||
| 1415 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1416 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1417 | - | |||||||||||||||||||||||||
| 1418 | - | |||||||||||||||||||||||||
| 1419 | - | |||||||||||||||||||||||||
| 1420 | - | |||||||||||||||||||||||||
| 1421 | - | |||||||||||||||||||||||||
| 1422 | - | |||||||||||||||||||||||||
| 1423 | QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool next, | - | ||||||||||||||||||||||||
| 1424 | bool *wrappingOccurred) | - | ||||||||||||||||||||||||
| 1425 | { | - | ||||||||||||||||||||||||
| 1426 | uint focus_flag = qt_tab_all_widgets()
| 0 | ||||||||||||||||||||||||
| 1427 | - | |||||||||||||||||||||||||
| 1428 | QWidget *f = toplevel->focusWidget(); | - | ||||||||||||||||||||||||
| 1429 | if (!f
| 0 | ||||||||||||||||||||||||
| 1430 | f = toplevel; never executed: f = toplevel; | 0 | ||||||||||||||||||||||||
| 1431 | - | |||||||||||||||||||||||||
| 1432 | QWidget *w = f; | - | ||||||||||||||||||||||||
| 1433 | QWidget *test = f->d_func()->focus_next; | - | ||||||||||||||||||||||||
| 1434 | bool seenWindow = false; | - | ||||||||||||||||||||||||
| 1435 | bool focusWidgetAfterWindow = false; | - | ||||||||||||||||||||||||
| 1436 | while (test
| 0 | ||||||||||||||||||||||||
| 1437 | if (test->isWindow()
| 0 | ||||||||||||||||||||||||
| 1438 | seenWindow = true; never executed: seenWindow = true; | 0 | ||||||||||||||||||||||||
| 1439 | - | |||||||||||||||||||||||||
| 1440 | if ((
| 0 | ||||||||||||||||||||||||
| 1441 | && !(test->d_func()->extra
| 0 | ||||||||||||||||||||||||
| 1442 | && test->isVisibleTo(toplevel)
| 0 | ||||||||||||||||||||||||
| 1443 | && !(w->windowType() == Qt::SubWindow
| 0 | ||||||||||||||||||||||||
| 1444 | && (toplevel->windowType() != Qt::SubWindow
| 0 | ||||||||||||||||||||||||
| 1445 | w = test; | - | ||||||||||||||||||||||||
| 1446 | if (seenWindow
| 0 | ||||||||||||||||||||||||
| 1447 | focusWidgetAfterWindow = true; never executed: focusWidgetAfterWindow = true; | 0 | ||||||||||||||||||||||||
| 1448 | if (next
| 0 | ||||||||||||||||||||||||
| 1449 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1450 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1451 | test = test->d_func()->focus_next; | - | ||||||||||||||||||||||||
| 1452 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1453 | - | |||||||||||||||||||||||||
| 1454 | if (wrappingOccurred != 0
| 0 | ||||||||||||||||||||||||
| 1455 | * never executed: wrappingOccurred = next*wrappingOccurred = next ? focusWidgetAfterWindow : !focusWidgetAfterWindow;
never executed: *wrappingOccurred = next ? focusWidgetAfterWindow : !focusWidgetAfterWindow; | 0 | ||||||||||||||||||||||||
| 1456 | - | |||||||||||||||||||||||||
| 1457 | if (w == f
| 0 | ||||||||||||||||||||||||
| 1458 | if (qt_in_tab_key_event
| 0 | ||||||||||||||||||||||||
| 1459 | w->window()->setAttribute(Qt::WA_KeyboardFocusChange); | - | ||||||||||||||||||||||||
| 1460 | w->update(); | - | ||||||||||||||||||||||||
| 1461 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1462 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 1463 | } | - | ||||||||||||||||||||||||
| 1464 | return never executed: w;return w;never executed: return w; | 0 | ||||||||||||||||||||||||
| 1465 | } | - | ||||||||||||||||||||||||
| 1466 | void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, const QPointF &globalPosF) | - | ||||||||||||||||||||||||
| 1467 | { | - | ||||||||||||||||||||||||
| 1468 | if ((!enter
| 0 | ||||||||||||||||||||||||
| 1469 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1470 | - | |||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||
| 1472 | - | |||||||||||||||||||||||||
| 1473 | QWidgetList leaveList; | - | ||||||||||||||||||||||||
| 1474 | QWidgetList enterList; | - | ||||||||||||||||||||||||
| 1475 | - | |||||||||||||||||||||||||
| 1476 | bool sameWindow = leave
| 0 | ||||||||||||||||||||||||
| 1477 | if (leave
| 0 | ||||||||||||||||||||||||
| 1478 | auto *w = leave; | - | ||||||||||||||||||||||||
| 1479 | do { | - | ||||||||||||||||||||||||
| 1480 | leaveList.append(w); | - | ||||||||||||||||||||||||
| 1481 | } never executed: while (!w->isWindow()end of block
| 0 | ||||||||||||||||||||||||
| 1482 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1483 | if (enter
| 0 | ||||||||||||||||||||||||
| 1484 | auto *w = enter; | - | ||||||||||||||||||||||||
| 1485 | do { | - | ||||||||||||||||||||||||
| 1486 | enterList.append(w); | - | ||||||||||||||||||||||||
| 1487 | } never executed: while (!w->isWindow()end of block
| 0 | ||||||||||||||||||||||||
| 1488 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1489 | if (sameWindow
| 0 | ||||||||||||||||||||||||
| 1490 | int enterDepth = 0; | - | ||||||||||||||||||||||||
| 1491 | int leaveDepth = 0; | - | ||||||||||||||||||||||||
| 1492 | auto *e = enter; | - | ||||||||||||||||||||||||
| 1493 | while (!e->isWindow()
| 0 | ||||||||||||||||||||||||
| 1494 | enterDepth++; never executed: enterDepth++; | 0 | ||||||||||||||||||||||||
| 1495 | auto *l = leave; | - | ||||||||||||||||||||||||
| 1496 | while (!l->isWindow()
| 0 | ||||||||||||||||||||||||
| 1497 | leaveDepth++; never executed: leaveDepth++; | 0 | ||||||||||||||||||||||||
| 1498 | QWidget* wenter = enter; | - | ||||||||||||||||||||||||
| 1499 | QWidget* wleave = leave; | - | ||||||||||||||||||||||||
| 1500 | while (enterDepth > leaveDepth
| 0 | ||||||||||||||||||||||||
| 1501 | wenter = wenter->parentWidget(); | - | ||||||||||||||||||||||||
| 1502 | enterDepth--; | - | ||||||||||||||||||||||||
| 1503 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1504 | while (leaveDepth > enterDepth
| 0 | ||||||||||||||||||||||||
| 1505 | wleave = wleave->parentWidget(); | - | ||||||||||||||||||||||||
| 1506 | leaveDepth--; | - | ||||||||||||||||||||||||
| 1507 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1508 | while (!wenter->isWindow()
| 0 | ||||||||||||||||||||||||
| 1509 | wenter = wenter->parentWidget(); | - | ||||||||||||||||||||||||
| 1510 | wleave = wleave->parentWidget(); | - | ||||||||||||||||||||||||
| 1511 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1512 | - | |||||||||||||||||||||||||
| 1513 | for (auto *w = leave; w != wleave
| 0 | ||||||||||||||||||||||||
| 1514 | leaveList.append(w); never executed: leaveList.append(w); | 0 | ||||||||||||||||||||||||
| 1515 | - | |||||||||||||||||||||||||
| 1516 | for (auto *w = enter; w != wenter
| 0 | ||||||||||||||||||||||||
| 1517 | enterList.append(w); never executed: enterList.append(w); | 0 | ||||||||||||||||||||||||
| 1518 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1519 | - | |||||||||||||||||||||||||
| 1520 | QEvent leaveEvent(QEvent::Leave); | - | ||||||||||||||||||||||||
| 1521 | for (int i = 0; i < leaveList.size()
| 0 | ||||||||||||||||||||||||
| 1522 | auto *w = leaveList.at(i); | - | ||||||||||||||||||||||||
| 1523 | if (!QApplication::activeModalWidget()
| 0 | ||||||||||||||||||||||||
| 1524 | QApplication::sendEvent(w, &leaveEvent); | - | ||||||||||||||||||||||||
| 1525 | if (w->testAttribute(Qt::WA_Hover)
| 0 | ||||||||||||||||||||||||
| 1526 | (!QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||
| 1527 | ((!(instance())) ? qt_assert("instance()",__FILE__,2391) : qt_noop()); | - | ||||||||||||||||||||||||
| 1528 | QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos), | - | ||||||||||||||||||||||||
| 1529 | QApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||
| 1530 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->notify_helper(w, &he); | - | ||||||||||||||||||||||||
| 1531 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1532 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1533 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1534 | if (!enterList.isEmpty()
| 0 | ||||||||||||||||||||||||
| 1535 | - | |||||||||||||||||||||||||
| 1536 | const QPoint globalPos = qIsInf(globalPosF.x())
| 0 | ||||||||||||||||||||||||
| 1537 | ? QPoint(((1<<24)-1), ((1<<24)-1)) | - | ||||||||||||||||||||||||
| 1538 | : globalPosF.toPoint(); | - | ||||||||||||||||||||||||
| 1539 | const QPoint windowPos = qAsConst(enterList).back()->window()->mapFromGlobal(globalPos); | - | ||||||||||||||||||||||||
| 1540 | for (auto it = enterList.crbegin(), end = enterList.crend(); it != end
| 0 | ||||||||||||||||||||||||
| 1541 | auto *w = *it; | - | ||||||||||||||||||||||||
| 1542 | if (!QApplication::activeModalWidget()
| 0 | ||||||||||||||||||||||||
| 1543 | const QPointF localPos = w->mapFromGlobal(globalPos); | - | ||||||||||||||||||||||||
| 1544 | QEnterEvent enterEvent(localPos, windowPos, globalPosF); | - | ||||||||||||||||||||||||
| 1545 | QApplication::sendEvent(w, &enterEvent); | - | ||||||||||||||||||||||||
| 1546 | if (w->testAttribute(Qt::WA_Hover)
| 0 | ||||||||||||||||||||||||
| 1547 | (!QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||
| 1548 | QHoverEvent he(QEvent::HoverEnter, localPos, QPoint(-1, -1), | - | ||||||||||||||||||||||||
| 1549 | QApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||
| 1550 | (static_cast<QApplication *>(QCoreApplication::instance()))->d_func()->notify_helper(w, &he); | - | ||||||||||||||||||||||||
| 1551 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1552 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1553 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1554 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1555 | - | |||||||||||||||||||||||||
| 1556 | - | |||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||
| 1558 | - | |||||||||||||||||||||||||
| 1559 | const bool enterOnAlien = (enter
| 0 | ||||||||||||||||||||||||
| 1560 | - | |||||||||||||||||||||||||
| 1561 | - | |||||||||||||||||||||||||
| 1562 | QWidget *parentOfLeavingCursor = 0; | - | ||||||||||||||||||||||||
| 1563 | for (int i = 0; i < leaveList.size()
| 0 | ||||||||||||||||||||||||
| 1564 | auto *w = leaveList.at(i); | - | ||||||||||||||||||||||||
| 1565 | if (!isAlien(w)
| 0 | ||||||||||||||||||||||||
| 1566 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1567 | if (w->testAttribute(Qt::WA_SetCursor)
| 0 | ||||||||||||||||||||||||
| 1568 | QWidget *parent = w->parentWidget(); | - | ||||||||||||||||||||||||
| 1569 | while (parent
| 0 | ||||||||||||||||||||||||
| 1570 | parent = parent->parentWidget(); never executed: parent = parent->parentWidget(); | 0 | ||||||||||||||||||||||||
| 1571 | parentOfLeavingCursor = parent; | - | ||||||||||||||||||||||||
| 1572 | - | |||||||||||||||||||||||||
| 1573 | - | |||||||||||||||||||||||||
| 1574 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1575 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1576 | - | |||||||||||||||||||||||||
| 1577 | if (parentOfLeavingCursor
| 0 | ||||||||||||||||||||||||
| 1578 | || parentOfLeavingCursor->effectiveWinId() != enter->effectiveWinId()
| 0 | ||||||||||||||||||||||||
| 1579 | - | |||||||||||||||||||||||||
| 1580 | if (!parentOfLeavingCursor->window()->graphicsProxyWidget()
| 0 | ||||||||||||||||||||||||
| 1581 | - | |||||||||||||||||||||||||
| 1582 | { | - | ||||||||||||||||||||||||
| 1583 | if (enter == QApplication::desktop()
| 0 | ||||||||||||||||||||||||
| 1584 | qt_qpa_set_cursor(enter, true); | - | ||||||||||||||||||||||||
| 1585 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1586 | qt_qpa_set_cursor(parentOfLeavingCursor, true); | - | ||||||||||||||||||||||||
| 1587 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1588 | } | - | ||||||||||||||||||||||||
| 1589 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1590 | if (enterOnAlien
| 0 | ||||||||||||||||||||||||
| 1591 | QWidget *cursorWidget = enter; | - | ||||||||||||||||||||||||
| 1592 | while (!cursorWidget->isWindow()
| 0 | ||||||||||||||||||||||||
| 1593 | cursorWidget = cursorWidget->parentWidget(); never executed: cursorWidget = cursorWidget->parentWidget(); | 0 | ||||||||||||||||||||||||
| 1594 | - | |||||||||||||||||||||||||
| 1595 | if (!cursorWidget
| 0 | ||||||||||||||||||||||||
| 1596 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1597 | - | |||||||||||||||||||||||||
| 1598 | - | |||||||||||||||||||||||||
| 1599 | if (cursorWidget->window()->graphicsProxyWidget()
| 0 | ||||||||||||||||||||||||
| 1600 | QWidgetPrivate::nearestGraphicsProxyWidget(cursorWidget)->setCursor(cursorWidget->cursor()); | - | ||||||||||||||||||||||||
| 1601 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 1602 | - | |||||||||||||||||||||||||
| 1603 | { | - | ||||||||||||||||||||||||
| 1604 | qt_qpa_set_cursor(cursorWidget, true); | - | ||||||||||||||||||||||||
| 1605 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1606 | } | - | ||||||||||||||||||||||||
| 1607 | - | |||||||||||||||||||||||||
| 1608 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1609 | - | |||||||||||||||||||||||||
| 1610 | - | |||||||||||||||||||||||||
| 1611 | __attribute__((visibility("default"))) bool qt_tryModalHelper(QWidget *widget, QWidget **rettop) | - | ||||||||||||||||||||||||
| 1612 | { | - | ||||||||||||||||||||||||
| 1613 | return never executed: QApplicationPrivate::tryModalHelper(widget, rettop);return QApplicationPrivate::tryModalHelper(widget, rettop);never executed: return QApplicationPrivate::tryModalHelper(widget, rettop); | 0 | ||||||||||||||||||||||||
| 1614 | } | - | ||||||||||||||||||||||||
| 1615 | - | |||||||||||||||||||||||||
| 1616 | - | |||||||||||||||||||||||||
| 1617 | - | |||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||
| 1619 | bool QApplicationPrivate::isBlockedByModal(QWidget *widget) | - | ||||||||||||||||||||||||
| 1620 | { | - | ||||||||||||||||||||||||
| 1621 | widget = widget->window(); | - | ||||||||||||||||||||||||
| 1622 | QWindow *window = widget->windowHandle(); | - | ||||||||||||||||||||||||
| 1623 | return never executed: window && self->isWindowBlocked(window);return window && self->isWindowBlocked(window);never executed: return window && self->isWindowBlocked(window); | 0 | ||||||||||||||||||||||||
| 1624 | } | - | ||||||||||||||||||||||||
| 1625 | - | |||||||||||||||||||||||||
| 1626 | bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const | - | ||||||||||||||||||||||||
| 1627 | { | - | ||||||||||||||||||||||||
| 1628 | QWindow *unused = 0; | - | ||||||||||||||||||||||||
| 1629 | if (__builtin_expect(!!(!window), false)
| 0 | ||||||||||||||||||||||||
| 1630 | QMessageLogger(__FILE__, 2494, __PRETTY_FUNCTION__).warning().nospace() << "window == 0 passed."; | - | ||||||||||||||||||||||||
| 1631 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1632 | } | - | ||||||||||||||||||||||||
| 1633 | if (!blockingWindow
| 0 | ||||||||||||||||||||||||
| 1634 | blockingWindow = &unused; never executed: blockingWindow = &unused; | 0 | ||||||||||||||||||||||||
| 1635 | - | |||||||||||||||||||||||||
| 1636 | if (modalWindowList.isEmpty()
| 0 | ||||||||||||||||||||||||
| 1637 | *blockingWindow = 0; | - | ||||||||||||||||||||||||
| 1638 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1639 | } | - | ||||||||||||||||||||||||
| 1640 | QWidget *popupWidget = QApplication::activePopupWidget(); | - | ||||||||||||||||||||||||
| 1641 | QWindow *popupWindow = popupWidget
| 0 | ||||||||||||||||||||||||
| 1642 | if (popupWindow == window
| 0 | ||||||||||||||||||||||||
| 1643 | *blockingWindow = 0; | - | ||||||||||||||||||||||||
| 1644 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1645 | } | - | ||||||||||||||||||||||||
| 1646 | - | |||||||||||||||||||||||||
| 1647 | for (int i = 0; i < modalWindowList.count()
| 0 | ||||||||||||||||||||||||
| 1648 | QWindow *modalWindow = modalWindowList.at(i); | - | ||||||||||||||||||||||||
| 1649 | - | |||||||||||||||||||||||||
| 1650 | { | - | ||||||||||||||||||||||||
| 1651 | - | |||||||||||||||||||||||||
| 1652 | QWindow *w = window; | - | ||||||||||||||||||||||||
| 1653 | while (w
| 0 | ||||||||||||||||||||||||
| 1654 | if (w == modalWindow
| 0 | ||||||||||||||||||||||||
| 1655 | *blockingWindow = 0; | - | ||||||||||||||||||||||||
| 1656 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1657 | } | - | ||||||||||||||||||||||||
| 1658 | QWindow *p = w->parent(); | - | ||||||||||||||||||||||||
| 1659 | if (!p
| 0 | ||||||||||||||||||||||||
| 1660 | p = w->transientParent(); never executed: p = w->transientParent(); | 0 | ||||||||||||||||||||||||
| 1661 | w = p; | - | ||||||||||||||||||||||||
| 1662 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1663 | - | |||||||||||||||||||||||||
| 1664 | - | |||||||||||||||||||||||||
| 1665 | - | |||||||||||||||||||||||||
| 1666 | const QPlatformWindow *platWin = window->handle(); | - | ||||||||||||||||||||||||
| 1667 | const QPlatformWindow *modalPlatWin = modalWindow->handle(); | - | ||||||||||||||||||||||||
| 1668 | if (platWin
| 0 | ||||||||||||||||||||||||
| 1669 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1670 | } | - | ||||||||||||||||||||||||
| 1671 | - | |||||||||||||||||||||||||
| 1672 | Qt::WindowModality windowModality = modalWindow->modality(); | - | ||||||||||||||||||||||||
| 1673 | QWidgetWindow *modalWidgetWindow = qobject_cast<QWidgetWindow *>(modalWindow); | - | ||||||||||||||||||||||||
| 1674 | if (windowModality == Qt::NonModal
| 0 | ||||||||||||||||||||||||
| 1675 | - | |||||||||||||||||||||||||
| 1676 | - | |||||||||||||||||||||||||
| 1677 | - | |||||||||||||||||||||||||
| 1678 | - | |||||||||||||||||||||||||
| 1679 | QWidget *m = modalWidgetWindow
| 0 | ||||||||||||||||||||||||
| 1680 | while (m
| 0 | ||||||||||||||||||||||||
| 1681 | m = m->parentWidget(); | - | ||||||||||||||||||||||||
| 1682 | if (m
| 0 | ||||||||||||||||||||||||
| 1683 | m = m->window(); never executed: m = m->window(); | 0 | ||||||||||||||||||||||||
| 1684 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1685 | windowModality = (m
| 0 | ||||||||||||||||||||||||
| 1686 | ? Qt::WindowModal | - | ||||||||||||||||||||||||
| 1687 | : Qt::ApplicationModal; | - | ||||||||||||||||||||||||
| 1688 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1689 | - | |||||||||||||||||||||||||
| 1690 | switch (windowModality) { | - | ||||||||||||||||||||||||
| 1691 | case never executed: Qt::ApplicationModal:case Qt::ApplicationModal:never executed: case Qt::ApplicationModal: | 0 | ||||||||||||||||||||||||
| 1692 | { | - | ||||||||||||||||||||||||
| 1693 | QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(window); | - | ||||||||||||||||||||||||
| 1694 | QWidget *groupLeaderForWidget = widgetWindow
| 0 | ||||||||||||||||||||||||
| 1695 | while (groupLeaderForWidget
| 0 | ||||||||||||||||||||||||
| 1696 | groupLeaderForWidget = groupLeaderForWidget->parentWidget(); never executed: groupLeaderForWidget = groupLeaderForWidget->parentWidget(); | 0 | ||||||||||||||||||||||||
| 1697 | - | |||||||||||||||||||||||||
| 1698 | if (groupLeaderForWidget
| 0 | ||||||||||||||||||||||||
| 1699 | - | |||||||||||||||||||||||||
| 1700 | QWidget *m = modalWidgetWindow
| 0 | ||||||||||||||||||||||||
| 1701 | while (m
| 0 | ||||||||||||||||||||||||
| 1702 | m = m->parentWidget(); never executed: m = m->parentWidget(); | 0 | ||||||||||||||||||||||||
| 1703 | if (m == groupLeaderForWidget
| 0 | ||||||||||||||||||||||||
| 1704 | *blockingWindow = m->windowHandle(); | - | ||||||||||||||||||||||||
| 1705 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1706 | } | - | ||||||||||||||||||||||||
| 1707 | } never executed: else if (modalWindow != windowend of block
| 0 | ||||||||||||||||||||||||
| 1708 | *blockingWindow = modalWindow; | - | ||||||||||||||||||||||||
| 1709 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1710 | } | - | ||||||||||||||||||||||||
| 1711 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1712 | } | - | ||||||||||||||||||||||||
| 1713 | case never executed: Qt::WindowModal:case Qt::WindowModal:never executed: case Qt::WindowModal: | 0 | ||||||||||||||||||||||||
| 1714 | { | - | ||||||||||||||||||||||||
| 1715 | QWindow *w = window; | - | ||||||||||||||||||||||||
| 1716 | do { | - | ||||||||||||||||||||||||
| 1717 | QWindow *m = modalWindow; | - | ||||||||||||||||||||||||
| 1718 | do { | - | ||||||||||||||||||||||||
| 1719 | if (m == w
| 0 | ||||||||||||||||||||||||
| 1720 | *blockingWindow = m; | - | ||||||||||||||||||||||||
| 1721 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1722 | } | - | ||||||||||||||||||||||||
| 1723 | QWindow *p = m->parent(); | - | ||||||||||||||||||||||||
| 1724 | if (!p
| 0 | ||||||||||||||||||||||||
| 1725 | p = m->transientParent(); never executed: p = m->transientParent(); | 0 | ||||||||||||||||||||||||
| 1726 | m = p; | - | ||||||||||||||||||||||||
| 1727 | } never executed: while (mend of block
| 0 | ||||||||||||||||||||||||
| 1728 | QWindow *p = w->parent(); | - | ||||||||||||||||||||||||
| 1729 | if (!p
| 0 | ||||||||||||||||||||||||
| 1730 | p = w->transientParent(); never executed: p = w->transientParent(); | 0 | ||||||||||||||||||||||||
| 1731 | w = p; | - | ||||||||||||||||||||||||
| 1732 | } never executed: while (wend of block
| 0 | ||||||||||||||||||||||||
| 1733 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1734 | } | - | ||||||||||||||||||||||||
| 1735 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1736 | ((!(false)) ? qt_assert_x("QApplication", "internal error, a modal window cannot be modeless",__FILE__,2600) : qt_noop()); | - | ||||||||||||||||||||||||
| 1737 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1738 | } | - | ||||||||||||||||||||||||
| 1739 | } | - | ||||||||||||||||||||||||
| 1740 | *blockingWindow = 0; | - | ||||||||||||||||||||||||
| 1741 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1742 | } | - | ||||||||||||||||||||||||
| 1743 | - | |||||||||||||||||||||||||
| 1744 | - | |||||||||||||||||||||||||
| 1745 | - | |||||||||||||||||||||||||
| 1746 | - | |||||||||||||||||||||||||
| 1747 | - | |||||||||||||||||||||||||
| 1748 | - | |||||||||||||||||||||||||
| 1749 | bool QApplicationPrivate::tryModalHelper(QWidget *widget, QWidget **rettop) | - | ||||||||||||||||||||||||
| 1750 | { | - | ||||||||||||||||||||||||
| 1751 | QWidget *top = QApplication::activeModalWidget(); | - | ||||||||||||||||||||||||
| 1752 | if (rettop
| 0 | ||||||||||||||||||||||||
| 1753 | * never executed: rettop = top;*rettop = top;never executed: *rettop = top; | 0 | ||||||||||||||||||||||||
| 1754 | - | |||||||||||||||||||||||||
| 1755 | - | |||||||||||||||||||||||||
| 1756 | if (QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||
| 1757 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1758 | - | |||||||||||||||||||||||||
| 1759 | return never executed: !isBlockedByModal(widget->window());return !isBlockedByModal(widget->window());never executed: return !isBlockedByModal(widget->window()); | 0 | ||||||||||||||||||||||||
| 1760 | } | - | ||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||
| 1762 | bool qt_try_modal(QWidget *widget, QEvent::Type type) | - | ||||||||||||||||||||||||
| 1763 | { | - | ||||||||||||||||||||||||
| 1764 | QWidget * top = 0; | - | ||||||||||||||||||||||||
| 1765 | - | |||||||||||||||||||||||||
| 1766 | if (QApplicationPrivate::tryModalHelper(widget, &top)
| 0 | ||||||||||||||||||||||||
| 1767 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1768 | - | |||||||||||||||||||||||||
| 1769 | bool block_event = false; | - | ||||||||||||||||||||||||
| 1770 | - | |||||||||||||||||||||||||
| 1771 | switch (type) { | - | ||||||||||||||||||||||||
| 1772 | - | |||||||||||||||||||||||||
| 1773 | - | |||||||||||||||||||||||||
| 1774 | - | |||||||||||||||||||||||||
| 1775 | - | |||||||||||||||||||||||||
| 1776 | - | |||||||||||||||||||||||||
| 1777 | - | |||||||||||||||||||||||||
| 1778 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
| 1779 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
| 1780 | case never executed: QEvent::MouseMove:case QEvent::MouseMove:never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
| 1781 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
| 1782 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
| 1783 | block_event = true; | - | ||||||||||||||||||||||||
| 1784 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1785 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 1786 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 1787 | } | - | ||||||||||||||||||||||||
| 1788 | - | |||||||||||||||||||||||||
| 1789 | if (block_event
| 0 | ||||||||||||||||||||||||
| 1790 | top->raise(); never executed: top->raise(); | 0 | ||||||||||||||||||||||||
| 1791 | - | |||||||||||||||||||||||||
| 1792 | return never executed: !block_event;return !block_event;never executed: return !block_event; | 0 | ||||||||||||||||||||||||
| 1793 | } | - | ||||||||||||||||||||||||
| 1794 | - | |||||||||||||||||||||||||
| 1795 | bool QApplicationPrivate::modalState() | - | ||||||||||||||||||||||||
| 1796 | { | - | ||||||||||||||||||||||||
| 1797 | return never executed: !self->modalWindowList.isEmpty();return !self->modalWindowList.isEmpty();never executed: return !self->modalWindowList.isEmpty(); | 0 | ||||||||||||||||||||||||
| 1798 | } | - | ||||||||||||||||||||||||
| 1799 | - | |||||||||||||||||||||||||
| 1800 | - | |||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||
| 1802 | - | |||||||||||||||||||||||||
| 1803 | QWidget *QApplicationPrivate::pickMouseReceiver(QWidget *candidate, const QPoint &windowPos, | - | ||||||||||||||||||||||||
| 1804 | QPoint *pos, QEvent::Type type, | - | ||||||||||||||||||||||||
| 1805 | Qt::MouseButtons buttons, QWidget *buttonDown, | - | ||||||||||||||||||||||||
| 1806 | QWidget *alienWidget) | - | ||||||||||||||||||||||||
| 1807 | { | - | ||||||||||||||||||||||||
| 1808 | ((!(candidate)) ? qt_assert("candidate",__FILE__,2672) : qt_noop()); | - | ||||||||||||||||||||||||
| 1809 | - | |||||||||||||||||||||||||
| 1810 | QWidget *mouseGrabber = QWidget::mouseGrabber(); | - | ||||||||||||||||||||||||
| 1811 | if (((type == QEvent::MouseMove
| 0 | ||||||||||||||||||||||||
| 1812 | && !buttonDown
| 0 | ||||||||||||||||||||||||
| 1813 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 1814 | } | - | ||||||||||||||||||||||||
| 1815 | - | |||||||||||||||||||||||||
| 1816 | if (alienWidget
| 0 | ||||||||||||||||||||||||
| 1817 | alienWidget = 0; never executed: alienWidget = 0; | 0 | ||||||||||||||||||||||||
| 1818 | - | |||||||||||||||||||||||||
| 1819 | QWidget *receiver = candidate; | - | ||||||||||||||||||||||||
| 1820 | - | |||||||||||||||||||||||||
| 1821 | if (!mouseGrabber
| 0 | ||||||||||||||||||||||||
| 1822 | mouseGrabber = (buttonDown
never executed: mouseGrabber = (buttonDown && !isBlockedByModal(buttonDown)) ? buttonDown : alienWidget; | 0 | ||||||||||||||||||||||||
| 1823 | - | |||||||||||||||||||||||||
| 1824 | if (mouseGrabber
| 0 | ||||||||||||||||||||||||
| 1825 | receiver = mouseGrabber; | - | ||||||||||||||||||||||||
| 1826 | *pos = receiver->mapFromGlobal(candidate->mapToGlobal(windowPos)); | - | ||||||||||||||||||||||||
| 1827 | - | |||||||||||||||||||||||||
| 1828 | - | |||||||||||||||||||||||||
| 1829 | - | |||||||||||||||||||||||||
| 1830 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1831 | - | |||||||||||||||||||||||||
| 1832 | return never executed: receiver;return receiver;never executed: return receiver; | 0 | ||||||||||||||||||||||||
| 1833 | - | |||||||||||||||||||||||||
| 1834 | } | - | ||||||||||||||||||||||||
| 1835 | - | |||||||||||||||||||||||||
| 1836 | - | |||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||
| 1838 | - | |||||||||||||||||||||||||
| 1839 | bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event, | - | ||||||||||||||||||||||||
| 1840 | QWidget *alienWidget, QWidget *nativeWidget, | - | ||||||||||||||||||||||||
| 1841 | QWidget **buttonDown, QPointer<QWidget> &lastMouseReceiver, | - | ||||||||||||||||||||||||
| 1842 | bool spontaneous) | - | ||||||||||||||||||||||||
| 1843 | { | - | ||||||||||||||||||||||||
| 1844 | ((!(receiver)) ? qt_assert("receiver",__FILE__,2708) : qt_noop()); | - | ||||||||||||||||||||||||
| 1845 | ((!(event)) ? qt_assert("event",__FILE__,2709) : qt_noop()); | - | ||||||||||||||||||||||||
| 1846 | ((!(nativeWidget)) ? qt_assert("nativeWidget",__FILE__,2710) : qt_noop()); | - | ||||||||||||||||||||||||
| 1847 | ((!(buttonDown)) ? qt_assert("buttonDown",__FILE__,2711) : qt_noop()); | - | ||||||||||||||||||||||||
| 1848 | - | |||||||||||||||||||||||||
| 1849 | if (alienWidget
| 0 | ||||||||||||||||||||||||
| 1850 | alienWidget = 0; never executed: alienWidget = 0; | 0 | ||||||||||||||||||||||||
| 1851 | - | |||||||||||||||||||||||||
| 1852 | QPointer<QWidget> receiverGuard = receiver; | - | ||||||||||||||||||||||||
| 1853 | QPointer<QWidget> nativeGuard = nativeWidget; | - | ||||||||||||||||||||||||
| 1854 | QPointer<QWidget> alienGuard = alienWidget; | - | ||||||||||||||||||||||||
| 1855 | QPointer<QWidget> activePopupWidget = QApplication::activePopupWidget(); | - | ||||||||||||||||||||||||
| 1856 | - | |||||||||||||||||||||||||
| 1857 | const bool graphicsWidget = nativeWidget->testAttribute(Qt::WA_DontShowOnScreen); | - | ||||||||||||||||||||||||
| 1858 | - | |||||||||||||||||||||||||
| 1859 | bool widgetUnderMouse = QRectF(receiver->rect()).contains(event->localPos()); | - | ||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||
| 1863 | - | |||||||||||||||||||||||||
| 1864 | if (leaveAfterRelease
| 0 | ||||||||||||||||||||||||
| 1865 | leaveAfterRelease = 0; never executed: leaveAfterRelease = 0; | 0 | ||||||||||||||||||||||||
| 1866 | - | |||||||||||||||||||||||||
| 1867 | if (*
| 0 | ||||||||||||||||||||||||
| 1868 | if (!graphicsWidget
| 0 | ||||||||||||||||||||||||
| 1869 | - | |||||||||||||||||||||||||
| 1870 | - | |||||||||||||||||||||||||
| 1871 | if ((alienWidget
| 0 | ||||||||||||||||||||||||
| 1872 | leaveAfterRelease = *buttonDown; never executed: leaveAfterRelease = *buttonDown; | 0 | ||||||||||||||||||||||||
| 1873 | if (event->type() == QEvent::MouseButtonRelease
| 0 | ||||||||||||||||||||||||
| 1874 | * never executed: buttonDown = 0;*buttonDown = 0;never executed: *buttonDown = 0; | 0 | ||||||||||||||||||||||||
| 1875 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1876 | } never executed: else if (lastMouseReceiverend of block
| 0 | ||||||||||||||||||||||||
| 1877 | - | |||||||||||||||||||||||||
| 1878 | - | |||||||||||||||||||||||||
| 1879 | - | |||||||||||||||||||||||||
| 1880 | - | |||||||||||||||||||||||||
| 1881 | if ((alienWidget
| 0 | ||||||||||||||||||||||||
| 1882 | || (isAlien(lastMouseReceiver)
| 0 | ||||||||||||||||||||||||
| 1883 | if (activePopupWidget
| 0 | ||||||||||||||||||||||||
| 1884 | if (!QWidget::mouseGrabber()
| 0 | ||||||||||||||||||||||||
| 1885 | dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver, event->screenPos()); never executed: dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver, event->screenPos()); | 0 | ||||||||||||||||||||||||
| 1886 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1887 | dispatchEnterLeave(receiver, lastMouseReceiver, event->screenPos()); | - | ||||||||||||||||||||||||
| 1888 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1889 | - | |||||||||||||||||||||||||
| 1890 | } | - | ||||||||||||||||||||||||
| 1891 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1892 | const bool wasLeaveAfterRelease = leaveAfterRelease != 0; | - | ||||||||||||||||||||||||
| 1893 | bool result; | - | ||||||||||||||||||||||||
| 1894 | if (spontaneous
| 0 | ||||||||||||||||||||||||
| 1895 | result = QApplication::sendSpontaneousEvent(receiver, event); never executed: result = QApplication::sendSpontaneousEvent(receiver, event); | 0 | ||||||||||||||||||||||||
| 1896 | else | - | ||||||||||||||||||||||||
| 1897 | result = QApplication::sendEvent(receiver, event); never executed: result = QApplication::sendEvent(receiver, event); | 0 | ||||||||||||||||||||||||
| 1898 | - | |||||||||||||||||||||||||
| 1899 | if (!graphicsWidget
| 0 | ||||||||||||||||||||||||
| 1900 | && !event->buttons()
| 0 | ||||||||||||||||||||||||
| 1901 | - | |||||||||||||||||||||||||
| 1902 | - | |||||||||||||||||||||||||
| 1903 | - | |||||||||||||||||||||||||
| 1904 | QWidget *enter = 0; | - | ||||||||||||||||||||||||
| 1905 | if (nativeGuard
| 0 | ||||||||||||||||||||||||
| 1906 | enter = alienGuard
never executed: enter = alienGuard ? alienWidget : nativeWidget; | 0 | ||||||||||||||||||||||||
| 1907 | else | - | ||||||||||||||||||||||||
| 1908 | enter = QApplication::widgetAt(event->globalPos()); never executed: enter = QApplication::widgetAt(event->globalPos()); | 0 | ||||||||||||||||||||||||
| 1909 | dispatchEnterLeave(enter, leaveAfterRelease, event->screenPos()); | - | ||||||||||||||||||||||||
| 1910 | leaveAfterRelease = 0; | - | ||||||||||||||||||||||||
| 1911 | lastMouseReceiver = enter; | - | ||||||||||||||||||||||||
| 1912 | } never executed: else if (!wasLeaveAfterReleaseend of block
| 0 | ||||||||||||||||||||||||
| 1913 | if (activePopupWidget
| 0 | ||||||||||||||||||||||||
| 1914 | if (!QWidget::mouseGrabber()
| 0 | ||||||||||||||||||||||||
| 1915 | lastMouseReceiver = alienGuard
never executed: lastMouseReceiver = alienGuard ? alienWidget : (nativeGuard ? nativeWidget : 0); | 0 | ||||||||||||||||||||||||
| 1916 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1917 | lastMouseReceiver = receiverGuard
| 0 | ||||||||||||||||||||||||
| 1918 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1919 | } | - | ||||||||||||||||||||||||
| 1920 | - | |||||||||||||||||||||||||
| 1921 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||
| 1922 | } | - | ||||||||||||||||||||||||
| 1923 | - | |||||||||||||||||||||||||
| 1924 | - | |||||||||||||||||||||||||
| 1925 | - | |||||||||||||||||||||||||
| 1926 | - | |||||||||||||||||||||||||
| 1927 | - | |||||||||||||||||||||||||
| 1928 | - | |||||||||||||||||||||||||
| 1929 | - | |||||||||||||||||||||||||
| 1930 | extern QPointer<QWidget> qt_last_mouse_receiver; | - | ||||||||||||||||||||||||
| 1931 | extern QWidget *qt_button_down; | - | ||||||||||||||||||||||||
| 1932 | void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) | - | ||||||||||||||||||||||||
| 1933 | { | - | ||||||||||||||||||||||||
| 1934 | - | |||||||||||||||||||||||||
| 1935 | if (!widget
| 0 | ||||||||||||||||||||||||
| 1936 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1937 | const bool widgetInShow = widget->isVisible()
| 0 | ||||||||||||||||||||||||
| 1938 | if (!widgetInShow
| 0 | ||||||||||||||||||||||||
| 1939 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1940 | - | |||||||||||||||||||||||||
| 1941 | if (widgetInShow
| 0 | ||||||||||||||||||||||||
| 1942 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1943 | - | |||||||||||||||||||||||||
| 1944 | QWidget *mouseGrabber = QWidget::mouseGrabber(); | - | ||||||||||||||||||||||||
| 1945 | if (mouseGrabber
| 0 | ||||||||||||||||||||||||
| 1946 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1947 | - | |||||||||||||||||||||||||
| 1948 | QWidget *tlw = widget->window(); | - | ||||||||||||||||||||||||
| 1949 | if (tlw->data->in_destructor
| 0 | ||||||||||||||||||||||||
| 1950 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1951 | - | |||||||||||||||||||||||||
| 1952 | if (widgetInShow
| 0 | ||||||||||||||||||||||||
| 1953 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1954 | - | |||||||||||||||||||||||||
| 1955 | const QPoint globalPos(QCursor::pos()); | - | ||||||||||||||||||||||||
| 1956 | QPoint windowPos = tlw->mapFromGlobal(globalPos); | - | ||||||||||||||||||||||||
| 1957 | - | |||||||||||||||||||||||||
| 1958 | - | |||||||||||||||||||||||||
| 1959 | - | |||||||||||||||||||||||||
| 1960 | - | |||||||||||||||||||||||||
| 1961 | QWidget *widgetUnderCursor = tlw->d_func()->childAt_helper(windowPos, widget->data->in_destructor); | - | ||||||||||||||||||||||||
| 1962 | if (!widgetUnderCursor
| 0 | ||||||||||||||||||||||||
| 1963 | widgetUnderCursor = tlw; never executed: widgetUnderCursor = tlw; | 0 | ||||||||||||||||||||||||
| 1964 | QPoint pos = widgetUnderCursor->mapFrom(tlw, windowPos); | - | ||||||||||||||||||||||||
| 1965 | - | |||||||||||||||||||||||||
| 1966 | if (widgetInShow
| 0 | ||||||||||||||||||||||||
| 1967 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1968 | - | |||||||||||||||||||||||||
| 1969 | if (widget->data->in_destructor
| 0 | ||||||||||||||||||||||||
| 1970 | qt_button_down = 0; never executed: qt_button_down = 0; | 0 | ||||||||||||||||||||||||
| 1971 | - | |||||||||||||||||||||||||
| 1972 | - | |||||||||||||||||||||||||
| 1973 | QMouseEvent e(QEvent::MouseMove, pos, windowPos, globalPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier); | - | ||||||||||||||||||||||||
| 1974 | sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver); | - | ||||||||||||||||||||||||
| 1975 | - | |||||||||||||||||||||||||
| 1976 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1977 | QDesktopWidget *QApplication::desktop() | - | ||||||||||||||||||||||||
| 1978 | { | - | ||||||||||||||||||||||||
| 1979 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 2865, __PRETTY_FUNCTION__).warning("Must construct a QApplication first."); returnend of blocknever executed: nullptr;return nullptr;never executed: }return nullptr; | 0 | ||||||||||||||||||||||||
| 1980 | if (!qt_desktopWidget
| 0 | ||||||||||||||||||||||||
| 1981 | !(qt_desktopWidget->windowType() == Qt::Desktop)
| 0 | ||||||||||||||||||||||||
| 1982 | qt_desktopWidget = new QDesktopWidget(); | - | ||||||||||||||||||||||||
| 1983 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1984 | return never executed: qt_desktopWidget;return qt_desktopWidget;never executed: return qt_desktopWidget; | 0 | ||||||||||||||||||||||||
| 1985 | } | - | ||||||||||||||||||||||||
| 1986 | - | |||||||||||||||||||||||||
| 1987 | - | |||||||||||||||||||||||||
| 1988 | - | |||||||||||||||||||||||||
| 1989 | - | |||||||||||||||||||||||||
| 1990 | - | |||||||||||||||||||||||||
| 1991 | - | |||||||||||||||||||||||||
| 1992 | - | |||||||||||||||||||||||||
| 1993 | void QApplication::setStartDragTime(int ms) | - | ||||||||||||||||||||||||
| 1994 | { | - | ||||||||||||||||||||||||
| 1995 | QGuiApplication::styleHints()->setStartDragTime(ms); | - | ||||||||||||||||||||||||
| 1996 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1997 | int QApplication::startDragTime() | - | ||||||||||||||||||||||||
| 1998 | { | - | ||||||||||||||||||||||||
| 1999 | return never executed: QGuiApplication::styleHints()->startDragTime();return QGuiApplication::styleHints()->startDragTime();never executed: return QGuiApplication::styleHints()->startDragTime(); | 0 | ||||||||||||||||||||||||
| 2000 | } | - | ||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||
| 2002 | - | |||||||||||||||||||||||||
| 2003 | - | |||||||||||||||||||||||||
| 2004 | - | |||||||||||||||||||||||||
| 2005 | - | |||||||||||||||||||||||||
| 2006 | - | |||||||||||||||||||||||||
| 2007 | - | |||||||||||||||||||||||||
| 2008 | void QApplication::setStartDragDistance(int l) | - | ||||||||||||||||||||||||
| 2009 | { | - | ||||||||||||||||||||||||
| 2010 | QGuiApplication::styleHints()->setStartDragDistance(l); | - | ||||||||||||||||||||||||
| 2011 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2012 | int QApplication::startDragDistance() | - | ||||||||||||||||||||||||
| 2013 | { | - | ||||||||||||||||||||||||
| 2014 | return never executed: QGuiApplication::styleHints()->startDragDistance();return QGuiApplication::styleHints()->startDragDistance();never executed: return QGuiApplication::styleHints()->startDragDistance(); | 0 | ||||||||||||||||||||||||
| 2015 | } | - | ||||||||||||||||||||||||
| 2016 | int QApplication::exec() | - | ||||||||||||||||||||||||
| 2017 | { | - | ||||||||||||||||||||||||
| 2018 | return never executed: QGuiApplication::exec();return QGuiApplication::exec();never executed: return QGuiApplication::exec(); | 0 | ||||||||||||||||||||||||
| 2019 | } | - | ||||||||||||||||||||||||
| 2020 | - | |||||||||||||||||||||||||
| 2021 | bool QApplicationPrivate::shouldQuit() | - | ||||||||||||||||||||||||
| 2022 | { | - | ||||||||||||||||||||||||
| 2023 | - | |||||||||||||||||||||||||
| 2024 | - | |||||||||||||||||||||||||
| 2025 | - | |||||||||||||||||||||||||
| 2026 | QWidgetList list = QApplication::topLevelWidgets(); | - | ||||||||||||||||||||||||
| 2027 | QWindowList processedWindows; | - | ||||||||||||||||||||||||
| 2028 | for (int i = 0; i < list.size()
| 0 | ||||||||||||||||||||||||
| 2029 | QWidget *w = list.at(i); | - | ||||||||||||||||||||||||
| 2030 | if (QWindow *window = w->windowHandle()
| 0 | ||||||||||||||||||||||||
| 2031 | processedWindows.push_back(window); | - | ||||||||||||||||||||||||
| 2032 | if (w->isVisible()
| 0 | ||||||||||||||||||||||||
| 2033 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2034 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2035 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2036 | return never executed: QGuiApplicationPrivate::shouldQuitInternal(processedWindows);return QGuiApplicationPrivate::shouldQuitInternal(processedWindows);never executed: return QGuiApplicationPrivate::shouldQuitInternal(processedWindows); | 0 | ||||||||||||||||||||||||
| 2037 | } | - | ||||||||||||||||||||||||
| 2038 | - | |||||||||||||||||||||||||
| 2039 | static inline void closeAllPopups() | - | ||||||||||||||||||||||||
| 2040 | { | - | ||||||||||||||||||||||||
| 2041 | - | |||||||||||||||||||||||||
| 2042 | - | |||||||||||||||||||||||||
| 2043 | int maxiter = 1024; | - | ||||||||||||||||||||||||
| 2044 | QWidget *popup; | - | ||||||||||||||||||||||||
| 2045 | while ((
| 0 | ||||||||||||||||||||||||
| 2046 | popup->close(); never executed: popup->close(); | 0 | ||||||||||||||||||||||||
| 2047 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2048 | - | |||||||||||||||||||||||||
| 2049 | - | |||||||||||||||||||||||||
| 2050 | - | |||||||||||||||||||||||||
| 2051 | bool QApplication::notify(QObject *receiver, QEvent *e) | - | ||||||||||||||||||||||||
| 2052 | { | - | ||||||||||||||||||||||||
| 2053 | QApplicationPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2054 | - | |||||||||||||||||||||||||
| 2055 | if (QApplicationPrivate::is_app_closing
| 0 | ||||||||||||||||||||||||
| 2056 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2057 | - | |||||||||||||||||||||||||
| 2058 | if (__builtin_expect(!!(!receiver), false)
| 0 | ||||||||||||||||||||||||
| 2059 | QMessageLogger(__FILE__, 3016, __PRETTY_FUNCTION__).warning("QApplication::notify: Unexpected null receiver"); | - | ||||||||||||||||||||||||
| 2060 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2061 | } | - | ||||||||||||||||||||||||
| 2062 | - | |||||||||||||||||||||||||
| 2063 | - | |||||||||||||||||||||||||
| 2064 | d->checkReceiverThread(receiver); | - | ||||||||||||||||||||||||
| 2065 | - | |||||||||||||||||||||||||
| 2066 | - | |||||||||||||||||||||||||
| 2067 | if (receiver->isWindowType()
| 0 | ||||||||||||||||||||||||
| 2068 | QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(receiver), e); never executed: QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(static_cast<QWindow *>(receiver), e); | 0 | ||||||||||||||||||||||||
| 2069 | - | |||||||||||||||||||||||||
| 2070 | if(e->spontaneous()
| 0 | ||||||||||||||||||||||||
| 2071 | - | |||||||||||||||||||||||||
| 2072 | - | |||||||||||||||||||||||||
| 2073 | - | |||||||||||||||||||||||||
| 2074 | - | |||||||||||||||||||||||||
| 2075 | switch (e->type()) { | - | ||||||||||||||||||||||||
| 2076 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
| 2077 | { | - | ||||||||||||||||||||||||
| 2078 | QMouseEvent *me = static_cast<QMouseEvent*>(e); | - | ||||||||||||||||||||||||
| 2079 | QApplicationPrivate::modifier_buttons = me->modifiers(); | - | ||||||||||||||||||||||||
| 2080 | QApplicationPrivate::mouse_buttons |= me->button(); | - | ||||||||||||||||||||||||
| 2081 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2082 | } | - | ||||||||||||||||||||||||
| 2083 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick:never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||
| 2084 | { | - | ||||||||||||||||||||||||
| 2085 | QMouseEvent *me = static_cast<QMouseEvent*>(e); | - | ||||||||||||||||||||||||
| 2086 | QApplicationPrivate::modifier_buttons = me->modifiers(); | - | ||||||||||||||||||||||||
| 2087 | QApplicationPrivate::mouse_buttons |= me->button(); | - | ||||||||||||||||||||||||
| 2088 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2089 | } | - | ||||||||||||||||||||||||
| 2090 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
| 2091 | { | - | ||||||||||||||||||||||||
| 2092 | QMouseEvent *me = static_cast<QMouseEvent*>(e); | - | ||||||||||||||||||||||||
| 2093 | QApplicationPrivate::modifier_buttons = me->modifiers(); | - | ||||||||||||||||||||||||
| 2094 | QApplicationPrivate::mouse_buttons &= ~me->button(); | - | ||||||||||||||||||||||||
| 2095 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2096 | } | - | ||||||||||||||||||||||||
| 2097 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
| 2098 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
| 2099 | case never executed: QEvent::MouseMove:case QEvent::MouseMove:never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
| 2100 | - | |||||||||||||||||||||||||
| 2101 | case never executed: QEvent::Wheel:case QEvent::Wheel:never executed: case QEvent::Wheel: | 0 | ||||||||||||||||||||||||
| 2102 | - | |||||||||||||||||||||||||
| 2103 | case never executed: QEvent::TouchBegin:case QEvent::TouchBegin:never executed: case QEvent::TouchBegin: | 0 | ||||||||||||||||||||||||
| 2104 | case never executed: QEvent::TouchUpdate:case QEvent::TouchUpdate:never executed: case QEvent::TouchUpdate: | 0 | ||||||||||||||||||||||||
| 2105 | case never executed: QEvent::TouchEnd:case QEvent::TouchEnd:never executed: case QEvent::TouchEnd: | 0 | ||||||||||||||||||||||||
| 2106 | - | |||||||||||||||||||||||||
| 2107 | case never executed: QEvent::TabletMove:case QEvent::TabletMove:never executed: case QEvent::TabletMove: | 0 | ||||||||||||||||||||||||
| 2108 | case never executed: QEvent::TabletPress:case QEvent::TabletPress:never executed: case QEvent::TabletPress: | 0 | ||||||||||||||||||||||||
| 2109 | case never executed: QEvent::TabletRelease:case QEvent::TabletRelease:never executed: case QEvent::TabletRelease: | 0 | ||||||||||||||||||||||||
| 2110 | - | |||||||||||||||||||||||||
| 2111 | { | - | ||||||||||||||||||||||||
| 2112 | QInputEvent *ie = static_cast<QInputEvent*>(e); | - | ||||||||||||||||||||||||
| 2113 | QApplicationPrivate::modifier_buttons = ie->modifiers(); | - | ||||||||||||||||||||||||
| 2114 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2115 | } | - | ||||||||||||||||||||||||
| 2116 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 2117 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2118 | } | - | ||||||||||||||||||||||||
| 2119 | } | - | ||||||||||||||||||||||||
| 2120 | - | |||||||||||||||||||||||||
| 2121 | - | |||||||||||||||||||||||||
| 2122 | - | |||||||||||||||||||||||||
| 2123 | if (d->gestureManager
| 0 | ||||||||||||||||||||||||
| 2124 | switch (e->type()) { | - | ||||||||||||||||||||||||
| 2125 | case never executed: QEvent::Paint:case QEvent::Paint:never executed: case QEvent::Paint: | 0 | ||||||||||||||||||||||||
| 2126 | case never executed: QEvent::MetaCall:case QEvent::MetaCall:never executed: case QEvent::MetaCall: | 0 | ||||||||||||||||||||||||
| 2127 | case never executed: QEvent::DeferredDelete:case QEvent::DeferredDelete:never executed: case QEvent::DeferredDelete: | 0 | ||||||||||||||||||||||||
| 2128 | case never executed: QEvent::DragEnter:case QEvent::DragEnter:never executed: casecase QEvent::DragEnter:never executed: QEvent::DragMove:case QEvent::DragMove:never executed: casecase QEvent::DragMove:never executed: QEvent::DragLeave:case QEvent::DragLeave:never executed: case QEvent::DragLeave: | 0 | ||||||||||||||||||||||||
| 2129 | case never executed: QEvent::Drop:case QEvent::Drop:never executed: casecase QEvent::Drop:never executed: QEvent::DragResponse:case QEvent::DragResponse:never executed: case QEvent::DragResponse: | 0 | ||||||||||||||||||||||||
| 2130 | case never executed: QEvent::ChildAdded:case QEvent::ChildAdded:never executed: casecase QEvent::ChildAdded:never executed: QEvent::ChildPolished:case QEvent::ChildPolished:never executed: case QEvent::ChildPolished: | 0 | ||||||||||||||||||||||||
| 2131 | case never executed: QEvent::ChildRemoved:case QEvent::ChildRemoved:never executed: case QEvent::ChildRemoved: | 0 | ||||||||||||||||||||||||
| 2132 | case never executed: QEvent::UpdateRequest:case QEvent::UpdateRequest:never executed: case QEvent::UpdateRequest: | 0 | ||||||||||||||||||||||||
| 2133 | case never executed: QEvent::UpdateLater:case QEvent::UpdateLater:never executed: case QEvent::UpdateLater: | 0 | ||||||||||||||||||||||||
| 2134 | case never executed: QEvent::LocaleChange:case QEvent::LocaleChange:never executed: case QEvent::LocaleChange: | 0 | ||||||||||||||||||||||||
| 2135 | case never executed: QEvent::Style:case QEvent::Style:never executed: case QEvent::Style: | 0 | ||||||||||||||||||||||||
| 2136 | case never executed: QEvent::IconDrag:case QEvent::IconDrag:never executed: case QEvent::IconDrag: | 0 | ||||||||||||||||||||||||
| 2137 | case never executed: QEvent::StyleChange:case QEvent::StyleChange:never executed: case QEvent::StyleChange: | 0 | ||||||||||||||||||||||||
| 2138 | case never executed: QEvent::GraphicsSceneDragEnter:case QEvent::GraphicsSceneDragEnter:never executed: case QEvent::GraphicsSceneDragEnter: | 0 | ||||||||||||||||||||||||
| 2139 | case never executed: QEvent::GraphicsSceneDragMove:case QEvent::GraphicsSceneDragMove:never executed: case QEvent::GraphicsSceneDragMove: | 0 | ||||||||||||||||||||||||
| 2140 | case never executed: QEvent::GraphicsSceneDragLeave:case QEvent::GraphicsSceneDragLeave:never executed: case QEvent::GraphicsSceneDragLeave: | 0 | ||||||||||||||||||||||||
| 2141 | case never executed: QEvent::GraphicsSceneDrop:case QEvent::GraphicsSceneDrop:never executed: case QEvent::GraphicsSceneDrop: | 0 | ||||||||||||||||||||||||
| 2142 | case never executed: QEvent::DynamicPropertyChange:case QEvent::DynamicPropertyChange:never executed: case QEvent::DynamicPropertyChange: | 0 | ||||||||||||||||||||||||
| 2143 | case never executed: QEvent::NetworkReplyUpdated:case QEvent::NetworkReplyUpdated:never executed: case QEvent::NetworkReplyUpdated: | 0 | ||||||||||||||||||||||||
| 2144 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2145 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 2146 | if (d->gestureManager->thread() == QThread::currentThread()
| 0 | ||||||||||||||||||||||||
| 2147 | if (receiver->isWidgetType()
| 0 | ||||||||||||||||||||||||
| 2148 | if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e)
| 0 | ||||||||||||||||||||||||
| 2149 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2150 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2151 | - | |||||||||||||||||||||||||
| 2152 | - | |||||||||||||||||||||||||
| 2153 | - | |||||||||||||||||||||||||
| 2154 | if (d->gestureManager->filterEvent(receiver, e)
| 0 | ||||||||||||||||||||||||
| 2155 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2156 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2157 | } | - | ||||||||||||||||||||||||
| 2158 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2159 | } | - | ||||||||||||||||||||||||
| 2160 | } | - | ||||||||||||||||||||||||
| 2161 | - | |||||||||||||||||||||||||
| 2162 | - | |||||||||||||||||||||||||
| 2163 | switch (e->type()) { | - | ||||||||||||||||||||||||
| 2164 | case never executed: QEvent::ApplicationDeactivate:case QEvent::ApplicationDeactivate:never executed: case QEvent::ApplicationDeactivate: | 0 | ||||||||||||||||||||||||
| 2165 | - | |||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||
| 2167 | closeAllPopups(); | - | ||||||||||||||||||||||||
| 2168 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2169 | case never executed: QEvent::Wheel:case QEvent::Wheel:never executed: case QEvent::Wheel: | 0 | ||||||||||||||||||||||||
| 2170 | case never executed: QEvent::ActivationChange:case QEvent::ActivationChange:never executed: case QEvent::ActivationChange: | 0 | ||||||||||||||||||||||||
| 2171 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
| 2172 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
| 2173 | case never executed: QEvent::FocusOut:case QEvent::FocusOut:never executed: case QEvent::FocusOut: | 0 | ||||||||||||||||||||||||
| 2174 | case never executed: QEvent::FocusIn:case QEvent::FocusIn:never executed: case QEvent::FocusIn: | 0 | ||||||||||||||||||||||||
| 2175 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
| 2176 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
| 2177 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick:never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||
| 2178 | d->toolTipFallAsleep.stop(); | - | ||||||||||||||||||||||||
| 2179 | - | |||||||||||||||||||||||||
| 2180 | case never executed: QEvent::Leave:case QEvent::Leave:never executed: case QEvent::Leave:code before this statement never executed: case QEvent::Leave: | 0 | ||||||||||||||||||||||||
| 2181 | d->toolTipWakeUp.stop(); | - | ||||||||||||||||||||||||
| 2182 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
| 2183 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2184 | } | - | ||||||||||||||||||||||||
| 2185 | - | |||||||||||||||||||||||||
| 2186 | switch (e->type()) { | - | ||||||||||||||||||||||||
| 2187 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: {case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
| 2188 | int key = static_cast<QKeyEvent*>(e)->key(); | - | ||||||||||||||||||||||||
| 2189 | qt_in_tab_key_event = (key == Qt::Key_Backtab
| 0 | ||||||||||||||||||||||||
| 2190 | || key == Qt::Key_Tab
| 0 | ||||||||||||||||||||||||
| 2191 | || key == Qt::Key_Left
| 0 | ||||||||||||||||||||||||
| 2192 | || key == Qt::Key_Up
| 0 | ||||||||||||||||||||||||
| 2193 | || key == Qt::Key_Right
| 0 | ||||||||||||||||||||||||
| 2194 | || key == Qt::Key_Down
| 0 | ||||||||||||||||||||||||
| 2195 | } | - | ||||||||||||||||||||||||
| 2196 | default never executed: :default:never executed: default:code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
| 2197 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2198 | } | - | ||||||||||||||||||||||||
| 2199 | - | |||||||||||||||||||||||||
| 2200 | bool res = false; | - | ||||||||||||||||||||||||
| 2201 | if (!receiver->isWidgetType()
| 0 | ||||||||||||||||||||||||
| 2202 | res = d->notify_helper(receiver, e); | - | ||||||||||||||||||||||||
| 2203 | } never executed: else switch (e->type()) {end of block | 0 | ||||||||||||||||||||||||
| 2204 | case never executed: QEvent::ShortcutOverride:case QEvent::ShortcutOverride:never executed: case QEvent::ShortcutOverride: | 0 | ||||||||||||||||||||||||
| 2205 | case never executed: QEvent::KeyPress:case QEvent::KeyPress:never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
| 2206 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease:never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
| 2207 | { | - | ||||||||||||||||||||||||
| 2208 | bool isWidget = receiver->isWidgetType(); | - | ||||||||||||||||||||||||
| 2209 | - | |||||||||||||||||||||||||
| 2210 | const bool isGraphicsWidget = !isWidget
| 0 | ||||||||||||||||||||||||
| 2211 | - | |||||||||||||||||||||||||
| 2212 | QKeyEvent* key = static_cast<QKeyEvent*>(e); | - | ||||||||||||||||||||||||
| 2213 | bool def = key->isAccepted(); | - | ||||||||||||||||||||||||
| 2214 | QPointer<QObject> pr = receiver; | - | ||||||||||||||||||||||||
| 2215 | while (receiver
| 0 | ||||||||||||||||||||||||
| 2216 | if (def
| 0 | ||||||||||||||||||||||||
| 2217 | key->accept(); never executed: key->accept(); | 0 | ||||||||||||||||||||||||
| 2218 | else | - | ||||||||||||||||||||||||
| 2219 | key->ignore(); never executed: key->ignore(); | 0 | ||||||||||||||||||||||||
| 2220 | QWidget *w = isWidget
| 0 | ||||||||||||||||||||||||
| 2221 | - | |||||||||||||||||||||||||
| 2222 | QGraphicsWidget *gw = isGraphicsWidget
| 0 | ||||||||||||||||||||||||
| 2223 | - | |||||||||||||||||||||||||
| 2224 | res = d->notify_helper(receiver, e); | - | ||||||||||||||||||||||||
| 2225 | - | |||||||||||||||||||||||||
| 2226 | if ((res
| 0 | ||||||||||||||||||||||||
| 2227 | || !pr
| 0 | ||||||||||||||||||||||||
| 2228 | || (isWidget
| 0 | ||||||||||||||||||||||||
| 2229 | - | |||||||||||||||||||||||||
| 2230 | || (isGraphicsWidget
| 0 | ||||||||||||||||||||||||
| 2231 | - | |||||||||||||||||||||||||
| 2232 | ) { | - | ||||||||||||||||||||||||
| 2233 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2234 | } | - | ||||||||||||||||||||||||
| 2235 | - | |||||||||||||||||||||||||
| 2236 | - | |||||||||||||||||||||||||
| 2237 | receiver = w
| 0 | ||||||||||||||||||||||||
| 2238 | - | |||||||||||||||||||||||||
| 2239 | - | |||||||||||||||||||||||||
| 2240 | - | |||||||||||||||||||||||||
| 2241 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2242 | qt_in_tab_key_event = false; | - | ||||||||||||||||||||||||
| 2243 | } | - | ||||||||||||||||||||||||
| 2244 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2245 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
| 2246 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
| 2247 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick:never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||
| 2248 | case never executed: QEvent::MouseMove:case QEvent::MouseMove:never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
| 2249 | { | - | ||||||||||||||||||||||||
| 2250 | QWidget* w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2251 | - | |||||||||||||||||||||||||
| 2252 | QMouseEvent* mouse = static_cast<QMouseEvent*>(e); | - | ||||||||||||||||||||||||
| 2253 | QPoint relpos = mouse->pos(); | - | ||||||||||||||||||||||||
| 2254 | - | |||||||||||||||||||||||||
| 2255 | if (e->spontaneous()
| 0 | ||||||||||||||||||||||||
| 2256 | if (e->type() != QEvent::MouseMove
| 0 | ||||||||||||||||||||||||
| 2257 | QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); never executed: QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); | 0 | ||||||||||||||||||||||||
| 2258 | if (e->type() == QEvent::MouseMove
| 0 | ||||||||||||||||||||||||
| 2259 | && w->rect().contains(relpos)
| 0 | ||||||||||||||||||||||||
| 2260 | d->toolTipWidget = w; | - | ||||||||||||||||||||||||
| 2261 | d->toolTipPos = relpos; | - | ||||||||||||||||||||||||
| 2262 | d->toolTipGlobalPos = mouse->globalPos(); | - | ||||||||||||||||||||||||
| 2263 | QStyle *s = d->toolTipWidget->style(); | - | ||||||||||||||||||||||||
| 2264 | int wakeDelay = s->styleHint(QStyle::SH_ToolTip_WakeUpDelay, 0, d->toolTipWidget, 0); | - | ||||||||||||||||||||||||
| 2265 | d->toolTipWakeUp.start(d->toolTipFallAsleep.isActive() ? 20 : wakeDelay, this); | - | ||||||||||||||||||||||||
| 2266 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2267 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2268 | - | |||||||||||||||||||||||||
| 2269 | bool eventAccepted = mouse->isAccepted(); | - | ||||||||||||||||||||||||
| 2270 | - | |||||||||||||||||||||||||
| 2271 | QPointer<QWidget> pw = w; | - | ||||||||||||||||||||||||
| 2272 | while (w
| 0 | ||||||||||||||||||||||||
| 2273 | QMouseEvent me(mouse->type(), relpos, mouse->windowPos(), mouse->globalPos(), | - | ||||||||||||||||||||||||
| 2274 | mouse->button(), mouse->buttons(), mouse->modifiers(), mouse->source()); | - | ||||||||||||||||||||||||
| 2275 | me.spont = mouse->spontaneous(); | - | ||||||||||||||||||||||||
| 2276 | me.setTimestamp(mouse->timestamp()); | - | ||||||||||||||||||||||||
| 2277 | QGuiApplicationPrivate::setMouseEventFlags(&me, mouse->flags()); | - | ||||||||||||||||||||||||
| 2278 | - | |||||||||||||||||||||||||
| 2279 | if (!w->hasMouseTracking()
| 0 | ||||||||||||||||||||||||
| 2280 | && mouse->type() == QEvent::MouseMove
| 0 | ||||||||||||||||||||||||
| 2281 | - | |||||||||||||||||||||||||
| 2282 | for (int i = 0; d->extraData
| 0 | ||||||||||||||||||||||||
| 2283 | QObject *obj = d->extraData->eventFilters.at(i); | - | ||||||||||||||||||||||||
| 2284 | if (!obj
| 0 | ||||||||||||||||||||||||
| 2285 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 2286 | if (__builtin_expect(!!(obj->d_func()->threadData != w->d_func()->threadData), false)
| 0 | ||||||||||||||||||||||||
| 2287 | QMessageLogger(__FILE__, 3264, __PRETTY_FUNCTION__).warning("QApplication: Object event filter cannot be in a different thread."); | - | ||||||||||||||||||||||||
| 2288 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 2289 | } | - | ||||||||||||||||||||||||
| 2290 | if (obj->eventFilter(w, w == receiver ? mouse : &me)
| 0 | ||||||||||||||||||||||||
| 2291 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2292 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2293 | res = true; | - | ||||||||||||||||||||||||
| 2294 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2295 | w->setAttribute(Qt::WA_NoMouseReplay, false); | - | ||||||||||||||||||||||||
| 2296 | res = d->notify_helper(w, w == receiver ? mouse : &me); | - | ||||||||||||||||||||||||
| 2297 | e->spont = false; | - | ||||||||||||||||||||||||
| 2298 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2299 | eventAccepted = (w == receiver
| 0 | ||||||||||||||||||||||||
| 2300 | if (res
| 0 | ||||||||||||||||||||||||
| 2301 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2302 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2303 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2304 | relpos += w->pos(); | - | ||||||||||||||||||||||||
| 2305 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2306 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2307 | - | |||||||||||||||||||||||||
| 2308 | mouse->setAccepted(eventAccepted); | - | ||||||||||||||||||||||||
| 2309 | - | |||||||||||||||||||||||||
| 2310 | if (e->type() == QEvent::MouseMove
| 0 | ||||||||||||||||||||||||
| 2311 | if (!pw
| 0 | ||||||||||||||||||||||||
| 2312 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2313 | - | |||||||||||||||||||||||||
| 2314 | w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2315 | relpos = mouse->pos(); | - | ||||||||||||||||||||||||
| 2316 | QPoint diff = relpos - w->mapFromGlobal(d->hoverGlobalPos); | - | ||||||||||||||||||||||||
| 2317 | while (w
| 0 | ||||||||||||||||||||||||
| 2318 | if (w->testAttribute(Qt::WA_Hover)
| 0 | ||||||||||||||||||||||||
| 2319 | (!QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||
| 2320 | QHoverEvent he(QEvent::HoverMove, relpos, relpos - diff, mouse->modifiers()); | - | ||||||||||||||||||||||||
| 2321 | d->notify_helper(w, &he); | - | ||||||||||||||||||||||||
| 2322 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2323 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2324 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2325 | relpos += w->pos(); | - | ||||||||||||||||||||||||
| 2326 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2327 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2328 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2329 | - | |||||||||||||||||||||||||
| 2330 | d->hoverGlobalPos = mouse->globalPos(); | - | ||||||||||||||||||||||||
| 2331 | } | - | ||||||||||||||||||||||||
| 2332 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2333 | - | |||||||||||||||||||||||||
| 2334 | case never executed: QEvent::Wheel:case QEvent::Wheel:never executed: case QEvent::Wheel: | 0 | ||||||||||||||||||||||||
| 2335 | { | - | ||||||||||||||||||||||||
| 2336 | QWidget* w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2337 | - | |||||||||||||||||||||||||
| 2338 | - | |||||||||||||||||||||||||
| 2339 | if (const
| 0 | ||||||||||||||||||||||||
| 2340 | if (w->window() != popup
| 0 | ||||||||||||||||||||||||
| 2341 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2342 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2343 | - | |||||||||||||||||||||||||
| 2344 | QWheelEvent* wheel = static_cast<QWheelEvent*>(e); | - | ||||||||||||||||||||||||
| 2345 | const bool spontaneous = wheel->spontaneous(); | - | ||||||||||||||||||||||||
| 2346 | const Qt::ScrollPhase phase = wheel->phase(); | - | ||||||||||||||||||||||||
| 2347 | if (phase == Qt::NoScrollPhase
| 0 | ||||||||||||||||||||||||
| 2348 | - | |||||||||||||||||||||||||
| 2349 | - | |||||||||||||||||||||||||
| 2350 | - | |||||||||||||||||||||||||
| 2351 | - | |||||||||||||||||||||||||
| 2352 | if (spontaneous
| 0 | ||||||||||||||||||||||||
| 2353 | QApplicationPrivate::wheel_widget = nullptr; never executed: QApplicationPrivate::wheel_widget = nullptr; | 0 | ||||||||||||||||||||||||
| 2354 | - | |||||||||||||||||||||||||
| 2355 | const QPoint &relpos = wheel->pos(); | - | ||||||||||||||||||||||||
| 2356 | - | |||||||||||||||||||||||||
| 2357 | if (spontaneous
| 0 | ||||||||||||||||||||||||
| 2358 | QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); never executed: QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos); | 0 | ||||||||||||||||||||||||
| 2359 | - | |||||||||||||||||||||||||
| 2360 | QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), | - | ||||||||||||||||||||||||
| 2361 | wheel->modifiers(), phase, wheel->source(), wheel->inverted()); | - | ||||||||||||||||||||||||
| 2362 | bool eventAccepted; | - | ||||||||||||||||||||||||
| 2363 | while (w
| 0 | ||||||||||||||||||||||||
| 2364 | we.spont = spontaneous
| 0 | ||||||||||||||||||||||||
| 2365 | we.ignore(); | - | ||||||||||||||||||||||||
| 2366 | res = d->notify_helper(w, &we); | - | ||||||||||||||||||||||||
| 2367 | eventAccepted = we.isAccepted(); | - | ||||||||||||||||||||||||
| 2368 | if (res
| 0 | ||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||
| 2370 | - | |||||||||||||||||||||||||
| 2371 | - | |||||||||||||||||||||||||
| 2372 | if (spontaneous
| 0 | ||||||||||||||||||||||||
| 2373 | QApplicationPrivate::wheel_widget = w; never executed: QApplicationPrivate::wheel_widget = w; | 0 | ||||||||||||||||||||||||
| 2374 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2375 | } | - | ||||||||||||||||||||||||
| 2376 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2377 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2378 | - | |||||||||||||||||||||||||
| 2379 | we.p += w->pos(); | - | ||||||||||||||||||||||||
| 2380 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2381 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2382 | wheel->setAccepted(eventAccepted); | - | ||||||||||||||||||||||||
| 2383 | } never executed: else if (!spontaneousend of block
| 0 | ||||||||||||||||||||||||
| 2384 | - | |||||||||||||||||||||||||
| 2385 | - | |||||||||||||||||||||||||
| 2386 | - | |||||||||||||||||||||||||
| 2387 | - | |||||||||||||||||||||||||
| 2388 | - | |||||||||||||||||||||||||
| 2389 | d->notify_helper(w, wheel); | - | ||||||||||||||||||||||||
| 2390 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2391 | - | |||||||||||||||||||||||||
| 2392 | - | |||||||||||||||||||||||||
| 2393 | - | |||||||||||||||||||||||||
| 2394 | - | |||||||||||||||||||||||||
| 2395 | const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPos()); | - | ||||||||||||||||||||||||
| 2396 | QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(), | - | ||||||||||||||||||||||||
| 2397 | wheel->modifiers(), wheel->phase(), wheel->source()); | - | ||||||||||||||||||||||||
| 2398 | we.spont = true; | - | ||||||||||||||||||||||||
| 2399 | we.ignore(); | - | ||||||||||||||||||||||||
| 2400 | d->notify_helper(QApplicationPrivate::wheel_widget, &we); | - | ||||||||||||||||||||||||
| 2401 | wheel->setAccepted(we.isAccepted()); | - | ||||||||||||||||||||||||
| 2402 | if (phase == Qt::ScrollEnd
| 0 | ||||||||||||||||||||||||
| 2403 | QApplicationPrivate::wheel_widget = nullptr; never executed: QApplicationPrivate::wheel_widget = nullptr; | 0 | ||||||||||||||||||||||||
| 2404 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2405 | } | - | ||||||||||||||||||||||||
| 2406 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2407 | - | |||||||||||||||||||||||||
| 2408 | - | |||||||||||||||||||||||||
| 2409 | case never executed: QEvent::ContextMenu:case QEvent::ContextMenu:never executed: case QEvent::ContextMenu: | 0 | ||||||||||||||||||||||||
| 2410 | { | - | ||||||||||||||||||||||||
| 2411 | QWidget* w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2412 | QContextMenuEvent *context = static_cast<QContextMenuEvent*>(e); | - | ||||||||||||||||||||||||
| 2413 | QPoint relpos = context->pos(); | - | ||||||||||||||||||||||||
| 2414 | bool eventAccepted = context->isAccepted(); | - | ||||||||||||||||||||||||
| 2415 | while (w
| 0 | ||||||||||||||||||||||||
| 2416 | QContextMenuEvent ce(context->reason(), relpos, context->globalPos(), context->modifiers()); | - | ||||||||||||||||||||||||
| 2417 | ce.spont = e->spontaneous(); | - | ||||||||||||||||||||||||
| 2418 | res = d->notify_helper(w, w == receiver ? context : &ce); | - | ||||||||||||||||||||||||
| 2419 | eventAccepted = ((
| 0 | ||||||||||||||||||||||||
| 2420 | e->spont = false; | - | ||||||||||||||||||||||||
| 2421 | - | |||||||||||||||||||||||||
| 2422 | if ((res
| 0 | ||||||||||||||||||||||||
| 2423 | || w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2424 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||
| 2426 | relpos += w->pos(); | - | ||||||||||||||||||||||||
| 2427 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2428 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2429 | context->setAccepted(eventAccepted); | - | ||||||||||||||||||||||||
| 2430 | } | - | ||||||||||||||||||||||||
| 2431 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2432 | - | |||||||||||||||||||||||||
| 2433 | - | |||||||||||||||||||||||||
| 2434 | case never executed: QEvent::TabletMove:case QEvent::TabletMove:never executed: case QEvent::TabletMove: | 0 | ||||||||||||||||||||||||
| 2435 | case never executed: QEvent::TabletPress:case QEvent::TabletPress:never executed: case QEvent::TabletPress: | 0 | ||||||||||||||||||||||||
| 2436 | case never executed: QEvent::TabletRelease:case QEvent::TabletRelease:never executed: case QEvent::TabletRelease: | 0 | ||||||||||||||||||||||||
| 2437 | { | - | ||||||||||||||||||||||||
| 2438 | QWidget *w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2439 | QTabletEvent *tablet = static_cast<QTabletEvent*>(e); | - | ||||||||||||||||||||||||
| 2440 | QPointF relpos = tablet->posF(); | - | ||||||||||||||||||||||||
| 2441 | bool eventAccepted = tablet->isAccepted(); | - | ||||||||||||||||||||||||
| 2442 | while (w
| 0 | ||||||||||||||||||||||||
| 2443 | QTabletEvent te(tablet->type(), relpos, tablet->globalPosF(), | - | ||||||||||||||||||||||||
| 2444 | tablet->device(), tablet->pointerType(), | - | ||||||||||||||||||||||||
| 2445 | tablet->pressure(), tablet->xTilt(), tablet->yTilt(), | - | ||||||||||||||||||||||||
| 2446 | tablet->tangentialPressure(), tablet->rotation(), tablet->z(), | - | ||||||||||||||||||||||||
| 2447 | tablet->modifiers(), tablet->uniqueId(), tablet->button(), tablet->buttons()); | - | ||||||||||||||||||||||||
| 2448 | te.spont = e->spontaneous(); | - | ||||||||||||||||||||||||
| 2449 | res = d->notify_helper(w, w == receiver ? tablet : &te); | - | ||||||||||||||||||||||||
| 2450 | eventAccepted = ((
| 0 | ||||||||||||||||||||||||
| 2451 | e->spont = false; | - | ||||||||||||||||||||||||
| 2452 | if ((res
| 0 | ||||||||||||||||||||||||
| 2453 | || w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2454 | || w->testAttribute(Qt::WA_NoMousePropagation)
| 0 | ||||||||||||||||||||||||
| 2455 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2456 | - | |||||||||||||||||||||||||
| 2457 | relpos += w->pos(); | - | ||||||||||||||||||||||||
| 2458 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2459 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2460 | tablet->setAccepted(eventAccepted); | - | ||||||||||||||||||||||||
| 2461 | } | - | ||||||||||||||||||||||||
| 2462 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2463 | - | |||||||||||||||||||||||||
| 2464 | - | |||||||||||||||||||||||||
| 2465 | - | |||||||||||||||||||||||||
| 2466 | case never executed: QEvent::ToolTip:case QEvent::ToolTip:never executed: case QEvent::ToolTip: | 0 | ||||||||||||||||||||||||
| 2467 | case never executed: QEvent::WhatsThis:case QEvent::WhatsThis:never executed: case QEvent::WhatsThis: | 0 | ||||||||||||||||||||||||
| 2468 | case never executed: QEvent::QueryWhatsThis:case QEvent::QueryWhatsThis:never executed: case QEvent::QueryWhatsThis: | 0 | ||||||||||||||||||||||||
| 2469 | { | - | ||||||||||||||||||||||||
| 2470 | QWidget* w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2471 | QHelpEvent *help = static_cast<QHelpEvent*>(e); | - | ||||||||||||||||||||||||
| 2472 | QPoint relpos = help->pos(); | - | ||||||||||||||||||||||||
| 2473 | bool eventAccepted = help->isAccepted(); | - | ||||||||||||||||||||||||
| 2474 | while (w
| 0 | ||||||||||||||||||||||||
| 2475 | QHelpEvent he(help->type(), relpos, help->globalPos()); | - | ||||||||||||||||||||||||
| 2476 | he.spont = e->spontaneous(); | - | ||||||||||||||||||||||||
| 2477 | res = d->notify_helper(w, w == receiver ? help : &he); | - | ||||||||||||||||||||||||
| 2478 | e->spont = false; | - | ||||||||||||||||||||||||
| 2479 | eventAccepted = (w == receiver
| 0 | ||||||||||||||||||||||||
| 2480 | if ((res
| 0 | ||||||||||||||||||||||||
| 2481 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2482 | - | |||||||||||||||||||||||||
| 2483 | relpos += w->pos(); | - | ||||||||||||||||||||||||
| 2484 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2485 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2486 | help->setAccepted(eventAccepted); | - | ||||||||||||||||||||||||
| 2487 | } | - | ||||||||||||||||||||||||
| 2488 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2489 | - | |||||||||||||||||||||||||
| 2490 | - | |||||||||||||||||||||||||
| 2491 | case never executed: QEvent::StatusTip:case QEvent::StatusTip:never executed: case QEvent::StatusTip: | 0 | ||||||||||||||||||||||||
| 2492 | case never executed: QEvent::WhatsThisClicked:case QEvent::WhatsThisClicked:never executed: case QEvent::WhatsThisClicked: | 0 | ||||||||||||||||||||||||
| 2493 | { | - | ||||||||||||||||||||||||
| 2494 | QWidget *w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2495 | while (w
| 0 | ||||||||||||||||||||||||
| 2496 | res = d->notify_helper(w, e); | - | ||||||||||||||||||||||||
| 2497 | if ((res
| 0 | ||||||||||||||||||||||||
| 2498 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2499 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2500 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2501 | } | - | ||||||||||||||||||||||||
| 2502 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2503 | - | |||||||||||||||||||||||||
| 2504 | - | |||||||||||||||||||||||||
| 2505 | - | |||||||||||||||||||||||||
| 2506 | case never executed: QEvent::DragEnter:case QEvent::DragEnter:never executed: {case QEvent::DragEnter: | 0 | ||||||||||||||||||||||||
| 2507 | QWidget* w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2508 | QDragEnterEvent *dragEvent = static_cast<QDragEnterEvent *>(e); | - | ||||||||||||||||||||||||
| 2509 | - | |||||||||||||||||||||||||
| 2510 | - | |||||||||||||||||||||||||
| 2511 | - | |||||||||||||||||||||||||
| 2512 | QWExtra *extra = w->window()->d_func()->extra; | - | ||||||||||||||||||||||||
| 2513 | if (extra
| 0 | ||||||||||||||||||||||||
| 2514 | res = d->notify_helper(w, dragEvent); | - | ||||||||||||||||||||||||
| 2515 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2516 | } | - | ||||||||||||||||||||||||
| 2517 | - | |||||||||||||||||||||||||
| 2518 | while (w
| 0 | ||||||||||||||||||||||||
| 2519 | if (w->isEnabled()
| 0 | ||||||||||||||||||||||||
| 2520 | res = d->notify_helper(w, dragEvent); | - | ||||||||||||||||||||||||
| 2521 | if (res
| 0 | ||||||||||||||||||||||||
| 2522 | QDragManager::self()->setCurrentTarget(w); | - | ||||||||||||||||||||||||
| 2523 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2524 | } | - | ||||||||||||||||||||||||
| 2525 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2526 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2527 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2528 | dragEvent->p = w->mapToParent(dragEvent->p.toPoint()); | - | ||||||||||||||||||||||||
| 2529 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2530 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2531 | } | - | ||||||||||||||||||||||||
| 2532 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2533 | case never executed: QEvent::DragMove:case QEvent::DragMove:never executed: case QEvent::DragMove: | 0 | ||||||||||||||||||||||||
| 2534 | case never executed: QEvent::Drop:case QEvent::Drop:never executed: case QEvent::Drop: | 0 | ||||||||||||||||||||||||
| 2535 | case never executed: QEvent::DragLeave:case QEvent::DragLeave:never executed: {case QEvent::DragLeave: | 0 | ||||||||||||||||||||||||
| 2536 | QWidget* w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2537 | - | |||||||||||||||||||||||||
| 2538 | - | |||||||||||||||||||||||||
| 2539 | - | |||||||||||||||||||||||||
| 2540 | QWExtra *extra = w->window()->d_func()->extra; | - | ||||||||||||||||||||||||
| 2541 | bool isProxyWidget = extra
| 0 | ||||||||||||||||||||||||
| 2542 | if (!isProxyWidget
| 0 | ||||||||||||||||||||||||
| 2543 | - | |||||||||||||||||||||||||
| 2544 | w = qobject_cast<QWidget *>(QDragManager::self()->currentTarget()); never executed: w = qobject_cast<QWidget *>(QDragManager::self()->currentTarget()); | 0 | ||||||||||||||||||||||||
| 2545 | - | |||||||||||||||||||||||||
| 2546 | if (!w
| 0 | ||||||||||||||||||||||||
| 2547 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2548 | } | - | ||||||||||||||||||||||||
| 2549 | if (e->type() == QEvent::DragMove
| 0 | ||||||||||||||||||||||||
| 2550 | QDropEvent *dragEvent = static_cast<QDropEvent *>(e); | - | ||||||||||||||||||||||||
| 2551 | QWidget *origReciver = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2552 | while (origReciver
| 0 | ||||||||||||||||||||||||
| 2553 | dragEvent->p = origReciver->mapToParent(dragEvent->p.toPoint()); | - | ||||||||||||||||||||||||
| 2554 | origReciver = origReciver->parentWidget(); | - | ||||||||||||||||||||||||
| 2555 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2556 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2557 | res = d->notify_helper(w, e); | - | ||||||||||||||||||||||||
| 2558 | if (e->type() != QEvent::DragMove
| 0 | ||||||||||||||||||||||||
| 2559 | - | |||||||||||||||||||||||||
| 2560 | && !isProxyWidget
| 0 | ||||||||||||||||||||||||
| 2561 | - | |||||||||||||||||||||||||
| 2562 | ) | - | ||||||||||||||||||||||||
| 2563 | QDragManager::self()->setCurrentTarget(0, e->type() == QEvent::Drop); never executed: QDragManager::self()->setCurrentTarget(0, e->type() == QEvent::Drop); | 0 | ||||||||||||||||||||||||
| 2564 | } | - | ||||||||||||||||||||||||
| 2565 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2566 | - | |||||||||||||||||||||||||
| 2567 | case never executed: QEvent::TouchBegin:case QEvent::TouchBegin:never executed: case QEvent::TouchBegin: | 0 | ||||||||||||||||||||||||
| 2568 | - | |||||||||||||||||||||||||
| 2569 | { | - | ||||||||||||||||||||||||
| 2570 | QWidget *widget = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2571 | QTouchEvent *touchEvent = static_cast<QTouchEvent *>(e); | - | ||||||||||||||||||||||||
| 2572 | bool eventAccepted = touchEvent->isAccepted(); | - | ||||||||||||||||||||||||
| 2573 | bool acceptTouchEvents = widget->testAttribute(Qt::WA_AcceptTouchEvents); | - | ||||||||||||||||||||||||
| 2574 | - | |||||||||||||||||||||||||
| 2575 | if (acceptTouchEvents
| 0 | ||||||||||||||||||||||||
| 2576 | const QPoint localPos = touchEvent->touchPoints()[0].pos().toPoint(); | - | ||||||||||||||||||||||||
| 2577 | QApplicationPrivate::giveFocusAccordingToFocusPolicy(widget, e, localPos); | - | ||||||||||||||||||||||||
| 2578 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2579 | - | |||||||||||||||||||||||||
| 2580 | - | |||||||||||||||||||||||||
| 2581 | QPointer<QWidget> gesturePendingWidget; | - | ||||||||||||||||||||||||
| 2582 | - | |||||||||||||||||||||||||
| 2583 | - | |||||||||||||||||||||||||
| 2584 | while (widget
| 0 | ||||||||||||||||||||||||
| 2585 | - | |||||||||||||||||||||||||
| 2586 | acceptTouchEvents = widget->testAttribute(Qt::WA_AcceptTouchEvents); | - | ||||||||||||||||||||||||
| 2587 | touchEvent->setTarget(widget); | - | ||||||||||||||||||||||||
| 2588 | touchEvent->setAccepted(acceptTouchEvents); | - | ||||||||||||||||||||||||
| 2589 | QPointer<QWidget> p = widget; | - | ||||||||||||||||||||||||
| 2590 | res = acceptTouchEvents
| 0 | ||||||||||||||||||||||||
| 2591 | eventAccepted = touchEvent->isAccepted(); | - | ||||||||||||||||||||||||
| 2592 | if (p.isNull()
| 0 | ||||||||||||||||||||||||
| 2593 | - | |||||||||||||||||||||||||
| 2594 | widget = 0; | - | ||||||||||||||||||||||||
| 2595 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2596 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, res && eventAccepted); | - | ||||||||||||||||||||||||
| 2597 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2598 | touchEvent->spont = false; | - | ||||||||||||||||||||||||
| 2599 | if (res
| 0 | ||||||||||||||||||||||||
| 2600 | - | |||||||||||||||||||||||||
| 2601 | d->activateImplicitTouchGrab(widget, touchEvent); | - | ||||||||||||||||||||||||
| 2602 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2603 | } | - | ||||||||||||||||||||||||
| 2604 | - | |||||||||||||||||||||||||
| 2605 | if (gesturePendingWidget.isNull()
| 0 | ||||||||||||||||||||||||
| 2606 | gesturePendingWidget = widget; never executed: gesturePendingWidget = widget; | 0 | ||||||||||||||||||||||||
| 2607 | - | |||||||||||||||||||||||||
| 2608 | if (p.isNull()
| 0 | ||||||||||||||||||||||||
| 2609 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2610 | - | |||||||||||||||||||||||||
| 2611 | QPoint offset = widget->pos(); | - | ||||||||||||||||||||||||
| 2612 | widget = widget->parentWidget(); | - | ||||||||||||||||||||||||
| 2613 | touchEvent->setTarget(widget); | - | ||||||||||||||||||||||||
| 2614 | for (int i = 0; i < touchEvent->_touchPoints.size()
| 0 | ||||||||||||||||||||||||
| 2615 | QTouchEvent::TouchPoint &pt = touchEvent->_touchPoints[i]; | - | ||||||||||||||||||||||||
| 2616 | QRectF rect = pt.rect(); | - | ||||||||||||||||||||||||
| 2617 | rect.translate(offset); | - | ||||||||||||||||||||||||
| 2618 | pt.d->rect = rect; | - | ||||||||||||||||||||||||
| 2619 | pt.d->startPos = pt.startPos() + offset; | - | ||||||||||||||||||||||||
| 2620 | pt.d->lastPos = pt.lastPos() + offset; | - | ||||||||||||||||||||||||
| 2621 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2622 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2623 | - | |||||||||||||||||||||||||
| 2624 | - | |||||||||||||||||||||||||
| 2625 | if (!eventAccepted
| 0 | ||||||||||||||||||||||||
| 2626 | - | |||||||||||||||||||||||||
| 2627 | d->activateImplicitTouchGrab(gesturePendingWidget, touchEvent); | - | ||||||||||||||||||||||||
| 2628 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2629 | - | |||||||||||||||||||||||||
| 2630 | - | |||||||||||||||||||||||||
| 2631 | touchEvent->setAccepted(eventAccepted); | - | ||||||||||||||||||||||||
| 2632 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2633 | } | - | ||||||||||||||||||||||||
| 2634 | case never executed: QEvent::TouchUpdate:case QEvent::TouchUpdate:never executed: case QEvent::TouchUpdate: | 0 | ||||||||||||||||||||||||
| 2635 | case never executed: QEvent::TouchEnd:case QEvent::TouchEnd:never executed: case QEvent::TouchEnd: | 0 | ||||||||||||||||||||||||
| 2636 | { | - | ||||||||||||||||||||||||
| 2637 | QWidget *widget = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2638 | - | |||||||||||||||||||||||||
| 2639 | - | |||||||||||||||||||||||||
| 2640 | - | |||||||||||||||||||||||||
| 2641 | if (widget
| 0 | ||||||||||||||||||||||||
| 2642 | res = d->notify_helper(widget, e); never executed: res = d->notify_helper(widget, e); | 0 | ||||||||||||||||||||||||
| 2643 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2644 | } | - | ||||||||||||||||||||||||
| 2645 | case never executed: QEvent::RequestSoftwareInputPanel:case QEvent::RequestSoftwareInputPanel:never executed: case QEvent::RequestSoftwareInputPanel: | 0 | ||||||||||||||||||||||||
| 2646 | inputMethod()->show(); | - | ||||||||||||||||||||||||
| 2647 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2648 | case never executed: QEvent::CloseSoftwareInputPanel:case QEvent::CloseSoftwareInputPanel:never executed: case QEvent::CloseSoftwareInputPanel: | 0 | ||||||||||||||||||||||||
| 2649 | inputMethod()->hide(); | - | ||||||||||||||||||||||||
| 2650 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2651 | - | |||||||||||||||||||||||||
| 2652 | - | |||||||||||||||||||||||||
| 2653 | case never executed: QEvent::NativeGesture:case QEvent::NativeGesture:never executed: case QEvent::NativeGesture: | 0 | ||||||||||||||||||||||||
| 2654 | { | - | ||||||||||||||||||||||||
| 2655 | - | |||||||||||||||||||||||||
| 2656 | QWidget *w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2657 | while (w
| 0 | ||||||||||||||||||||||||
| 2658 | e->ignore(); | - | ||||||||||||||||||||||||
| 2659 | res = d->notify_helper(w, e); | - | ||||||||||||||||||||||||
| 2660 | if ((res
| 0 | ||||||||||||||||||||||||
| 2661 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2662 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2663 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2664 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2665 | } | - | ||||||||||||||||||||||||
| 2666 | case never executed: QEvent::Gesture:case QEvent::Gesture:never executed: case QEvent::Gesture: | 0 | ||||||||||||||||||||||||
| 2667 | case never executed: QEvent::GestureOverride:case QEvent::GestureOverride:never executed: case QEvent::GestureOverride: | 0 | ||||||||||||||||||||||||
| 2668 | { | - | ||||||||||||||||||||||||
| 2669 | if (receiver->isWidgetType()
| 0 | ||||||||||||||||||||||||
| 2670 | QWidget *w = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2671 | QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(e); | - | ||||||||||||||||||||||||
| 2672 | QList<QGesture *> allGestures = gestureEvent->gestures(); | - | ||||||||||||||||||||||||
| 2673 | - | |||||||||||||||||||||||||
| 2674 | bool eventAccepted = gestureEvent->isAccepted(); | - | ||||||||||||||||||||||||
| 2675 | bool wasAccepted = eventAccepted; | - | ||||||||||||||||||||||||
| 2676 | while (w
| 0 | ||||||||||||||||||||||||
| 2677 | - | |||||||||||||||||||||||||
| 2678 | QList<QGesture *> gestures; | - | ||||||||||||||||||||||||
| 2679 | QWidgetPrivate *wd = w->d_func(); | - | ||||||||||||||||||||||||
| 2680 | for (int i = 0; i < allGestures.size()
| 0 | ||||||||||||||||||||||||
| 2681 | QGesture *g = allGestures.at(i); | - | ||||||||||||||||||||||||
| 2682 | Qt::GestureType type = g->gestureType(); | - | ||||||||||||||||||||||||
| 2683 | QMap<Qt::GestureType, Qt::GestureFlags>::iterator contextit = | - | ||||||||||||||||||||||||
| 2684 | wd->gestureContext.find(type); | - | ||||||||||||||||||||||||
| 2685 | bool deliver = contextit != wd->gestureContext.end()
| 0 | ||||||||||||||||||||||||
| 2686 | (g->state() == Qt::GestureStarted
| 0 | ||||||||||||||||||||||||
| 2687 | (
| 0 | ||||||||||||||||||||||||
| 2688 | if (deliver
| 0 | ||||||||||||||||||||||||
| 2689 | allGestures.removeAt(i); | - | ||||||||||||||||||||||||
| 2690 | gestures.append(g); | - | ||||||||||||||||||||||||
| 2691 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2692 | ++i; | - | ||||||||||||||||||||||||
| 2693 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2694 | } | - | ||||||||||||||||||||||||
| 2695 | if (!gestures.isEmpty()
| 0 | ||||||||||||||||||||||||
| 2696 | QGestureEvent ge(gestures); | - | ||||||||||||||||||||||||
| 2697 | ge.t = gestureEvent->t; | - | ||||||||||||||||||||||||
| 2698 | ge.spont = gestureEvent->spont; | - | ||||||||||||||||||||||||
| 2699 | ge.m_accept = wasAccepted; | - | ||||||||||||||||||||||||
| 2700 | ge.m_accepted = gestureEvent->m_accepted; | - | ||||||||||||||||||||||||
| 2701 | res = d->notify_helper(w, &ge); | - | ||||||||||||||||||||||||
| 2702 | gestureEvent->spont = false; | - | ||||||||||||||||||||||||
| 2703 | eventAccepted = ge.isAccepted(); | - | ||||||||||||||||||||||||
| 2704 | for (int i = 0; i < gestures.size()
| 0 | ||||||||||||||||||||||||
| 2705 | QGesture *g = gestures.at(i); | - | ||||||||||||||||||||||||
| 2706 | - | |||||||||||||||||||||||||
| 2707 | - | |||||||||||||||||||||||||
| 2708 | if (eventAccepted
| 0 | ||||||||||||||||||||||||
| 2709 | - | |||||||||||||||||||||||||
| 2710 | gestureEvent->m_targetWidgets[g->gestureType()] = w; | - | ||||||||||||||||||||||||
| 2711 | gestureEvent->setAccepted(g, true); | - | ||||||||||||||||||||||||
| 2712 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2713 | - | |||||||||||||||||||||||||
| 2714 | - | |||||||||||||||||||||||||
| 2715 | allGestures.append(g); | - | ||||||||||||||||||||||||
| 2716 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2717 | } | - | ||||||||||||||||||||||||
| 2718 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2719 | if (allGestures.isEmpty()
| 0 | ||||||||||||||||||||||||
| 2720 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2721 | if (w->isWindow()
| 0 | ||||||||||||||||||||||||
| 2722 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2723 | w = w->parentWidget(); | - | ||||||||||||||||||||||||
| 2724 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2725 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(allGestures)>::type> _container_((allGestures)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGesture *g = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||
| 2726 | gestureEvent->setAccepted(g, false); never executed: gestureEvent->setAccepted(g, false); | 0 | ||||||||||||||||||||||||
| 2727 | gestureEvent->m_accept = false; | - | ||||||||||||||||||||||||
| 2728 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2729 | res = d->notify_helper(receiver, e); | - | ||||||||||||||||||||||||
| 2730 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2731 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2732 | } | - | ||||||||||||||||||||||||
| 2733 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 2734 | res = d->notify_helper(receiver, e); | - | ||||||||||||||||||||||||
| 2735 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 2736 | } | - | ||||||||||||||||||||||||
| 2737 | - | |||||||||||||||||||||||||
| 2738 | return never executed: res;return res;never executed: return res; | 0 | ||||||||||||||||||||||||
| 2739 | } | - | ||||||||||||||||||||||||
| 2740 | - | |||||||||||||||||||||||||
| 2741 | bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e) | - | ||||||||||||||||||||||||
| 2742 | { | - | ||||||||||||||||||||||||
| 2743 | - | |||||||||||||||||||||||||
| 2744 | if (threadRequiresCoreApplication()
| 0 | ||||||||||||||||||||||||
| 2745 | && receiver->d_func()->threadData->thread == mainThread()
| 0 | ||||||||||||||||||||||||
| 2746 | && sendThroughApplicationEventFilters(receiver, e)
| 0 | ||||||||||||||||||||||||
| 2747 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2748 | - | |||||||||||||||||||||||||
| 2749 | if (receiver->isWidgetType()
| 0 | ||||||||||||||||||||||||
| 2750 | QWidget *widget = static_cast<QWidget *>(receiver); | - | ||||||||||||||||||||||||
| 2751 | - | |||||||||||||||||||||||||
| 2752 | - | |||||||||||||||||||||||||
| 2753 | - | |||||||||||||||||||||||||
| 2754 | if ((e->type() == QEvent::Enter
| 0 | ||||||||||||||||||||||||
| 2755 | (!QApplication::activePopupWidget()
| 0 | ||||||||||||||||||||||||
| 2756 | widget->setAttribute(Qt::WA_UnderMouse, true); never executed: widget->setAttribute(Qt::WA_UnderMouse, true); | 0 | ||||||||||||||||||||||||
| 2757 | else if (e->type() == QEvent::Leave
| 0 | ||||||||||||||||||||||||
| 2758 | widget->setAttribute(Qt::WA_UnderMouse, false); never executed: widget->setAttribute(Qt::WA_UnderMouse, false); | 0 | ||||||||||||||||||||||||
| 2759 | - | |||||||||||||||||||||||||
| 2760 | - | |||||||||||||||||||||||||
| 2761 | if (QLayout *layout=widget->d_func()->layout
| 0 | ||||||||||||||||||||||||
| 2762 | layout->widgetEvent(e); | - | ||||||||||||||||||||||||
| 2763 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2764 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2765 | - | |||||||||||||||||||||||||
| 2766 | - | |||||||||||||||||||||||||
| 2767 | if (sendThroughObjectEventFilters(receiver, e)
| 0 | ||||||||||||||||||||||||
| 2768 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2769 | - | |||||||||||||||||||||||||
| 2770 | - | |||||||||||||||||||||||||
| 2771 | bool consumed = receiver->event(e); | - | ||||||||||||||||||||||||
| 2772 | QCoreApplicationPrivate::setEventSpontaneous(e, false); | - | ||||||||||||||||||||||||
| 2773 | return never executed: consumed;return consumed;never executed: return consumed; | 0 | ||||||||||||||||||||||||
| 2774 | } | - | ||||||||||||||||||||||||
| 2775 | - | |||||||||||||||||||||||||
| 2776 | bool QApplicationPrivate::inPopupMode() | - | ||||||||||||||||||||||||
| 2777 | { | - | ||||||||||||||||||||||||
| 2778 | return never executed: QApplicationPrivate::popupWidgets != 0;return QApplicationPrivate::popupWidgets != 0;never executed: return QApplicationPrivate::popupWidgets != 0; | 0 | ||||||||||||||||||||||||
| 2779 | } | - | ||||||||||||||||||||||||
| 2780 | - | |||||||||||||||||||||||||
| 2781 | static void ungrabKeyboardForPopup(QWidget *popup) | - | ||||||||||||||||||||||||
| 2782 | { | - | ||||||||||||||||||||||||
| 2783 | if (QWidget::keyboardGrabber()
| 0 | ||||||||||||||||||||||||
| 2784 | qt_widget_private(QWidget::keyboardGrabber())->stealKeyboardGrab(true); never executed: qt_widget_private(QWidget::keyboardGrabber())->stealKeyboardGrab(true); | 0 | ||||||||||||||||||||||||
| 2785 | else | - | ||||||||||||||||||||||||
| 2786 | qt_widget_private(popup)->stealKeyboardGrab(false); never executed: qt_widget_private(popup)->stealKeyboardGrab(false); | 0 | ||||||||||||||||||||||||
| 2787 | } | - | ||||||||||||||||||||||||
| 2788 | - | |||||||||||||||||||||||||
| 2789 | static void ungrabMouseForPopup(QWidget *popup) | - | ||||||||||||||||||||||||
| 2790 | { | - | ||||||||||||||||||||||||
| 2791 | if (QWidget::mouseGrabber()
| 0 | ||||||||||||||||||||||||
| 2792 | qt_widget_private(QWidget::mouseGrabber())->stealMouseGrab(true); never executed: qt_widget_private(QWidget::mouseGrabber())->stealMouseGrab(true); | 0 | ||||||||||||||||||||||||
| 2793 | else | - | ||||||||||||||||||||||||
| 2794 | qt_widget_private(popup)->stealMouseGrab(false); never executed: qt_widget_private(popup)->stealMouseGrab(false); | 0 | ||||||||||||||||||||||||
| 2795 | } | - | ||||||||||||||||||||||||
| 2796 | - | |||||||||||||||||||||||||
| 2797 | static bool popupGrabOk; | - | ||||||||||||||||||||||||
| 2798 | - | |||||||||||||||||||||||||
| 2799 | static void grabForPopup(QWidget *popup) | - | ||||||||||||||||||||||||
| 2800 | { | - | ||||||||||||||||||||||||
| 2801 | ((!(popup->testAttribute(Qt::WA_WState_Created))) ? qt_assert("popup->testAttribute(Qt::WA_WState_Created)",__FILE__,3829) : qt_noop()); | - | ||||||||||||||||||||||||
| 2802 | popupGrabOk = qt_widget_private(popup)->stealKeyboardGrab(true); | - | ||||||||||||||||||||||||
| 2803 | if (popupGrabOk
| 0 | ||||||||||||||||||||||||
| 2804 | popupGrabOk = qt_widget_private(popup)->stealMouseGrab(true); | - | ||||||||||||||||||||||||
| 2805 | if (!popupGrabOk
| 0 | ||||||||||||||||||||||||
| 2806 | - | |||||||||||||||||||||||||
| 2807 | ungrabKeyboardForPopup(popup); | - | ||||||||||||||||||||||||
| 2808 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2809 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2810 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2811 | - | |||||||||||||||||||||||||
| 2812 | extern QWidget *qt_button_down; | - | ||||||||||||||||||||||||
| 2813 | extern QWidget *qt_popup_down; | - | ||||||||||||||||||||||||
| 2814 | extern bool qt_replay_popup_mouse_event; | - | ||||||||||||||||||||||||
| 2815 | - | |||||||||||||||||||||||||
| 2816 | void QApplicationPrivate::closePopup(QWidget *popup) | - | ||||||||||||||||||||||||
| 2817 | { | - | ||||||||||||||||||||||||
| 2818 | if (!popupWidgets
| 0 | ||||||||||||||||||||||||
| 2819 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2820 | popupWidgets->removeAll(popup); | - | ||||||||||||||||||||||||
| 2821 | - | |||||||||||||||||||||||||
| 2822 | if (popup == qt_popup_down
| 0 | ||||||||||||||||||||||||
| 2823 | qt_button_down = 0; | - | ||||||||||||||||||||||||
| 2824 | qt_popup_down = 0; | - | ||||||||||||||||||||||||
| 2825 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2826 | - | |||||||||||||||||||||||||
| 2827 | if (QApplicationPrivate::popupWidgets->count() == 0
| 0 | ||||||||||||||||||||||||
| 2828 | delete QApplicationPrivate::popupWidgets; | - | ||||||||||||||||||||||||
| 2829 | QApplicationPrivate::popupWidgets = 0; | - | ||||||||||||||||||||||||
| 2830 | - | |||||||||||||||||||||||||
| 2831 | if (popupGrabOk
| 0 | ||||||||||||||||||||||||
| 2832 | popupGrabOk = false; | - | ||||||||||||||||||||||||
| 2833 | - | |||||||||||||||||||||||||
| 2834 | if (popup->geometry().contains(QPoint(QGuiApplicationPrivate::mousePressX,
| 0 | ||||||||||||||||||||||||
| 2835 | QGuiApplicationPrivate::mousePressY))
| 0 | ||||||||||||||||||||||||
| 2836 | || popup->testAttribute(Qt::WA_NoMouseReplay)
| 0 | ||||||||||||||||||||||||
| 2837 | - | |||||||||||||||||||||||||
| 2838 | qt_replay_popup_mouse_event = false; | - | ||||||||||||||||||||||||
| 2839 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2840 | qt_replay_popup_mouse_event = true; | - | ||||||||||||||||||||||||
| 2841 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||
| 2843 | - | |||||||||||||||||||||||||
| 2844 | ungrabMouseForPopup(popup); | - | ||||||||||||||||||||||||
| 2845 | - | |||||||||||||||||||||||||
| 2846 | - | |||||||||||||||||||||||||
| 2847 | ungrabKeyboardForPopup(popup); | - | ||||||||||||||||||||||||
| 2848 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2849 | - | |||||||||||||||||||||||||
| 2850 | if (active_window
| 0 | ||||||||||||||||||||||||
| 2851 | if (QWidget *fw = active_window->focusWidget()
| 0 | ||||||||||||||||||||||||
| 2852 | if (fw != QApplication::focusWidget()
| 0 | ||||||||||||||||||||||||
| 2853 | fw->setFocus(Qt::PopupFocusReason); | - | ||||||||||||||||||||||||
| 2854 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2855 | QFocusEvent e(QEvent::FocusIn, Qt::PopupFocusReason); | - | ||||||||||||||||||||||||
| 2856 | QCoreApplication::sendEvent(fw, &e); | - | ||||||||||||||||||||||||
| 2857 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2858 | } | - | ||||||||||||||||||||||||
| 2859 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2860 | - | |||||||||||||||||||||||||
| 2861 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2862 | - | |||||||||||||||||||||||||
| 2863 | QWidget* aw = QApplicationPrivate::popupWidgets->constLast(); | - | ||||||||||||||||||||||||
| 2864 | if (QWidget *fw = aw->focusWidget()
| 0 | ||||||||||||||||||||||||
| 2865 | fw->setFocus(Qt::PopupFocusReason); never executed: fw->setFocus(Qt::PopupFocusReason); | 0 | ||||||||||||||||||||||||
| 2866 | - | |||||||||||||||||||||||||
| 2867 | if (QApplicationPrivate::popupWidgets->count() == 1
| 0 | ||||||||||||||||||||||||
| 2868 | grabForPopup(aw); never executed: grabForPopup(aw); | 0 | ||||||||||||||||||||||||
| 2869 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2870 | - | |||||||||||||||||||||||||
| 2871 | } | - | ||||||||||||||||||||||||
| 2872 | - | |||||||||||||||||||||||||
| 2873 | int openPopupCount = 0; | - | ||||||||||||||||||||||||
| 2874 | - | |||||||||||||||||||||||||
| 2875 | void QApplicationPrivate::openPopup(QWidget *popup) | - | ||||||||||||||||||||||||
| 2876 | { | - | ||||||||||||||||||||||||
| 2877 | openPopupCount++; | - | ||||||||||||||||||||||||
| 2878 | if (!popupWidgets
| 0 | ||||||||||||||||||||||||
| 2879 | popupWidgets = new QWidgetList; never executed: popupWidgets = new QWidgetList; | 0 | ||||||||||||||||||||||||
| 2880 | popupWidgets->append(popup); | - | ||||||||||||||||||||||||
| 2881 | - | |||||||||||||||||||||||||
| 2882 | if (QApplicationPrivate::popupWidgets->count() == 1
| 0 | ||||||||||||||||||||||||
| 2883 | grabForPopup(popup); never executed: grabForPopup(popup); | 0 | ||||||||||||||||||||||||
| 2884 | - | |||||||||||||||||||||||||
| 2885 | - | |||||||||||||||||||||||||
| 2886 | - | |||||||||||||||||||||||||
| 2887 | - | |||||||||||||||||||||||||
| 2888 | if (popup->focusWidget()
| 0 | ||||||||||||||||||||||||
| 2889 | popup->focusWidget()->setFocus(Qt::PopupFocusReason); | - | ||||||||||||||||||||||||
| 2890 | } never executed: else if (popupWidgets->count() == 1end of block
| 0 | ||||||||||||||||||||||||
| 2891 | if (QWidget *fw = QApplication::focusWidget()
| 0 | ||||||||||||||||||||||||
| 2892 | QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); | - | ||||||||||||||||||||||||
| 2893 | QApplication::sendEvent(fw, &e); | - | ||||||||||||||||||||||||
| 2894 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2895 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2896 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2897 | void QApplication::alert(QWidget *widget, int duration) | - | ||||||||||||||||||||||||
| 2898 | { | - | ||||||||||||||||||||||||
| 2899 | if (widget
| 0 | ||||||||||||||||||||||||
| 2900 | if (widget->window()->isActiveWindow()
| 0 | ||||||||||||||||||||||||
| 2901 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2902 | if (QWindow *window= QApplicationPrivate::windowForWidget(widget)
| 0 | ||||||||||||||||||||||||
| 2903 | window->alert(duration); never executed: window->alert(duration); | 0 | ||||||||||||||||||||||||
| 2904 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2905 | const auto topLevels = topLevelWidgets(); | - | ||||||||||||||||||||||||
| 2906 | for (QWidget *topLevel : topLevels) | - | ||||||||||||||||||||||||
| 2907 | QApplication::alert(topLevel, duration); never executed: QApplication::alert(topLevel, duration); | 0 | ||||||||||||||||||||||||
| 2908 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2909 | } | - | ||||||||||||||||||||||||
| 2910 | void QApplication::setCursorFlashTime(int msecs) | - | ||||||||||||||||||||||||
| 2911 | { | - | ||||||||||||||||||||||||
| 2912 | QGuiApplication::styleHints()->setCursorFlashTime(msecs); | - | ||||||||||||||||||||||||
| 2913 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2914 | - | |||||||||||||||||||||||||
| 2915 | int QApplication::cursorFlashTime() | - | ||||||||||||||||||||||||
| 2916 | { | - | ||||||||||||||||||||||||
| 2917 | return never executed: QGuiApplication::styleHints()->cursorFlashTime();return QGuiApplication::styleHints()->cursorFlashTime();never executed: return QGuiApplication::styleHints()->cursorFlashTime(); | 0 | ||||||||||||||||||||||||
| 2918 | } | - | ||||||||||||||||||||||||
| 2919 | void QApplication::setDoubleClickInterval(int ms) | - | ||||||||||||||||||||||||
| 2920 | { | - | ||||||||||||||||||||||||
| 2921 | QGuiApplication::styleHints()->setMouseDoubleClickInterval(ms); | - | ||||||||||||||||||||||||
| 2922 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2923 | - | |||||||||||||||||||||||||
| 2924 | int QApplication::doubleClickInterval() | - | ||||||||||||||||||||||||
| 2925 | { | - | ||||||||||||||||||||||||
| 2926 | return never executed: QGuiApplication::styleHints()->mouseDoubleClickInterval();return QGuiApplication::styleHints()->mouseDoubleClickInterval();never executed: return QGuiApplication::styleHints()->mouseDoubleClickInterval(); | 0 | ||||||||||||||||||||||||
| 2927 | } | - | ||||||||||||||||||||||||
| 2928 | void QApplication::setKeyboardInputInterval(int ms) | - | ||||||||||||||||||||||||
| 2929 | { | - | ||||||||||||||||||||||||
| 2930 | QGuiApplication::styleHints()->setKeyboardInputInterval(ms); | - | ||||||||||||||||||||||||
| 2931 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2932 | - | |||||||||||||||||||||||||
| 2933 | int QApplication::keyboardInputInterval() | - | ||||||||||||||||||||||||
| 2934 | { | - | ||||||||||||||||||||||||
| 2935 | return never executed: QGuiApplication::styleHints()->keyboardInputInterval();return QGuiApplication::styleHints()->keyboardInputInterval();never executed: return QGuiApplication::styleHints()->keyboardInputInterval(); | 0 | ||||||||||||||||||||||||
| 2936 | } | - | ||||||||||||||||||||||||
| 2937 | int QApplication::wheelScrollLines() | - | ||||||||||||||||||||||||
| 2938 | { | - | ||||||||||||||||||||||||
| 2939 | return never executed: QApplicationPrivate::wheel_scroll_lines;return QApplicationPrivate::wheel_scroll_lines;never executed: return QApplicationPrivate::wheel_scroll_lines; | 0 | ||||||||||||||||||||||||
| 2940 | } | - | ||||||||||||||||||||||||
| 2941 | - | |||||||||||||||||||||||||
| 2942 | void QApplication::setWheelScrollLines(int lines) | - | ||||||||||||||||||||||||
| 2943 | { | - | ||||||||||||||||||||||||
| 2944 | QApplicationPrivate::wheel_scroll_lines = lines; | - | ||||||||||||||||||||||||
| 2945 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2946 | - | |||||||||||||||||||||||||
| 2947 | - | |||||||||||||||||||||||||
| 2948 | static inline int uiEffectToFlag(Qt::UIEffect effect) | - | ||||||||||||||||||||||||
| 2949 | { | - | ||||||||||||||||||||||||
| 2950 | switch (effect) { | - | ||||||||||||||||||||||||
| 2951 | case never executed: Qt::UI_General:case Qt::UI_General:never executed: case Qt::UI_General: | 0 | ||||||||||||||||||||||||
| 2952 | return never executed: QPlatformTheme::GeneralUiEffect;return QPlatformTheme::GeneralUiEffect;never executed: return QPlatformTheme::GeneralUiEffect; | 0 | ||||||||||||||||||||||||
| 2953 | case never executed: Qt::UI_AnimateMenu:case Qt::UI_AnimateMenu:never executed: case Qt::UI_AnimateMenu: | 0 | ||||||||||||||||||||||||
| 2954 | return never executed: QPlatformTheme::AnimateMenuUiEffect;return QPlatformTheme::AnimateMenuUiEffect;never executed: return QPlatformTheme::AnimateMenuUiEffect; | 0 | ||||||||||||||||||||||||
| 2955 | case never executed: Qt::UI_FadeMenu:case Qt::UI_FadeMenu:never executed: case Qt::UI_FadeMenu: | 0 | ||||||||||||||||||||||||
| 2956 | return never executed: QPlatformTheme::FadeMenuUiEffect;return QPlatformTheme::FadeMenuUiEffect;never executed: return QPlatformTheme::FadeMenuUiEffect; | 0 | ||||||||||||||||||||||||
| 2957 | case never executed: Qt::UI_AnimateCombo:case Qt::UI_AnimateCombo:never executed: case Qt::UI_AnimateCombo: | 0 | ||||||||||||||||||||||||
| 2958 | return never executed: QPlatformTheme::AnimateComboUiEffect;return QPlatformTheme::AnimateComboUiEffect;never executed: return QPlatformTheme::AnimateComboUiEffect; | 0 | ||||||||||||||||||||||||
| 2959 | case never executed: Qt::UI_AnimateTooltip:case Qt::UI_AnimateTooltip:never executed: case Qt::UI_AnimateTooltip: | 0 | ||||||||||||||||||||||||
| 2960 | return never executed: QPlatformTheme::AnimateTooltipUiEffect;return QPlatformTheme::AnimateTooltipUiEffect;never executed: return QPlatformTheme::AnimateTooltipUiEffect; | 0 | ||||||||||||||||||||||||
| 2961 | case never executed: Qt::UI_FadeTooltip:case Qt::UI_FadeTooltip:never executed: case Qt::UI_FadeTooltip: | 0 | ||||||||||||||||||||||||
| 2962 | return never executed: QPlatformTheme::FadeTooltipUiEffect;return QPlatformTheme::FadeTooltipUiEffect;never executed: return QPlatformTheme::FadeTooltipUiEffect; | 0 | ||||||||||||||||||||||||
| 2963 | case never executed: Qt::UI_AnimateToolBox:case Qt::UI_AnimateToolBox:never executed: case Qt::UI_AnimateToolBox: | 0 | ||||||||||||||||||||||||
| 2964 | return never executed: QPlatformTheme::AnimateToolBoxUiEffect;return QPlatformTheme::AnimateToolBoxUiEffect;never executed: return QPlatformTheme::AnimateToolBoxUiEffect; | 0 | ||||||||||||||||||||||||
| 2965 | } | - | ||||||||||||||||||||||||
| 2966 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 2967 | } | - | ||||||||||||||||||||||||
| 2968 | void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) | - | ||||||||||||||||||||||||
| 2969 | { | - | ||||||||||||||||||||||||
| 2970 | int effectFlags = uiEffectToFlag(effect); | - | ||||||||||||||||||||||||
| 2971 | if (enable
| 0 | ||||||||||||||||||||||||
| 2972 | if (effectFlags & QPlatformTheme::FadeMenuUiEffect
| 0 | ||||||||||||||||||||||||
| 2973 | effectFlags |= QPlatformTheme::AnimateMenuUiEffect; never executed: effectFlags |= QPlatformTheme::AnimateMenuUiEffect; | 0 | ||||||||||||||||||||||||
| 2974 | if (effectFlags & QPlatformTheme::FadeTooltipUiEffect
| 0 | ||||||||||||||||||||||||
| 2975 | effectFlags |= QPlatformTheme::AnimateTooltipUiEffect; never executed: effectFlags |= QPlatformTheme::AnimateTooltipUiEffect; | 0 | ||||||||||||||||||||||||
| 2976 | QApplicationPrivate::enabledAnimations |= effectFlags; | - | ||||||||||||||||||||||||
| 2977 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2978 | QApplicationPrivate::enabledAnimations &= ~effectFlags; | - | ||||||||||||||||||||||||
| 2979 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2980 | } | - | ||||||||||||||||||||||||
| 2981 | bool QApplication::isEffectEnabled(Qt::UIEffect effect) | - | ||||||||||||||||||||||||
| 2982 | { | - | ||||||||||||||||||||||||
| 2983 | if (__builtin_expect(!!(QCoreApplication::instance()), true)
never executed: else { QMessageLogger(__FILE__, 4197, __PRETTY_FUNCTION__).warning("Must construct a QApplication first."); returnend of blocknever executed: false;return false;never executed: }return false; | 0 | ||||||||||||||||||||||||
| 2984 | return never executed: QColormap::instance().depth() >= 16return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));never executed: return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect)); | 0 | ||||||||||||||||||||||||
| 2985 | && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) never executed: return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect)); | 0 | ||||||||||||||||||||||||
| 2986 | && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect)); never executed: return QColormap::instance().depth() >= 16 && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect) && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect)); | 0 | ||||||||||||||||||||||||
| 2987 | } | - | ||||||||||||||||||||||||
| 2988 | - | |||||||||||||||||||||||||
| 2989 | - | |||||||||||||||||||||||||
| 2990 | - | |||||||||||||||||||||||||
| 2991 | - | |||||||||||||||||||||||||
| 2992 | - | |||||||||||||||||||||||||
| 2993 | - | |||||||||||||||||||||||||
| 2994 | - | |||||||||||||||||||||||||
| 2995 | void QApplication::beep() | - | ||||||||||||||||||||||||
| 2996 | { | - | ||||||||||||||||||||||||
| 2997 | QGuiApplicationPrivate::platformIntegration()->beep(); | - | ||||||||||||||||||||||||
| 2998 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2999 | bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event) | - | ||||||||||||||||||||||||
| 3000 | { | - | ||||||||||||||||||||||||
| 3001 | return never executed: QGuiApplication::sendSpontaneousEvent(receiver, event);return QGuiApplication::sendSpontaneousEvent(receiver, event);never executed: return QGuiApplication::sendSpontaneousEvent(receiver, event); | 0 | ||||||||||||||||||||||||
| 3002 | } | - | ||||||||||||||||||||||||
| 3003 | - | |||||||||||||||||||||||||
| 3004 | void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget, QEvent *event, QPoint localPos) | - | ||||||||||||||||||||||||
| 3005 | { | - | ||||||||||||||||||||||||
| 3006 | const bool setFocusOnRelease = QGuiApplication::styleHints()->setFocusOnTouchRelease(); | - | ||||||||||||||||||||||||
| 3007 | Qt::FocusPolicy focusPolicy = Qt::ClickFocus; | - | ||||||||||||||||||||||||
| 3008 | static QPointer<QWidget> focusedWidgetOnTouchBegin = 0; | - | ||||||||||||||||||||||||
| 3009 | - | |||||||||||||||||||||||||
| 3010 | switch (event->type()) { | - | ||||||||||||||||||||||||
| 3011 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress:never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
| 3012 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick:never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||
| 3013 | case never executed: QEvent::TouchBegin:case QEvent::TouchBegin:never executed: case QEvent::TouchBegin: | 0 | ||||||||||||||||||||||||
| 3014 | focusedWidgetOnTouchBegin = QApplication::focusWidget(); | - | ||||||||||||||||||||||||
| 3015 | if (setFocusOnRelease
| 0 | ||||||||||||||||||||||||
| 3016 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3017 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3018 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
| 3019 | case never executed: QEvent::TouchEnd:case QEvent::TouchEnd:never executed: case QEvent::TouchEnd: | 0 | ||||||||||||||||||||||||
| 3020 | if (!setFocusOnRelease
| 0 | ||||||||||||||||||||||||
| 3021 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3022 | if (focusedWidgetOnTouchBegin != QApplication::focusWidget()
| 0 | ||||||||||||||||||||||||
| 3023 | - | |||||||||||||||||||||||||
| 3024 | - | |||||||||||||||||||||||||
| 3025 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3026 | } | - | ||||||||||||||||||||||||
| 3027 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3028 | case never executed: QEvent::Wheel:case QEvent::Wheel:never executed: case QEvent::Wheel: | 0 | ||||||||||||||||||||||||
| 3029 | focusPolicy = Qt::WheelFocus; | - | ||||||||||||||||||||||||
| 3030 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3031 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 3032 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3033 | } | - | ||||||||||||||||||||||||
| 3034 | - | |||||||||||||||||||||||||
| 3035 | QWidget *focusWidget = widget; | - | ||||||||||||||||||||||||
| 3036 | while (focusWidget
| 0 | ||||||||||||||||||||||||
| 3037 | if (focusWidget->isEnabled()
| 0 | ||||||||||||||||||||||||
| 3038 | && focusWidget->rect().contains(localPos)
| 0 | ||||||||||||||||||||||||
| 3039 | && QApplicationPrivate::shouldSetFocus(focusWidget, focusPolicy)
| 0 | ||||||||||||||||||||||||
| 3040 | focusWidget->setFocus(Qt::MouseFocusReason); | - | ||||||||||||||||||||||||
| 3041 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3042 | } | - | ||||||||||||||||||||||||
| 3043 | if (focusWidget->isWindow()
| 0 | ||||||||||||||||||||||||
| 3044 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3045 | - | |||||||||||||||||||||||||
| 3046 | - | |||||||||||||||||||||||||
| 3047 | QWidget *f = focusWidget; | - | ||||||||||||||||||||||||
| 3048 | if (focusWidget->d_func()->extra
| 0 | ||||||||||||||||||||||||
| 3049 | f = focusWidget->d_func()->extra->focus_proxy; never executed: f = focusWidget->d_func()->extra->focus_proxy; | 0 | ||||||||||||||||||||||||
| 3050 | - | |||||||||||||||||||||||||
| 3051 | - | |||||||||||||||||||||||||
| 3052 | if (f->hasFocus()
| 0 | ||||||||||||||||||||||||
| 3053 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3054 | - | |||||||||||||||||||||||||
| 3055 | localPos += focusWidget->pos(); | - | ||||||||||||||||||||||||
| 3056 | focusWidget = focusWidget->parentWidget(); | - | ||||||||||||||||||||||||
| 3057 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3058 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3059 | - | |||||||||||||||||||||||||
| 3060 | bool QApplicationPrivate::shouldSetFocus(QWidget *w, Qt::FocusPolicy policy) | - | ||||||||||||||||||||||||
| 3061 | { | - | ||||||||||||||||||||||||
| 3062 | QWidget *f = w; | - | ||||||||||||||||||||||||
| 3063 | while (f->d_func()->extra
| 0 | ||||||||||||||||||||||||
| 3064 | f = f->d_func()->extra->focus_proxy; never executed: f = f->d_func()->extra->focus_proxy; | 0 | ||||||||||||||||||||||||
| 3065 | - | |||||||||||||||||||||||||
| 3066 | if ((
| 0 | ||||||||||||||||||||||||
| 3067 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3068 | if (w != f
| 0 | ||||||||||||||||||||||||
| 3069 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3070 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 3071 | } | - | ||||||||||||||||||||||||
| 3072 | - | |||||||||||||||||||||||||
| 3073 | bool QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent) | - | ||||||||||||||||||||||||
| 3074 | { | - | ||||||||||||||||||||||||
| 3075 | bool containsPress = false; | - | ||||||||||||||||||||||||
| 3076 | for (int i = 0; i < touchEvent->touchPoints().count()
| 0 | ||||||||||||||||||||||||
| 3077 | QTouchEvent::TouchPoint &touchPoint = touchEvent->_touchPoints[i]; | - | ||||||||||||||||||||||||
| 3078 | - | |||||||||||||||||||||||||
| 3079 | - | |||||||||||||||||||||||||
| 3080 | QRectF rect = touchPoint.screenRect(); | - | ||||||||||||||||||||||||
| 3081 | const QPointF screenPos = rect.center(); | - | ||||||||||||||||||||||||
| 3082 | const QPointF delta = screenPos - screenPos.toPoint(); | - | ||||||||||||||||||||||||
| 3083 | - | |||||||||||||||||||||||||
| 3084 | rect.moveCenter(widget->mapFromGlobal(screenPos.toPoint()) + delta); | - | ||||||||||||||||||||||||
| 3085 | touchPoint.d->rect = rect; | - | ||||||||||||||||||||||||
| 3086 | touchPoint.d->startPos = widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta; | - | ||||||||||||||||||||||||
| 3087 | touchPoint.d->lastPos = widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta; | - | ||||||||||||||||||||||||
| 3088 | - | |||||||||||||||||||||||||
| 3089 | if (touchPoint.state() == Qt::TouchPointPressed
| 0 | ||||||||||||||||||||||||
| 3090 | containsPress = true; never executed: containsPress = true; | 0 | ||||||||||||||||||||||||
| 3091 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3092 | return never executed: containsPress;return containsPress;never executed: return containsPress; | 0 | ||||||||||||||||||||||||
| 3093 | } | - | ||||||||||||||||||||||||
| 3094 | - | |||||||||||||||||||||||||
| 3095 | void QApplicationPrivate::initializeMultitouch() | - | ||||||||||||||||||||||||
| 3096 | { | - | ||||||||||||||||||||||||
| 3097 | initializeMultitouch_sys(); | - | ||||||||||||||||||||||||
| 3098 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3099 | - | |||||||||||||||||||||||||
| 3100 | void QApplicationPrivate::initializeMultitouch_sys() | - | ||||||||||||||||||||||||
| 3101 | { | - | ||||||||||||||||||||||||
| 3102 | } | - | ||||||||||||||||||||||||
| 3103 | - | |||||||||||||||||||||||||
| 3104 | void QApplicationPrivate::cleanupMultitouch() | - | ||||||||||||||||||||||||
| 3105 | { | - | ||||||||||||||||||||||||
| 3106 | cleanupMultitouch_sys(); | - | ||||||||||||||||||||||||
| 3107 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3108 | - | |||||||||||||||||||||||||
| 3109 | void QApplicationPrivate::cleanupMultitouch_sys() | - | ||||||||||||||||||||||||
| 3110 | { | - | ||||||||||||||||||||||||
| 3111 | } | - | ||||||||||||||||||||||||
| 3112 | - | |||||||||||||||||||||||||
| 3113 | QWidget *QApplicationPrivate::findClosestTouchPointTarget(QTouchDevice *device, const QTouchEvent::TouchPoint &touchPoint) | - | ||||||||||||||||||||||||
| 3114 | { | - | ||||||||||||||||||||||||
| 3115 | const QPointF screenPos = touchPoint.screenPos(); | - | ||||||||||||||||||||||||
| 3116 | int closestTouchPointId = -1; | - | ||||||||||||||||||||||||
| 3117 | QObject *closestTarget = 0; | - | ||||||||||||||||||||||||
| 3118 | qreal closestDistance = qreal(0.); | - | ||||||||||||||||||||||||
| 3119 | QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it = activeTouchPoints.constBegin(), | - | ||||||||||||||||||||||||
| 3120 | ite = activeTouchPoints.constEnd(); | - | ||||||||||||||||||||||||
| 3121 | while (it != ite
| 0 | ||||||||||||||||||||||||
| 3122 | if (it.key().device == device
| 0 | ||||||||||||||||||||||||
| 3123 | const QTouchEvent::TouchPoint &touchPoint = it->touchPoint; | - | ||||||||||||||||||||||||
| 3124 | qreal dx = screenPos.x() - touchPoint.screenPos().x(); | - | ||||||||||||||||||||||||
| 3125 | qreal dy = screenPos.y() - touchPoint.screenPos().y(); | - | ||||||||||||||||||||||||
| 3126 | qreal distance = dx * dx + dy * dy; | - | ||||||||||||||||||||||||
| 3127 | if (closestTouchPointId == -1
| 0 | ||||||||||||||||||||||||
| 3128 | closestTouchPointId = touchPoint.id(); | - | ||||||||||||||||||||||||
| 3129 | closestDistance = distance; | - | ||||||||||||||||||||||||
| 3130 | closestTarget = it.value().target.data(); | - | ||||||||||||||||||||||||
| 3131 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3132 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3133 | ++it; | - | ||||||||||||||||||||||||
| 3134 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3135 | return never executed: static_cast<QWidget *>(closestTarget);return static_cast<QWidget *>(closestTarget);never executed: return static_cast<QWidget *>(closestTarget); | 0 | ||||||||||||||||||||||||
| 3136 | } | - | ||||||||||||||||||||||||
| 3137 | - | |||||||||||||||||||||||||
| 3138 | void QApplicationPrivate::activateImplicitTouchGrab(QWidget *widget, QTouchEvent *touchEvent) | - | ||||||||||||||||||||||||
| 3139 | { | - | ||||||||||||||||||||||||
| 3140 | if (touchEvent->type() != QEvent::TouchBegin
| 0 | ||||||||||||||||||||||||
| 3141 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 3142 | - | |||||||||||||||||||||||||
| 3143 | for (int i = 0, tc = touchEvent->touchPoints().count(); i < tc
| 0 | ||||||||||||||||||||||||
| 3144 | const QTouchEvent::TouchPoint &touchPoint = touchEvent->touchPoints().at(i); | - | ||||||||||||||||||||||||
| 3145 | activeTouchPoints[QGuiApplicationPrivate::ActiveTouchPointsKey(touchEvent->device(), touchPoint.id())].target = widget; | - | ||||||||||||||||||||||||
| 3146 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3147 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3148 | - | |||||||||||||||||||||||||
| 3149 | bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, | - | ||||||||||||||||||||||||
| 3150 | QTouchDevice *device, | - | ||||||||||||||||||||||||
| 3151 | const QList<QTouchEvent::TouchPoint> &touchPoints, | - | ||||||||||||||||||||||||
| 3152 | ulong timestamp) | - | ||||||||||||||||||||||||
| 3153 | { | - | ||||||||||||||||||||||||
| 3154 | QApplicationPrivate *d = self; | - | ||||||||||||||||||||||||
| 3155 | typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; | - | ||||||||||||||||||||||||
| 3156 | QHash<QWidget *, StatesAndTouchPoints> widgetsNeedingEvents; | - | ||||||||||||||||||||||||
| 3157 | - | |||||||||||||||||||||||||
| 3158 | for (int i = 0; i < touchPoints.count()
| 0 | ||||||||||||||||||||||||
| 3159 | QTouchEvent::TouchPoint touchPoint = touchPoints.at(i); | - | ||||||||||||||||||||||||
| 3160 | - | |||||||||||||||||||||||||
| 3161 | - | |||||||||||||||||||||||||
| 3162 | - | |||||||||||||||||||||||||
| 3163 | touchPoint.d = touchPoint.d->detach(); | - | ||||||||||||||||||||||||
| 3164 | - | |||||||||||||||||||||||||
| 3165 | - | |||||||||||||||||||||||||
| 3166 | QPointer<QObject> target; | - | ||||||||||||||||||||||||
| 3167 | ActiveTouchPointsKey touchInfoKey(device, touchPoint.id()); | - | ||||||||||||||||||||||||
| 3168 | ActiveTouchPointsValue &touchInfo = d->activeTouchPoints[touchInfoKey]; | - | ||||||||||||||||||||||||
| 3169 | if (touchPoint.state() == Qt::TouchPointPressed
| 0 | ||||||||||||||||||||||||
| 3170 | if (device->type() == QTouchDevice::TouchPad
| 0 | ||||||||||||||||||||||||
| 3171 | - | |||||||||||||||||||||||||
| 3172 | target = d->activeTouchPoints.isEmpty()
| 0 | ||||||||||||||||||||||||
| 3173 | ? QPointer<QObject>() | - | ||||||||||||||||||||||||
| 3174 | : d->activeTouchPoints.constBegin().value().target; | - | ||||||||||||||||||||||||
| 3175 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3176 | - | |||||||||||||||||||||||||
| 3177 | if (!target
| 0 | ||||||||||||||||||||||||
| 3178 | - | |||||||||||||||||||||||||
| 3179 | if (!window
| 0 | ||||||||||||||||||||||||
| 3180 | window = QApplication::topLevelAt(touchPoint.screenPos().toPoint()); never executed: window = QApplication::topLevelAt(touchPoint.screenPos().toPoint()); | 0 | ||||||||||||||||||||||||
| 3181 | if (!window
| 0 | ||||||||||||||||||||||||
| 3182 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 3183 | target = window->childAt(window->mapFromGlobal(touchPoint.screenPos().toPoint())); | - | ||||||||||||||||||||||||
| 3184 | if (!target
| 0 | ||||||||||||||||||||||||
| 3185 | target = window; never executed: target = window; | 0 | ||||||||||||||||||||||||
| 3186 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3187 | - | |||||||||||||||||||||||||
| 3188 | if (device->type() == QTouchDevice::TouchScreen
| 0 | ||||||||||||||||||||||||
| 3189 | QWidget *closestWidget = d->findClosestTouchPointTarget(device, touchPoint); | - | ||||||||||||||||||||||||
| 3190 | QWidget *widget = static_cast<QWidget *>(target.data()); | - | ||||||||||||||||||||||||
| 3191 | if (closestWidget
| 0 | ||||||||||||||||||||||||
| 3192 | && (widget->isAncestorOf(closestWidget)
| 0 | ||||||||||||||||||||||||
| 3193 | target = closestWidget; | - | ||||||||||||||||||||||||
| 3194 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3195 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3196 | - | |||||||||||||||||||||||||
| 3197 | touchInfo.target = target; | - | ||||||||||||||||||||||||
| 3198 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 3199 | target = touchInfo.target; | - | ||||||||||||||||||||||||
| 3200 | if (!target
| 0 | ||||||||||||||||||||||||
| 3201 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 3202 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3203 | ((!(target.data() != 0)) ? qt_assert("target.data() != 0",__FILE__,4437) : qt_noop()); | - | ||||||||||||||||||||||||
| 3204 | - | |||||||||||||||||||||||||
| 3205 | QWidget *targetWidget = static_cast<QWidget *>(target.data()); | - | ||||||||||||||||||||||||
| 3206 | StatesAndTouchPoints &maskAndPoints = widgetsNeedingEvents[targetWidget]; | - | ||||||||||||||||||||||||
| 3207 | maskAndPoints.first |= touchPoint.state(); | - | ||||||||||||||||||||||||
| 3208 | maskAndPoints.second.append(touchPoint); | - | ||||||||||||||||||||||||
| 3209 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3210 | - | |||||||||||||||||||||||||
| 3211 | if (widgetsNeedingEvents.isEmpty()
| 0 | ||||||||||||||||||||||||
| 3212 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3213 | - | |||||||||||||||||||||||||
| 3214 | bool accepted = false; | - | ||||||||||||||||||||||||
| 3215 | QHash<QWidget *, StatesAndTouchPoints>::ConstIterator it = widgetsNeedingEvents.constBegin(); | - | ||||||||||||||||||||||||
| 3216 | const QHash<QWidget *, StatesAndTouchPoints>::ConstIterator end = widgetsNeedingEvents.constEnd(); | - | ||||||||||||||||||||||||
| 3217 | for (; it != end
| 0 | ||||||||||||||||||||||||
| 3218 | const QPointer<QWidget> widget = it.key(); | - | ||||||||||||||||||||||||
| 3219 | if (!QApplicationPrivate::tryModalHelper(widget, 0)
| 0 | ||||||||||||||||||||||||
| 3220 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 3221 | - | |||||||||||||||||||||||||
| 3222 | QEvent::Type eventType; | - | ||||||||||||||||||||||||
| 3223 | switch (it.value().first) { | - | ||||||||||||||||||||||||
| 3224 | case never executed: Qt::TouchPointPressed:case Qt::TouchPointPressed:never executed: case Qt::TouchPointPressed: | 0 | ||||||||||||||||||||||||
| 3225 | eventType = QEvent::TouchBegin; | - | ||||||||||||||||||||||||
| 3226 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3227 | case never executed: Qt::TouchPointReleased:case Qt::TouchPointReleased:never executed: case Qt::TouchPointReleased: | 0 | ||||||||||||||||||||||||
| 3228 | eventType = QEvent::TouchEnd; | - | ||||||||||||||||||||||||
| 3229 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3230 | case never executed: Qt::TouchPointStationary:case Qt::TouchPointStationary:never executed: case Qt::TouchPointStationary: | 0 | ||||||||||||||||||||||||
| 3231 | - | |||||||||||||||||||||||||
| 3232 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 3233 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 3234 | eventType = QEvent::TouchUpdate; | - | ||||||||||||||||||||||||
| 3235 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3236 | } | - | ||||||||||||||||||||||||
| 3237 | - | |||||||||||||||||||||||||
| 3238 | QTouchEvent touchEvent(eventType, | - | ||||||||||||||||||||||||
| 3239 | device, | - | ||||||||||||||||||||||||
| 3240 | QApplication::keyboardModifiers(), | - | ||||||||||||||||||||||||
| 3241 | it.value().first, | - | ||||||||||||||||||||||||
| 3242 | it.value().second); | - | ||||||||||||||||||||||||
| 3243 | bool containsPress = updateTouchPointsForWidget(widget, &touchEvent); | - | ||||||||||||||||||||||||
| 3244 | touchEvent.setTimestamp(timestamp); | - | ||||||||||||||||||||||||
| 3245 | touchEvent.setWindow(window->windowHandle()); | - | ||||||||||||||||||||||||
| 3246 | touchEvent.setTarget(widget); | - | ||||||||||||||||||||||||
| 3247 | - | |||||||||||||||||||||||||
| 3248 | if (containsPress
| 0 | ||||||||||||||||||||||||
| 3249 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); never executed: widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); | 0 | ||||||||||||||||||||||||
| 3250 | - | |||||||||||||||||||||||||
| 3251 | switch (touchEvent.type()) { | - | ||||||||||||||||||||||||
| 3252 | case never executed: QEvent::TouchBegin:case QEvent::TouchBegin:never executed: case QEvent::TouchBegin: | 0 | ||||||||||||||||||||||||
| 3253 | { | - | ||||||||||||||||||||||||
| 3254 | - | |||||||||||||||||||||||||
| 3255 | - | |||||||||||||||||||||||||
| 3256 | if (QApplication::sendSpontaneousEvent(widget, &touchEvent)
| 0 | ||||||||||||||||||||||||
| 3257 | accepted = true; | - | ||||||||||||||||||||||||
| 3258 | if (!widget.isNull()
| 0 | ||||||||||||||||||||||||
| 3259 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); never executed: widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); | 0 | ||||||||||||||||||||||||
| 3260 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3261 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3262 | } | - | ||||||||||||||||||||||||
| 3263 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 3264 | if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)
| 0 | ||||||||||||||||||||||||
| 3265 | - | |||||||||||||||||||||||||
| 3266 | || QGestureManager::gesturePending(widget)
| 0 | ||||||||||||||||||||||||
| 3267 | - | |||||||||||||||||||||||||
| 3268 | ) { | - | ||||||||||||||||||||||||
| 3269 | if (QApplication::sendSpontaneousEvent(widget, &touchEvent)
| 0 | ||||||||||||||||||||||||
| 3270 | accepted = true; never executed: accepted = true; | 0 | ||||||||||||||||||||||||
| 3271 | - | |||||||||||||||||||||||||
| 3272 | if (touchEvent.type() == QEvent::TouchEnd
| 0 | ||||||||||||||||||||||||
| 3273 | widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); never executed: widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); | 0 | ||||||||||||||||||||||||
| 3274 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3275 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3276 | } | - | ||||||||||||||||||||||||
| 3277 | } | - | ||||||||||||||||||||||||
| 3278 | return never executed: accepted;return accepted;never executed: return accepted; | 0 | ||||||||||||||||||||||||
| 3279 | } | - | ||||||||||||||||||||||||
| 3280 | - | |||||||||||||||||||||||||
| 3281 | void QApplicationPrivate::translateTouchCancel(QTouchDevice *device, ulong timestamp) | - | ||||||||||||||||||||||||
| 3282 | { | - | ||||||||||||||||||||||||
| 3283 | QTouchEvent touchEvent(QEvent::TouchCancel, device, QApplication::keyboardModifiers()); | - | ||||||||||||||||||||||||
| 3284 | touchEvent.setTimestamp(timestamp); | - | ||||||||||||||||||||||||
| 3285 | QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it | - | ||||||||||||||||||||||||
| 3286 | = self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd(); | - | ||||||||||||||||||||||||
| 3287 | QSet<QWidget *> widgetsNeedingCancel; | - | ||||||||||||||||||||||||
| 3288 | while (it != ite
| 0 | ||||||||||||||||||||||||
| 3289 | QWidget *widget = static_cast<QWidget *>(it->target.data()); | - | ||||||||||||||||||||||||
| 3290 | if (widget
| 0 | ||||||||||||||||||||||||
| 3291 | widgetsNeedingCancel.insert(widget); never executed: widgetsNeedingCancel.insert(widget); | 0 | ||||||||||||||||||||||||
| 3292 | ++it; | - | ||||||||||||||||||||||||
| 3293 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3294 | for (QSet<QWidget *>::const_iterator widIt = widgetsNeedingCancel.constBegin(), | - | ||||||||||||||||||||||||
| 3295 | widItEnd = widgetsNeedingCancel.constEnd(); widIt != widItEnd
| 0 | ||||||||||||||||||||||||
| 3296 | QWidget *widget = *widIt; | - | ||||||||||||||||||||||||
| 3297 | touchEvent.setWindow(widget->windowHandle()); | - | ||||||||||||||||||||||||
| 3298 | touchEvent.setTarget(widget); | - | ||||||||||||||||||||||||
| 3299 | QApplication::sendSpontaneousEvent(widget, &touchEvent); | - | ||||||||||||||||||||||||
| 3300 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3301 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3302 | - | |||||||||||||||||||||||||
| 3303 | void QApplicationPrivate::notifyThemeChanged() | - | ||||||||||||||||||||||||
| 3304 | { | - | ||||||||||||||||||||||||
| 3305 | QGuiApplicationPrivate::notifyThemeChanged(); | - | ||||||||||||||||||||||||
| 3306 | clearSystemPalette(); | - | ||||||||||||||||||||||||
| 3307 | initSystemPalette(); | - | ||||||||||||||||||||||||
| 3308 | qt_init_tooltip_palette(); | - | ||||||||||||||||||||||||
| 3309 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3310 | - | |||||||||||||||||||||||||
| 3311 | - | |||||||||||||||||||||||||
| 3312 | void QApplicationPrivate::notifyDragStarted(const QDrag *drag) | - | ||||||||||||||||||||||||
| 3313 | { | - | ||||||||||||||||||||||||
| 3314 | - | |||||||||||||||||||||||||
| 3315 | QGuiApplicationPrivate::notifyDragStarted(drag); | - | ||||||||||||||||||||||||
| 3316 | qt_button_down = 0; | - | ||||||||||||||||||||||||
| 3317 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3318 | - | |||||||||||||||||||||||||
| 3319 | - | |||||||||||||||||||||||||
| 3320 | - | |||||||||||||||||||||||||
| 3321 | QGestureManager* QGestureManager::instance() | - | ||||||||||||||||||||||||
| 3322 | { | - | ||||||||||||||||||||||||
| 3323 | QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); | - | ||||||||||||||||||||||||
| 3324 | if (!qAppPriv
| 0 | ||||||||||||||||||||||||
| 3325 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 3326 | if (!qAppPriv->gestureManager
| 0 | ||||||||||||||||||||||||
| 3327 | qAppPriv->gestureManager = new QGestureManager((static_cast<QApplication *>(QCoreApplication::instance()))); never executed: qAppPriv->gestureManager = new QGestureManager((static_cast<QApplication *>(QCoreApplication::instance()))); | 0 | ||||||||||||||||||||||||
| 3328 | return never executed: qAppPriv->gestureManager;return qAppPriv->gestureManager;never executed: return qAppPriv->gestureManager; | 0 | ||||||||||||||||||||||||
| 3329 | } | - | ||||||||||||||||||||||||
| 3330 | - | |||||||||||||||||||||||||
| 3331 | - | |||||||||||||||||||||||||
| 3332 | QPixmap QApplicationPrivate::applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const | - | ||||||||||||||||||||||||
| 3333 | { | - | ||||||||||||||||||||||||
| 3334 | QStyleOption opt(0); | - | ||||||||||||||||||||||||
| 3335 | opt.palette = QGuiApplication::palette(); | - | ||||||||||||||||||||||||
| 3336 | return never executed: QApplication::style()->generatedIconPixmap(mode, base, &opt);return QApplication::style()->generatedIconPixmap(mode, base, &opt);never executed: return QApplication::style()->generatedIconPixmap(mode, base, &opt); | 0 | ||||||||||||||||||||||||
| 3337 | } | - | ||||||||||||||||||||||||
| 3338 | - | |||||||||||||||||||||||||
| 3339 | - | |||||||||||||||||||||||||
| 3340 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |