From 35dcea3f7813c7aa5bdb6e85f6fa827fac741cb7 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 19 Aug 2009 13:14:02 +0300 Subject: Enabled contextmenu event for Symbian. In Symbian the context menu event is triggered after long press event is detected. This is equivalent to right mouse click on desktop environments. --- src/gui/kernel/qapplication_s60.cpp | 12 +++++++++--- src/gui/kernel/qt_s60_p.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 44ac380..00e16af 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -347,7 +347,13 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | Qt::RightButton; QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos, Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); - sendMouseEvent(alienWidget, &mEvent); + + bool res = sendMouseEvent(alienWidget, &mEvent); + +#if !defined(QT_NO_CONTEXTMENU) + QContextMenuEvent e2(QContextMenuEvent::Mouse, widgetPos, globalPos, mEvent.modifiers()); +#endif + m_previousEventLongTap = true; } @@ -444,9 +450,9 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent) } } -void QSymbianControl::sendMouseEvent(QWidget *widget, QMouseEvent *mEvent) +bool QSymbianControl::sendMouseEvent(QWidget *widget, QMouseEvent *mEvent) { - qt_sendSpontaneousEvent(widget, mEvent); + return qt_sendSpontaneousEvent(widget, mEvent); } TKeyResponse QSymbianControl::OfferKeyEventL(const TKeyEvent& keyEvent, TEventCode type) diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 1ac6a8e..4d05f11 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -153,7 +153,7 @@ private: void HandlePointerEvent(const TPointerEvent& aPointerEvent); TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType); TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent); - void sendMouseEvent(QWidget *widget, QMouseEvent *mEvent); + bool sendMouseEvent(QWidget *widget, QMouseEvent *mEvent); void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); private: -- cgit v0.12