Changeset 96402 in webkit


Ignore:
Timestamp:
Sep 30, 2011 7:54:02 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt][WK2] Change WebKitTestRunner to use QMouseEvents instead of QGraphicsSceneMouseEvents
https://bugs.webkit.org/show_bug.cgi?id=69145

This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=69105
Due to refactorings in Qt5, QMouseEvent now supports floating point coordinates
and is perfectly suitable for SceneGraph as well. GraphicsScene events
will not be available in QtGui anymore in future. Therefore we also have to change
QtWebKit to use QMouseEvents instead of QGraphicsSceneMouseEvents.

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

  • WebKitTestRunner/EventSenderProxy.h:
  • WebKitTestRunner/qt/EventSenderProxyQt.cpp:

(WTR::EventSenderProxy::createMouseEvent):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r96392 r96402  
     12011-09-30  Zeno Albisser  <zeno.albisser@nokia.com>
     2
     3        [Qt][WK2] Change WebKitTestRunner to use QMouseEvents instead of QGraphicsSceneMouseEvents
     4        https://bugs.webkit.org/show_bug.cgi?id=69145
     5
     6        This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=69105
     7        Due to refactorings in Qt5, QMouseEvent now supports floating point coordinates
     8        and is perfectly suitable for SceneGraph as well. GraphicsScene events
     9        will not be available in QtGui anymore in future. Therefore we also have to change
     10        QtWebKit to use QMouseEvents instead of QGraphicsSceneMouseEvents.
     11
     12        Reviewed by Chang Shu.
     13
     14        * WebKitTestRunner/EventSenderProxy.h:
     15        * WebKitTestRunner/qt/EventSenderProxyQt.cpp:
     16        (WTR::EventSenderProxy::createMouseEvent):
     17        (WTR::EventSenderProxy::mouseDown):
     18        (WTR::EventSenderProxy::mouseUp):
     19        (WTR::EventSenderProxy::mouseMoveTo):
     20
    1212011-09-30  James Robinson  <jamesr@chromium.org>
    222
  • trunk/Tools/WebKitTestRunner/EventSenderProxy.h

    r95878 r96402  
    5252    void sendOrQueueEvent(QEvent*);
    5353    void replaySavedEvents();
    54     QGraphicsSceneMouseEvent* createGraphicsSceneMouseEvent(QEvent::Type, const QPoint& pos, const QPoint& screenPos, Qt::MouseButton, Qt::MouseButtons, Qt::KeyboardModifiers);
    5554#endif
    5655
  • trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp

    r96345 r96402  
    256256}
    257257
    258 QGraphicsSceneMouseEvent* EventSenderProxy::createGraphicsSceneMouseEvent(QEvent::Type type, const QPoint& pos, const QPoint& screenPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
    259 {
    260     QGraphicsSceneMouseEvent* event;
    261     event = new QGraphicsSceneMouseEvent(type);
    262     event->setPos(pos);
    263     event->setScreenPos(screenPos);
    264     event->setButton(button);
    265     event->setButtons(buttons);
    266     event->setModifiers(modifiers);
    267 
    268     return event;
    269 }
    270 
    271258void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
    272259{
     
    279266
    280267    QPoint mousePos(m_position.x, m_position.y);
    281     QGraphicsSceneMouseEvent* event = createGraphicsSceneMouseEvent((m_clickCount == 2) ? QEvent::GraphicsSceneMouseDoubleClick : QEvent::GraphicsSceneMousePress,
     268    QMouseEvent* event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick : QEvent::MouseButtonPress,
    282269        mousePos, mousePos, mouseButton, m_mouseButtons, modifiers);
    283270
     
    291278
    292279    QPoint mousePos(m_position.x, m_position.y);
    293     QGraphicsSceneMouseEvent* event = createGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseRelease,
     280    QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonRelease,
    294281        mousePos, mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
    295282
     
    303290
    304291    QPoint mousePos(m_position.x, m_position.y);
    305     QGraphicsSceneMouseEvent* event = createGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseMove,
     292    QMouseEvent* event = new QMouseEvent(QEvent::MouseMove,
    306293        mousePos, mousePos, Qt::NoButton, m_mouseButtons, Qt::NoModifier);
    307294
Note: See TracChangeset for help on using the changeset viewer.