[Qt][WK2] Event delivery in QDesktopWebView is broken after merge of Qt5 refactor
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 11:58:30 +0000 (11:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Sep 2011 11:58:30 +0000 (11:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69105

This changes QDesktopWebView and QDesktopWebPageProxy to use QMouseEvent instead
of QGraphicsSceneMouseEvent.
Further it removes an endless loop introduced by the QSGItem::event() function
delivering inputMethodEvents but no other events.

Patch by Zeno Albisser <zeno.albisser@nokia.com> on 2011-09-30
Reviewed by Andreas Kling.

* Shared/NativeWebMouseEvent.h:
(WebKit::NativeWebMouseEvent::nativeEvent):
* Shared/NativeWebWheelEvent.h:
(WebKit::NativeWebWheelEvent::nativeEvent):
* Shared/qt/NativeWebMouseEventQt.cpp:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
* Shared/qt/NativeWebWheelEventQt.cpp:
(WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
* Shared/qt/WebEventFactoryQt.cpp:
(WebKit::mouseButtonForEvent):
(WebKit::webEventTypeForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
* Shared/qt/WebEventFactoryQt.h:
* UIProcess/API/qt/qdesktopwebview.cpp:
(QDesktopWebView::mousePressEvent):
(QDesktopWebView::mouseMoveEvent):
(QDesktopWebView::mouseReleaseEvent):
(QDesktopWebView::mouseDoubleClickEvent):
(QDesktopWebView::wheelEvent):
(QDesktopWebView::event):
* UIProcess/API/qt/qdesktopwebview.h:
* UIProcess/qt/qdesktopwebpageproxy.cpp:
(QDesktopWebPageProxy::handleEvent):
(QDesktopWebPageProxy::handleMouseMoveEvent):
(QDesktopWebPageProxy::handleMousePressEvent):
(QDesktopWebPageProxy::handleMouseReleaseEvent):
(QDesktopWebPageProxy::handleMouseDoubleClickEvent):
(QDesktopWebPageProxy::handleWheelEvent):
(QDesktopWebPageProxy::handleHoverMoveEvent):
* UIProcess/qt/qdesktopwebpageproxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96399 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/NativeWebMouseEvent.h
Source/WebKit2/Shared/NativeWebWheelEvent.h
Source/WebKit2/Shared/qt/NativeWebMouseEventQt.cpp
Source/WebKit2/Shared/qt/NativeWebWheelEventQt.cpp
Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
Source/WebKit2/Shared/qt/WebEventFactoryQt.h
Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h
Source/WebKit2/UIProcess/qt/qdesktopwebpageproxy.cpp
Source/WebKit2/UIProcess/qt/qdesktopwebpageproxy.h

index 162168f..dc82c75 100644 (file)
@@ -1,3 +1,47 @@
+2011-09-30  Zeno Albisser  <zeno.albisser@nokia.com>
+
+        [Qt][WK2] Event delivery in QDesktopWebView is broken after merge of Qt5 refactor
+        https://bugs.webkit.org/show_bug.cgi?id=69105
+
+        This changes QDesktopWebView and QDesktopWebPageProxy to use QMouseEvent instead
+        of QGraphicsSceneMouseEvent.
+        Further it removes an endless loop introduced by the QSGItem::event() function
+        delivering inputMethodEvents but no other events.
+
+        Reviewed by Andreas Kling.
+
+        * Shared/NativeWebMouseEvent.h:
+        (WebKit::NativeWebMouseEvent::nativeEvent):
+        * Shared/NativeWebWheelEvent.h:
+        (WebKit::NativeWebWheelEvent::nativeEvent):
+        * Shared/qt/NativeWebMouseEventQt.cpp:
+        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
+        * Shared/qt/NativeWebWheelEventQt.cpp:
+        (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
+        * Shared/qt/WebEventFactoryQt.cpp:
+        (WebKit::mouseButtonForEvent):
+        (WebKit::webEventTypeForEvent):
+        (WebKit::WebEventFactory::createWebMouseEvent):
+        (WebKit::WebEventFactory::createWebWheelEvent):
+        * Shared/qt/WebEventFactoryQt.h:
+        * UIProcess/API/qt/qdesktopwebview.cpp:
+        (QDesktopWebView::mousePressEvent):
+        (QDesktopWebView::mouseMoveEvent):
+        (QDesktopWebView::mouseReleaseEvent):
+        (QDesktopWebView::mouseDoubleClickEvent):
+        (QDesktopWebView::wheelEvent):
+        (QDesktopWebView::event):
+        * UIProcess/API/qt/qdesktopwebview.h:
+        * UIProcess/qt/qdesktopwebpageproxy.cpp:
+        (QDesktopWebPageProxy::handleEvent):
+        (QDesktopWebPageProxy::handleMouseMoveEvent):
+        (QDesktopWebPageProxy::handleMousePressEvent):
+        (QDesktopWebPageProxy::handleMouseReleaseEvent):
+        (QDesktopWebPageProxy::handleMouseDoubleClickEvent):
+        (QDesktopWebPageProxy::handleWheelEvent):
+        (QDesktopWebPageProxy::handleHoverMoveEvent):
+        * UIProcess/qt/qdesktopwebpageproxy.h:
+
 2011-09-29  Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
 
         Initial implementation of WebInspector for WebKit2 GTK port.
index 7a9f0af..a73f958 100644 (file)
@@ -32,7 +32,7 @@
 #include <wtf/RetainPtr.h>
 OBJC_CLASS NSView;
 #elif PLATFORM(QT)
-#include <qgraphicssceneevent.h>
+#include <qevent.h>
 #elif PLATFORM(GTK)
 #include <GOwnPtrGtk.h>
 typedef union _GdkEvent GdkEvent;
@@ -49,7 +49,7 @@ public:
 #elif PLATFORM(WIN)
     NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool);
 #elif PLATFORM(QT)
-    explicit NativeWebMouseEvent(QGraphicsSceneMouseEvent*, int);
+    explicit NativeWebMouseEvent(QMouseEvent*, int);
 #elif PLATFORM(GTK)
     NativeWebMouseEvent(const NativeWebMouseEvent&);
     NativeWebMouseEvent(GdkEvent*, int);
@@ -64,7 +64,7 @@ public:
 #elif PLATFORM(WIN)
     const MSG* nativeEvent() const { return &m_nativeEvent; }
 #elif PLATFORM(QT)
-    const QGraphicsSceneMouseEvent* nativeEvent() const { return m_nativeEvent; }
+    const QMouseEvent* nativeEvent() const { return m_nativeEvent; }
 #elif PLATFORM(GTK)
     const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
 #elif PLATFORM(EFL)
@@ -77,7 +77,7 @@ private:
 #elif PLATFORM(WIN)
     MSG m_nativeEvent;
 #elif PLATFORM(QT)
-    QGraphicsSceneMouseEvent* m_nativeEvent;
+    QMouseEvent* m_nativeEvent;
 #elif PLATFORM(GTK)
     GOwnPtr<GdkEvent> m_nativeEvent;
 #elif PLATFORM(EFL)
index 44812fb..033ab80 100644 (file)
@@ -32,7 +32,7 @@
 #include <wtf/RetainPtr.h>
 OBJC_CLASS NSView;
 #elif PLATFORM(QT)
-#include <qgraphicssceneevent.h>
+#include <qevent.h>
 #elif PLATFORM(GTK)
 #include <GOwnPtrGtk.h>
 typedef union _GdkEvent GdkEvent;
@@ -49,7 +49,7 @@ public:
 #elif PLATFORM(WIN)
     NativeWebWheelEvent(HWND, UINT message, WPARAM, LPARAM);
 #elif PLATFORM(QT)
-    explicit NativeWebWheelEvent(QGraphicsSceneWheelEvent*);
+    explicit NativeWebWheelEvent(QWheelEvent*);
 #elif PLATFORM(GTK)
     NativeWebWheelEvent(const NativeWebWheelEvent&);
     NativeWebWheelEvent(GdkEvent*);
@@ -62,7 +62,7 @@ public:
 #elif PLATFORM(WIN)
     const MSG* nativeEvent() const { return &m_nativeEvent; }
 #elif PLATFORM(QT)
-    const QGraphicsSceneWheelEvent* nativeEvent() const { return m_nativeEvent; }
+    const QWheelEvent* nativeEvent() const { return m_nativeEvent; }
 #elif PLATFORM(GTK)
     const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
 #elif PLATFORM(EFL)
@@ -75,7 +75,7 @@ private:
 #elif PLATFORM(WIN)
     MSG m_nativeEvent;
 #elif PLATFORM(QT)
-    QGraphicsSceneWheelEvent* m_nativeEvent;
+    QWheelEvent* m_nativeEvent;
 #elif PLATFORM(GTK)
     GOwnPtr<GdkEvent> m_nativeEvent;
 #elif PLATFORM(EFL)
index a6f6e34..ee731de 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebKit {
 
-NativeWebMouseEvent::NativeWebMouseEvent(QGraphicsSceneMouseEvent* event, int eventClickCount)
+NativeWebMouseEvent::NativeWebMouseEvent(QMouseEvent* event, int eventClickCount)
     : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, eventClickCount))
     , m_nativeEvent(event)
 {
index 22e11e3..5ff224a 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebKit {
 
-NativeWebWheelEvent::NativeWebWheelEvent(QGraphicsSceneWheelEvent* event)
+NativeWebWheelEvent::NativeWebWheelEvent(QWheelEvent* event)
     : WebWheelEvent(WebEventFactory::createWebWheelEvent(event))
     , m_nativeEvent(event)
 {
index bef4b31..7380116 100644 (file)
@@ -39,7 +39,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-static WebMouseEvent::Button mouseButtonForEvent(QGraphicsSceneMouseEvent *event)
+static WebMouseEvent::Button mouseButtonForEvent(QMouseEvent *event)
 {
     if (event->button() == Qt::LeftButton || (event->buttons() & Qt::LeftButton))
         return WebMouseEvent::LeftButton;
@@ -53,30 +53,30 @@ static WebMouseEvent::Button mouseButtonForEvent(QGraphicsSceneMouseEvent *event
 static WebEvent::Type webEventTypeForEvent(const QEvent* event)
 {
     switch (event->type()) {
-        case QEvent::GraphicsSceneMouseDoubleClick:
-        case QEvent::GraphicsSceneMousePress:
-            return WebEvent::MouseDown;
-        case QEvent::GraphicsSceneMouseRelease:
-            return WebEvent::MouseUp;
-        case QEvent::GraphicsSceneMouseMove:
-            return WebEvent::MouseMove;
-        case QEvent::Wheel:
-            return WebEvent::Wheel;
-        case QEvent::KeyPress:
-            return WebEvent::KeyDown;
-        case QEvent::KeyRelease:
-            return WebEvent::KeyUp;
+    case QEvent::MouseButtonDblClick:
+    case QEvent::MouseButtonPress:
+        return WebEvent::MouseDown;
+    case QEvent::MouseButtonRelease:
+        return WebEvent::MouseUp;
+    case QEvent::MouseMove:
+        return WebEvent::MouseMove;
+    case QEvent::Wheel:
+        return WebEvent::Wheel;
+    case QEvent::KeyPress:
+        return WebEvent::KeyDown;
+    case QEvent::KeyRelease:
+        return WebEvent::KeyUp;
 #if ENABLE(TOUCH_EVENTS)
-        case QEvent::TouchBegin:
-            return WebEvent::TouchStart;
-        case QEvent::TouchUpdate:
-            return WebEvent::TouchMove;
-        case QEvent::TouchEnd:
-            return WebEvent::TouchEnd;
+    case QEvent::TouchBegin:
+        return WebEvent::TouchStart;
+    case QEvent::TouchUpdate:
+        return WebEvent::TouchMove;
+    case QEvent::TouchEnd:
+        return WebEvent::TouchEnd;
 #endif
-        default:
-            // assert
-            return WebEvent::MouseMove;
+    default:
+        // assert
+        return WebEvent::MouseMove;
     }
 }
 
@@ -94,22 +94,23 @@ static inline WebEvent::Modifiers modifiersForEvent(Qt::KeyboardModifiers modifi
     return (WebEvent::Modifiers)result;
 }
 
-WebMouseEvent WebEventFactory::createWebMouseEvent(QGraphicsSceneMouseEvent* event, int eventClickCount)
+WebMouseEvent WebEventFactory::createWebMouseEvent(QMouseEvent* event, int eventClickCount)
 {
-    FloatPoint delta(event->pos().x() - event->lastPos().x(), event->pos().y() - event->lastPos().y());
+    static FloatPoint lastPos = FloatPoint(0, 0);
 
     WebEvent::Type type             = webEventTypeForEvent(event);
     WebMouseEvent::Button button    = mouseButtonForEvent(event);
-    float deltaX                    = delta.x();
-    float deltaY                    = delta.y();
+    float deltaX                    = event->pos().x() - lastPos.x();
+    float deltaY                    = event->pos().y() - lastPos.y();
     int clickCount                  = eventClickCount;
     WebEvent::Modifiers modifiers   = modifiersForEvent(event->modifiers());
     double timestamp                = WTF::currentTime();
+    lastPos.set(event->localPos().x(), event->localPos().y());
 
-    return WebMouseEvent(type, button, event->pos().toPoint(), event->screenPos(), deltaX, deltaY, 0.0f, clickCount, modifiers, timestamp);
+    return WebMouseEvent(type, button, event->localPos().toPoint(), event->screenPos().toPoint(), deltaX, deltaY, 0.0f, clickCount, modifiers, timestamp);
 }
 
-WebWheelEvent WebEventFactory::createWebWheelEvent(QGraphicsSceneWheelEvent* e)
+WebWheelEvent WebEventFactory::createWebWheelEvent(QWheelEvent* e)
 {
     float deltaX                            = 0;
     float deltaY                            = 0;
@@ -138,7 +139,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(QGraphicsSceneWheelEvent* e)
     deltaX *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
     deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
 
-    return WebWheelEvent(WebEvent::Wheel, e->pos().toPoint(), e->screenPos(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
+    return WebWheelEvent(WebEvent::Wheel, e->posF().toPoint(), e->globalPosF().toPoint(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
 }
 
 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(QKeyEvent* event)
index d5487cc..4ce648e 100644 (file)
 class QTouchEvent;
 #endif
 
-class QGraphicsSceneMouseEvent;
-class QGraphicsSceneWheelEvent;
+class QMouseEvent;
+class QWheelEvent;
 class QKeyEvent;
 
 namespace WebKit {
 
 class WebEventFactory {
 public:
-    static WebMouseEvent createWebMouseEvent(QGraphicsSceneMouseEvent* event, int eventClickCount);
-    static WebWheelEvent createWebWheelEvent(QGraphicsSceneWheelEvent* event);
-    static WebKeyboardEvent createWebKeyboardEvent(QKeyEvent* event);
+    static WebMouseEvent createWebMouseEvent(QMouseEvent*, int eventClickCount);
+    static WebWheelEvent createWebWheelEvent(QWheelEvent*);
+    static WebKeyboardEvent createWebKeyboardEvent(QKeyEvent*);
 #if ENABLE(TOUCH_EVENTS)
     static WebTouchEvent createWebTouchEvent(const QTouchEvent*);
 #endif
index 27ed106..696b677 100644 (file)
@@ -269,40 +269,29 @@ void QDesktopWebView::focusOutEvent(QFocusEvent* event)
     this->event(event);
 }
 
-void QDesktopWebView::mousePressEvent(QGraphicsSceneMouseEvent* event)
+void QDesktopWebView::mousePressEvent(QMouseEvent* event)
 {
     this->event(event);
 }
 
-void QDesktopWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
+void QDesktopWebView::mouseMoveEvent(QMouseEvent* event)
 {
     this->event(event);
 }
 
-void QDesktopWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+void QDesktopWebView::mouseReleaseEvent(QMouseEvent* event)
 {
     this->event(event);
 }
 
-void QDesktopWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
+void QDesktopWebView::mouseDoubleClickEvent(QMouseEvent* event)
 {
     this->event(event);
 }
 
 void QDesktopWebView::wheelEvent(QWheelEvent* event)
 {
-    // FIXME: for some reason, the scene graph delivers QWheelEvent instead of QGraphicsSceneWheelEvent.
-    // We transform them in QGraphicsSceneWheelEvent for consistency. Otherwise the position would be complete magic.
-    // We shoud modify the scenegraph to get the correct type of events.
-    QGraphicsSceneWheelEvent graphicsEvent(QEvent::GraphicsSceneWheel);
-    graphicsEvent.setPos(event->pos());
-    graphicsEvent.setButtons(event->buttons());
-    graphicsEvent.setDelta(event->delta());
-    graphicsEvent.setModifiers(event->modifiers());
-    graphicsEvent.setOrientation(event->orientation());
-    graphicsEvent.setScenePos(mapToScene(event->pos()));
-    graphicsEvent.setScreenPos(event->globalPos());
-    this->event(&graphicsEvent);
+    this->event(event);
 }
 
 void QDesktopWebView::touchEvent(QTouchEvent* event)
@@ -367,6 +356,8 @@ bool QDesktopWebView::event(QEvent* ev)
 {
     if (d->page.handleEvent(ev))
         return true;
+    if (ev->type() == QEvent::InputMethod)
+        return false; // This is necessary to avoid an endless loop in connection with QSGItem::event().
     return QSGItem::event(ev);
 }
 
index 2a854a0..b25ddef 100644 (file)
@@ -32,7 +32,7 @@ class QWebNavigationController;
 
 QT_BEGIN_NAMESPACE
 class QFocusEvent;
-class QGraphicsSceneMouseEvent;
+class QMouseEvent;
 class QHoverEvent;
 class QInputMethodEvent;
 class QKeyEvent;
@@ -96,10 +96,10 @@ protected:
     virtual void inputMethodEvent(QInputMethodEvent*);
     virtual void focusInEvent(QFocusEvent*);
     virtual void focusOutEvent(QFocusEvent*);
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
-    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
+    virtual void mousePressEvent(QMouseEvent *);
+    virtual void mouseMoveEvent(QMouseEvent *);
+    virtual void mouseReleaseEvent(QMouseEvent *);
+    virtual void mouseDoubleClickEvent(QMouseEvent *);
     virtual void wheelEvent(QWheelEvent*);
     virtual void touchEvent(QTouchEvent*);
     virtual void hoverEnterEvent(QHoverEvent*);
index 04f90bf..523d777 100644 (file)
@@ -90,16 +90,16 @@ PassRefPtr<WebPopupMenuProxy> QDesktopWebPageProxy::createPopupMenuProxy(WebPage
 bool QDesktopWebPageProxy::handleEvent(QEvent* ev)
 {
     switch (ev->type()) {
-    case QEvent::GraphicsSceneMouseMove:
-        return handleMouseMoveEvent(reinterpret_cast<QGraphicsSceneMouseEvent*>(ev));
-    case QEvent::GraphicsSceneMousePress:
-        return handleMousePressEvent(reinterpret_cast<QGraphicsSceneMouseEvent*>(ev));
-    case QEvent::GraphicsSceneMouseRelease:
-        return handleMouseReleaseEvent(reinterpret_cast<QGraphicsSceneMouseEvent*>(ev));
-    case QEvent::GraphicsSceneMouseDoubleClick:
-        return handleMouseDoubleClickEvent(reinterpret_cast<QGraphicsSceneMouseEvent*>(ev));
-    case QEvent::GraphicsSceneWheel:
-        return handleWheelEvent(reinterpret_cast<QGraphicsSceneWheelEvent*>(ev));
+    case QEvent::MouseMove:
+        return handleMouseMoveEvent(reinterpret_cast<QMouseEvent*>(ev));
+    case QEvent::MouseButtonPress:
+        return handleMousePressEvent(reinterpret_cast<QMouseEvent*>(ev));
+    case QEvent::MouseButtonRelease:
+        return handleMouseReleaseEvent(reinterpret_cast<QMouseEvent*>(ev));
+    case QEvent::MouseButtonDblClick:
+        return handleMouseDoubleClickEvent(reinterpret_cast<QMouseEvent*>(ev));
+    case QEvent::Wheel:
+        return handleWheelEvent(reinterpret_cast<QWheelEvent*>(ev));
     case QEvent::HoverMove:
         return handleHoverMoveEvent(reinterpret_cast<QHoverEvent*>(ev));
     case QEvent::GraphicsSceneDragEnter:
@@ -114,7 +114,7 @@ bool QDesktopWebPageProxy::handleEvent(QEvent* ev)
     return QtWebPageProxy::handleEvent(ev);
 }
 
-bool QDesktopWebPageProxy::handleMouseMoveEvent(QGraphicsSceneMouseEvent* ev)
+bool QDesktopWebPageProxy::handleMouseMoveEvent(QMouseEvent* ev)
 {
     // For some reason mouse press results in mouse hover (which is
     // converted to mouse move for WebKit). We ignore these hover
@@ -131,7 +131,7 @@ bool QDesktopWebPageProxy::handleMouseMoveEvent(QGraphicsSceneMouseEvent* ev)
     return ev->isAccepted();
 }
 
-bool QDesktopWebPageProxy::handleMousePressEvent(QGraphicsSceneMouseEvent* ev)
+bool QDesktopWebPageProxy::handleMousePressEvent(QMouseEvent* ev)
 {
     if (m_tripleClickTimer.isActive() && (ev->pos() - m_tripleClick).manhattanLength() < QApplication::startDragDistance()) {
         m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount=*/3));
@@ -142,22 +142,22 @@ bool QDesktopWebPageProxy::handleMousePressEvent(QGraphicsSceneMouseEvent* ev)
     return ev->isAccepted();
 }
 
-bool QDesktopWebPageProxy::handleMouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
+bool QDesktopWebPageProxy::handleMouseReleaseEvent(QMouseEvent* ev)
 {
     m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount=*/0));
     return ev->isAccepted();
 }
 
-bool QDesktopWebPageProxy::handleMouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
+bool QDesktopWebPageProxy::handleMouseDoubleClickEvent(QMouseEvent* ev)
 {
     m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount=*/2));
 
     m_tripleClickTimer.start(QApplication::doubleClickInterval(), this);
-    m_tripleClick = ev->pos().toPoint();
+    m_tripleClick = ev->localPos().toPoint();
     return ev->isAccepted();
 }
 
-bool QDesktopWebPageProxy::handleWheelEvent(QGraphicsSceneWheelEvent* ev)
+bool QDesktopWebPageProxy::handleWheelEvent(QWheelEvent* ev)
 {
     m_webPageProxy->handleWheelEvent(NativeWebWheelEvent(ev));
     return ev->isAccepted();
@@ -165,8 +165,7 @@ bool QDesktopWebPageProxy::handleWheelEvent(QGraphicsSceneWheelEvent* ev)
 
 bool QDesktopWebPageProxy::handleHoverMoveEvent(QHoverEvent* ev)
 {
-    QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMouseMove);
-    me.setPos(ev->pos());
+    QMouseEvent me(QEvent::MouseMove, ev->pos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
     me.setAccepted(ev->isAccepted());
 
     return handleMouseMoveEvent(&me);
index 71de769..81031f4 100644 (file)
@@ -51,11 +51,11 @@ private:
 
     virtual void timerEvent(QTimerEvent*);
 
-    bool handleMouseMoveEvent(QGraphicsSceneMouseEvent*);
-    bool handleMousePressEvent(QGraphicsSceneMouseEvent*);
-    bool handleMouseReleaseEvent(QGraphicsSceneMouseEvent*);
-    bool handleMouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
-    bool handleWheelEvent(QGraphicsSceneWheelEvent*);
+    bool handleMouseMoveEvent(QMouseEvent*);
+    bool handleMousePressEvent(QMouseEvent*);
+    bool handleMouseReleaseEvent(QMouseEvent*);
+    bool handleMouseDoubleClickEvent(QMouseEvent*);
+    bool handleWheelEvent(QWheelEvent*);
     bool handleHoverMoveEvent(QHoverEvent*);
     bool handleDragEnterEvent(QGraphicsSceneDragDropEvent*);
     bool handleDragLeaveEvent(QGraphicsSceneDragDropEvent*);