Title: [103060] trunk/Tools
Revision
103060
Author
o...@webkit.org
Date
2011-12-16 05:35:55 -0800 (Fri, 16 Dec 2011)

Log Message

[Qt] Fix the build for newer Qt5
https://bugs.webkit.org/show_bug.cgi?id=74703

Patch by Simon Hausmann <simon.hausm...@nokia.com> on 2011-12-16
Reviewed by Csaba Osztrogonác.

* QtTestBrowser/launcherwindow.h: Add missing forward declaration.
* DumpRenderTree/qt/EventSenderQt.cpp:
(EventSender::sendTouchEvent): Allocate QTouchDevice and use with QTouchEvent constructor.
* WebKitTestRunner/qt/EventSenderProxyQt.cpp: Ditto.
(WTR::EventSenderProxy::sendTouchEvent):
* MiniBrowser/qt/MiniBrowserApplication.cpp:
(MiniBrowserApplication::sendTouchEvent): Ditto.
(MiniBrowserApplication::notify): Adapt to changed API for marking primary touch point.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (103059 => 103060)


--- trunk/Tools/ChangeLog	2011-12-16 13:04:50 UTC (rev 103059)
+++ trunk/Tools/ChangeLog	2011-12-16 13:35:55 UTC (rev 103060)
@@ -1,3 +1,19 @@
+2011-12-16  Simon Hausmann  <simon.hausm...@nokia.com>
+
+        [Qt] Fix the build for newer Qt5
+        https://bugs.webkit.org/show_bug.cgi?id=74703
+
+        Reviewed by Csaba Osztrogonác.
+
+        * QtTestBrowser/launcherwindow.h: Add missing forward declaration.
+        * DumpRenderTree/qt/EventSenderQt.cpp:
+        (EventSender::sendTouchEvent): Allocate QTouchDevice and use with QTouchEvent constructor.
+        * WebKitTestRunner/qt/EventSenderProxyQt.cpp: Ditto.
+        (WTR::EventSenderProxy::sendTouchEvent):
+        * MiniBrowser/qt/MiniBrowserApplication.cpp:
+        (MiniBrowserApplication::sendTouchEvent): Ditto.
+        (MiniBrowserApplication::notify): Adapt to changed API for marking primary touch point.
+
 2011-12-16  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
 
         [Qt] Detect and force clean build when feature defines are added

Modified: trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp (103059 => 103060)


--- trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp	2011-12-16 13:04:50 UTC (rev 103059)
+++ trunk/Tools/DumpRenderTree/qt/EventSenderQt.cpp	2011-12-16 13:35:55 UTC (rev 103060)
@@ -480,7 +480,18 @@
 
 void EventSender::sendTouchEvent(QEvent::Type type)
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+    static QTouchDevice* device = 0;
+    if (!device) {
+        device = new QTouchDevice;
+        device->setType(QTouchDevice::TouchScreen);
+        QWindowSystemInterface::registerTouchDevice(device);
+    }
+
+    QTouchEvent event(type, device, m_touchModifiers);
+#else
     QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);
+#endif
     event.setTouchPoints(m_touchPoints);
     sendEvent(m_page, &event);
     QList<QTouchEvent::TouchPoint>::Iterator it = m_touchPoints.begin();

Modified: trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp (103059 => 103060)


--- trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp	2011-12-16 13:04:50 UTC (rev 103059)
+++ trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp	2011-12-16 13:35:55 UTC (rev 103060)
@@ -111,7 +111,6 @@
         QWindowSystemInterface::TouchPoint touchPoint;
         touchPoint.area = QRectF(mouseEvent->globalPos(), QSizeF(1, 1));
         touchPoint.pressure = 1;
-        touchPoint.isPrimary = false;
 
         switch (mouseEvent->type()) {
         case QEvent::MouseButtonPress:
@@ -142,7 +141,7 @@
 
         // Update current touch-point
         if (m_touchPoints.isEmpty())
-            touchPoint.isPrimary = true;
+            touchPoint.flags |= QTouchEvent::TouchPoint::Primary;
         m_touchPoints.insert(touchPoint.id, touchPoint);
 
         // Update states for all other touch-points
@@ -159,8 +158,15 @@
 
 void MiniBrowserApplication::sendTouchEvent(BrowserWindow* browserWindow)
 {
+    static QTouchDevice* device = 0;
+    if (!device) {
+        device = new QTouchDevice;
+        device->setType(QTouchDevice::TouchScreen);
+        QWindowSystemInterface::registerTouchDevice(device);
+    }
+
     m_pendingFakeTouchEventCount++;
-    QWindowSystemInterface::handleTouchEvent(browserWindow, QEvent::None, QTouchEvent::TouchScreen, m_touchPoints.values());
+    QWindowSystemInterface::handleTouchEvent(browserWindow, QEvent::None, device, m_touchPoints.values());
 
     if (!m_windowOptions.useTraditionalDesktopBehavior())
         browserWindow->updateVisualMockTouchPoints(m_touchPoints.values());

Modified: trunk/Tools/QtTestBrowser/launcherwindow.h (103059 => 103060)


--- trunk/Tools/QtTestBrowser/launcherwindow.h	2011-12-16 13:04:50 UTC (rev 103059)
+++ trunk/Tools/QtTestBrowser/launcherwindow.h	2011-12-16 13:35:55 UTC (rev 103060)
@@ -64,6 +64,7 @@
 #include "webview.h"
 
 class QPropertyAnimation;
+class QLineEdit;
 
 class WindowOptions {
 public:

Modified: trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp (103059 => 103060)


--- trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp	2011-12-16 13:04:50 UTC (rev 103059)
+++ trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp	2011-12-16 13:35:55 UTC (rev 103060)
@@ -382,7 +382,14 @@
 
 void EventSenderProxy::sendTouchEvent(QEvent::Type type)
 {
-    QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);
+    static QTouchDevice* device = 0;
+    if (!device) {
+        device = new QTouchDevice;
+        device->setType(QTouchDevice::TouchScreen);
+        QWindowSystemInterface::registerTouchDevice(device);
+    }
+
+    QTouchEvent event(type, device, m_touchModifiers);
     event.setTouchPoints(m_touchPoints);
     m_testController->mainWebView()->sendEvent(&event);
     QList<QTouchEvent::TouchPoint>::Iterator it = m_touchPoints.begin();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to