diff options
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 82b9fec37f..500e812e28 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -65,6 +65,7 @@ #include <QtWidgets/qgraphicsproxywidget.h> #include <QtGui/qstylehints.h> #include <QtGui/qinputmethod.h> +#include <QtGui/private/qwindow_p.h> #include <qpa/qplatformtheme.h> #ifndef QT_NO_WHATSTHIS #include <QtWidgets/QWhatsThis> @@ -637,7 +638,7 @@ void QApplicationPrivate::initialize() qRegisterGuiStateMachine(); #endif - if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0) + if (qEnvironmentVariableIntValue("QT_USE_NATIVE_WINDOWS") > 0) QCoreApplication::setAttribute(Qt::AA_NativeWindows); #ifdef Q_OS_WINCE @@ -659,8 +660,12 @@ void QApplicationPrivate::initialize() initializeMultitouch(); if (QApplication::desktopSettingsAware()) - if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); +#ifndef QT_NO_WHEELEVENT + QApplicationPrivate::wheel_scroll_lines = theme->themeHint(QPlatformTheme::WheelScrollLines).toInt(); +#endif + } is_app_running = true; // no longer starting up } @@ -2511,7 +2516,7 @@ bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWin } QWidget *popupWidget = QApplication::activePopupWidget(); QWindow *popupWindow = popupWidget ? popupWidget->windowHandle() : 0; - if (popupWindow == window) { + if (popupWindow == window || (!popupWindow && QWindowPrivate::get(window)->isPopup())) { *blockingWindow = 0; return false; } @@ -3148,39 +3153,15 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } switch (e->type()) { - case QEvent::KeyPress: - { - bool isWidget = receiver->isWidgetType(); - bool isWindow = receiver->isWindowType(); - bool isGraphicsWidget = false; -#ifndef QT_NO_GRAPHICSVIEW - isGraphicsWidget = !isWidget && !isWindow && qobject_cast<QGraphicsWidget *>(receiver); -#endif - if (!isWidget && !isGraphicsWidget && !isWindow) { - return d->notify_helper(receiver, e); - } - - QKeyEvent* key = static_cast<QKeyEvent*>(e); -#ifndef QT_NO_SHORTCUT - // Try looking for a Shortcut before sending key events - QObject *shortcutReceiver = receiver; - if (!isWidget && isWindow) { - QWindow *w = qobject_cast<QWindow *>(receiver); - QObject *focus = w ? w->focusObject() : 0; - if (focus) - shortcutReceiver = focus; - } - if (qApp->d_func()->shortcutMap.tryShortcutEvent(shortcutReceiver, key)) - return true; -#endif - qt_in_tab_key_event = (key->key() == Qt::Key_Backtab - || key->key() == Qt::Key_Tab - || key->key() == Qt::Key_Left - || key->key() == Qt::Key_Up - || key->key() == Qt::Key_Right - || key->key() == Qt::Key_Down); - - } + case QEvent::KeyPress: { + int key = static_cast<QKeyEvent*>(e)->key(); + qt_in_tab_key_event = (key == Qt::Key_Backtab + || key == Qt::Key_Tab + || key == Qt::Key_Left + || key == Qt::Key_Up + || key == Qt::Key_Right + || key == Qt::Key_Down); + } default: break; } |