From 9b7fc15edf47885f9b2894e354790c47ecdb3886 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 13 Aug 2013 12:06:40 +0200 Subject: Implement support for global whatsthis on Windows Task-Number: QTBUG-32835 Change-Id: Ifee10d815ce0037c96eda574ab9e1af67ff6bd78 Reviewed-by: Andy Shaw --- src/gui/kernel/qguiapplication.cpp | 2 ++ src/gui/kernel/qwindowsysteminterface.cpp | 9 +++++++++ src/gui/kernel/qwindowsysteminterface.h | 3 +++ src/gui/kernel/qwindowsysteminterface_p.h | 1 + 4 files changed, 15 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c14c74f2c5..da3bc86433 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1480,6 +1480,8 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv static_cast(e)); break; #endif + case QWindowSystemInterfacePrivate::EnterWhatsThisMode: + QGuiApplication::postEvent(QGuiApplication::instance(), new QEvent(QEvent::EnterWhatsThisMode)); default: qWarning() << "Unknown user input event type:" << e->type; break; diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index b9912c1691..b094ccb33b 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -694,6 +694,15 @@ void QWindowSystemInterface::handleContextMenuEvent(QWindow *w, bool mouseTrigge } #endif +#ifndef QT_NO_WHATSTHIS +void QWindowSystemInterface::handleEnterWhatsThisEvent() +{ + QWindowSystemInterfacePrivate::WindowSystemEvent *e = + new QWindowSystemInterfacePrivate::WindowSystemEvent(QWindowSystemInterfacePrivate::EnterWhatsThisMode); + QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); +} +#endif + #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QWindowSystemInterface::TouchPoint &p) { dbg.nospace() << "TouchPoint(" << p.id << " @" << p.normalPosition << " press " << p.pressure << " vel " << p.velocity << " state " << (int)p.state; diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index bac5a570a9..f9efdbf8ce 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -184,6 +184,9 @@ public: const QPoint &pos, const QPoint &globalPos, Qt::KeyboardModifiers modifiers); #endif +#ifndef QT_NO_WHATSTHIS + static void handleEnterWhatsThisEvent(); +#endif // For event dispatcher implementations static bool sendWindowSystemEvents(QEventLoop::ProcessEventsFlags flags); diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index a40bf10293..7dbc3ad8ed 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -90,6 +90,7 @@ public: TabletLeaveProximity = UserInputEvent | 0x16, PlatformPanel = UserInputEvent | 0x17, ContextMenu = UserInputEvent | 0x18, + EnterWhatsThisMode = UserInputEvent | 0x19, ApplicationStateChanged = 0x19, FlushEvents = 0x20, WindowScreenChanged = 0x21 -- cgit v1.2.3