summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins.qnx@kdab.com>2012-09-25 16:46:56 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-03 13:51:43 +0200
commit9695df4d44b228e7e778ff17d5cccac30967b1fd (patch)
tree78a543ead0f23e084ef891cd8e4d0a2893844c98 /src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
parentc79f0f0fbaf9a1a177d771dc39eb209270c280ba (diff)
Introducing the PlatformPanel event type.
This event can be used by any platform plugin to implement special application panels/overlayed menus. Currently used by QNX only. This replaces sending fake Qt::Key_Menu presses in the QNX plugin. Qt::Key_Menu is already used when invoking context menus with the keyboard. Change-Id: I9c8f1743fd147a07c11883323800017376915ae1 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
index b42751676c..19fa9c5a9f 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
@@ -75,11 +75,16 @@ void QQnxNavigatorEventHandler::handleOrientationChange(int angle)
void QQnxNavigatorEventHandler::handleSwipeDown()
{
- // simulate menu key press
qNavigatorEventHandlerDebug() << Q_FUNC_INFO;
QWindow *w = QGuiApplication::focusWindow();
- QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyPress, Qt::Key_Menu, Qt::NoModifier);
- QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyRelease, Qt::Key_Menu, Qt::NoModifier);
+
+ if (w) {
+ // Get the top level window that is ancestor of the focus window
+ while (QWindow *parent = w->parent())
+ w = parent;
+
+ QWindowSystemInterface::handlePlatformPanelEvent(w);
+ }
}
void QQnxNavigatorEventHandler::handleExit()