diff options
author | Sergio Martins <sergio.martins.qnx@kdab.com> | 2012-09-25 16:46:56 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-03 13:51:43 +0200 |
commit | 9695df4d44b228e7e778ff17d5cccac30967b1fd (patch) | |
tree | 78a543ead0f23e084ef891cd8e4d0a2893844c98 /src/gui/kernel/qguiapplication.cpp | |
parent | c79f0f0fbaf9a1a177d771dc39eb209270c280ba (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/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 46e7334e37..7e7997d7eb 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1203,6 +1203,10 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv QGuiApplicationPrivate::processTabletLeaveProximityEvent( static_cast<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent *>(e)); break; + case QWindowSystemInterfacePrivate::PlatformPanel: + QGuiApplicationPrivate::processPlatformPanelEvent( + static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e)); + break; default: qWarning() << "Unknown user input event type:" << e->type; break; @@ -1617,6 +1621,20 @@ void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInter #endif } +void QGuiApplicationPrivate::processPlatformPanelEvent(QWindowSystemInterfacePrivate::PlatformPanelEvent *e) +{ + if (!e->window) + return; + + if (e->window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow events through + return; + } + + QEvent ev(QEvent::PlatformPanel); + QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev); +} + Q_GUI_EXPORT uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k) { return qHash(k.device) + k.touchPointId; |