diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp b/Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp index 0930708d4..1c39a53cd 100644 --- a/Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp +++ b/Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp @@ -23,9 +23,10 @@ #include "QtViewportHandler.h" #include "qquickwebview_p_p.h" -#include "qwindowsysteminterface_qpa.h" #include <QMutableListIterator> #include <QTouchEvent> +#include <QWheelEvent> +#include <qpa/qwindowsysteminterface.h> using namespace WebKit; @@ -113,6 +114,24 @@ bool QWebKitTest::touchDoubleTap(QObject* item, qreal x, qreal y, int delay) return true; } +bool QWebKitTest::wheelEvent(QObject* item, qreal x, qreal y, int delta, Qt::Orientation orient) +{ + QQuickWebView* window = qobject_cast<QQuickWebView*>(item); + + if (!window) { + qWarning("Wheel event not accepted by receiving item"); + return false; + } + + QWheelEvent event(QPointF(x, y), delta, Qt::NoButton, Qt::NoModifier, orient); + event.setTimestamp(QDateTime::currentMSecsSinceEpoch()); + event.setAccepted(false); + + window->wheelEvent(&event); + + return event.isAccepted(); +} + QSize QWebKitTest::contentsSize() const { return QSize(m_webViewPrivate->pageView->contentsSize().toSize()); |