[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:40:21 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e0c180413ff0e712d8ba65fd0db29a279908a64d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 17 17:09:23 2009 +0000

    2009-12-17  Kim Grönholm  <kim.gronholm at nomovok.com>
    
            Reviewed by Simon Hausmann.
    
            [Qt] Add support for touch events in QWebView and QGraphicsWebView
            https://bugs.webkit.org/show_bug.cgi?id=32432
    
            * Api/qgraphicswebview.cpp:
            (QGraphicsWebView::QGraphicsWebView):
            (QGraphicsWebView::sceneEvent):
            * Api/qwebview.cpp:
            (QWebView::QWebView):
            (QWebView::event):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52256 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index b25b53b..031d8f8 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -244,6 +244,9 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
 #endif
     setAcceptDrops(true);
     setAcceptHoverEvents(true);
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    setAcceptTouchEvents(true);
+#endif
     setFocusPolicy(Qt::StrongFocus);
 }
 
@@ -302,6 +305,17 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem*
 bool QGraphicsWebView::sceneEvent(QEvent* event)
 {
     // Re-implemented in order to allows fixing event-related bugs in patch releases.
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    if (d->page && (event->type() == QEvent::TouchBegin
+                || event->type() == QEvent::TouchEnd
+                || event->type() == QEvent::TouchUpdate)) {
+        d->page->event(event);
+        if (event->isAccepted())
+            return true;
+    }
+#endif
+
     return QGraphicsWidget::sceneEvent(event);
 }
 
diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp
index 7bc3168..275f208 100644
--- a/WebKit/qt/Api/qwebview.cpp
+++ b/WebKit/qt/Api/qwebview.cpp
@@ -153,6 +153,10 @@ QWebView::QWebView(QWidget *parent)
     setAttribute(Qt::WA_InputMethodEnabled);
 #endif
 
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+    setAttribute(Qt::WA_AcceptTouchEvents);
+#endif
+
     setAcceptDrops(true);
 
     setMouseTracking(true);
@@ -640,6 +644,14 @@ bool QWebView::event(QEvent *e)
             if (cursor().shape() == Qt::ArrowCursor)
                 d->page->d->client->resetCursor();
 #endif
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+        } else if (e->type() == QEvent::TouchBegin 
+                   || e->type() == QEvent::TouchEnd 
+                   || e->type() == QEvent::TouchUpdate) {
+            d->page->event(e);
+            if (e->isAccepted())
+                return true;
+#endif
         } else if (e->type() == QEvent::Leave)
             d->page->event(e);
     }
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index eead9ec..3bf1922 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -2,6 +2,20 @@
 
         Reviewed by Simon Hausmann.
 
+        [Qt] Add support for touch events in QWebView and QGraphicsWebView
+        https://bugs.webkit.org/show_bug.cgi?id=32432
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebView::QGraphicsWebView):
+        (QGraphicsWebView::sceneEvent):
+        * Api/qwebview.cpp:
+        (QWebView::QWebView):
+        (QWebView::event):
+
+2009-12-17  Kim Grönholm  <kim.gronholm at nomovok.com>
+
+        Reviewed by Simon Hausmann.
+
         [Qt] Add support for mocking touch events with QtLauncher
         https://bugs.webkit.org/show_bug.cgi?id=32434
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list