diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-10-22 14:43:38 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-25 10:08:04 +0200 |
commit | 9fc7fcb4c90f9fdc5bb3581609a1d5b01cfb7076 (patch) | |
tree | 205dd5103662563949f9bea6ca7c85aea905a33c /src/gui/kernel/qwindowsysteminterface_p.h | |
parent | 8e002f1c0e0e0605d6cdfb90cdf909035eb643c8 (diff) |
Add ContextMenu event to QWindowSystemInterface
Context menu key wasn't working, as QPA had no handling for it.
Added ContextMenu event to QWindowSystemInterface and proper handling
to QGuiApplication and QWidgetWindow.
Also provide Windows implementation.
Task-number: QTBUG-27648
Change-Id: I7ce71ec4b5cdcc7be758e67f9faf6d863f7b19be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface_p.h')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index 4e907f3f51..1b5351db71 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -77,7 +77,8 @@ public: Tablet, TabletEnterProximity, TabletLeaveProximity, - PlatformPanel + PlatformPanel, + ContextMenu }; class WindowSystemEvent { @@ -333,6 +334,21 @@ public: QPointer<QWindow> window; }; +#ifndef QT_NO_CONTEXTMENU + class ContextMenuEvent : public WindowSystemEvent { + public: + explicit ContextMenuEvent(QWindow *w, bool mouseTriggered, const QPoint &pos, + const QPoint &globalPos, Qt::KeyboardModifiers modifiers) + : WindowSystemEvent(ContextMenu), window(w), mouseTriggered(mouseTriggered), pos(pos), + globalPos(globalPos), modifiers(modifiers) { } + QPointer<QWindow> window; + bool mouseTriggered; + QPoint pos; // Only valid if triggered by mouse + QPoint globalPos; // Only valid if triggered by mouse + Qt::KeyboardModifiers modifiers; + }; +#endif + class WindowSystemEventList { QList<WindowSystemEvent *> impl; mutable QMutex mutex; |