diff options
author | Liang Qi <liang.qi@qt.io> | 2018-05-08 20:43:45 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-05-08 20:43:45 +0200 |
commit | b5a956601f369e961d6863126f8facc61bb6df1f (patch) | |
tree | 25e4021518b254ef76c410244dd6581432bf285f /src/gui/kernel | |
parent | 290f953253afc5935382525cd4b72e091865cab5 (diff) | |
parent | 1b7337d23dbc767ba482d9051180f10d77052913 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro
Change-Id: I3169f709cc2a1b75007cb23c02c4c79b74feeb04
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qshortcutmap.cpp | 13 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 8e09c97806..3bb42c1c0b 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -661,10 +661,16 @@ void QShortcutMap::dispatchEvent(QKeyEvent *e) // Find next const QShortcutEntry *current = 0, *next = 0; int i = 0, enabledShortcuts = 0; +#if defined(DEBUG_QSHORTCUTMAP) + QVector<const QShortcutEntry*> ambiguousShortcuts; +#endif while(i < d->identicals.size()) { current = d->identicals.at(i); if (current->enabled || !next){ ++enabledShortcuts; +#if defined(DEBUG_QSHORTCUTMAP) + ambiguousShortcuts.append(current); +#endif if (enabledShortcuts > d->ambigCount + 1) break; next = current; @@ -678,6 +684,13 @@ void QShortcutMap::dispatchEvent(QKeyEvent *e) return; // Dispatch next enabled #if defined(DEBUG_QSHORTCUTMAP) + if (ambiguousShortcuts.size() > 1) { + qDebug() << "The following shortcuts are about to be activated ambiguously:"; + for (const QShortcutEntry *entry : qAsConst(ambiguousShortcuts)) { + qDebug().nospace() << "- " << entry->keyseq << " (belonging to " << entry->owner << ")"; + } + } + qDebug().nospace() << "QShortcutMap::dispatchEvent(): Sending QShortcutEvent(\"" << next->keyseq.toString() << "\", " << next->id << ", " diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index cf3d13e670..b0f09fcc3b 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -258,11 +258,12 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleWindowStateChanged, QWindow *window, Qt: QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e); } -void QWindowSystemInterface::handleWindowScreenChanged(QWindow *window, QScreen *screen) +QT_DEFINE_QPA_EVENT_HANDLER(void, handleWindowScreenChanged, QWindow *window, QScreen *screen) { + QWindowSystemInterfacePrivate::WindowScreenChangedEvent *e = new QWindowSystemInterfacePrivate::WindowScreenChangedEvent(window, screen); - QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); + QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e); } QT_DEFINE_QPA_EVENT_HANDLER(void, handleSafeAreaMarginsChanged, QWindow *window) diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index 16337e1986..ea01fa5c47 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -206,6 +206,7 @@ public: template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState = -1); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen); template<typename Delivery = QWindowSystemInterface::DefaultDelivery> |