summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtesttouch.h
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2012-07-26 18:48:56 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-02 17:25:37 +0200
commit5ac4a1304b44283bb0ddf593b08e7e44ed9a107f (patch)
tree632ffbe48e35227ca25faa6797f2e75901e673e6 /src/testlib/qtesttouch.h
parent4c4ba15a409737abe7cc07bdc452d556ec9ecbdc (diff)
Make tests compile without gui-private
Add new qt_handleXXX functions that forward to the QWindowSystemInterface functions, and use those in the testlib inline functions. Remove use of struct QWindowSystemInterface::TouchPoint from the testlib header files (requiring some slight increase in ugliness in the two tests that use that struct). Also remove the qmake hack that adds private headers to all tests Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Diffstat (limited to 'src/testlib/qtesttouch.h')
-rw-r--r--src/testlib/qtesttouch.h35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index c95d2f41eb..a004ccea10 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -51,7 +51,6 @@
#include <QtTest/qtestassert.h>
#include <QtTest/qtestsystem.h>
#include <QtTest/qtestspontaneevent.h>
-#include <QtGui/qwindowsysteminterface.h>
#include <QtCore/qmap.h>
#include <QtGui/qevent.h>
#ifdef QT_WIDGETS_LIB
@@ -62,6 +61,10 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT void qt_handleTouchEvent(QWindow *w, QTouchDevice *device,
+ const QList<QTouchEvent::TouchPoint> &points,
+ Qt::KeyboardModifiers mods = Qt::NoModifier);
+
namespace QTest
{
@@ -131,12 +134,12 @@ namespace QTest
if (!points.isEmpty()) {
if (targetWindow)
{
- QWindowSystemInterface::handleTouchEvent(targetWindow, device, touchPointList(points.values()));
+ qt_handleTouchEvent(targetWindow, device, points.values());
}
#ifdef QT_WIDGETS_LIB
else if (targetWidget)
{
- QWindowSystemInterface::handleTouchEvent(targetWidget->windowHandle(), device, touchPointList(points.values()));
+ qt_handleTouchEvent(targetWidget->windowHandle(), device, points.values());
}
#endif
}
@@ -146,31 +149,7 @@ namespace QTest
points.clear();
}
- static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
- {
- QWindowSystemInterface::TouchPoint p;
- p.id = pt.id();
- p.flags = pt.flags();
- p.normalPosition = pt.normalizedPos();
- p.area = pt.screenRect();
- p.pressure = pt.pressure();
- p.state = pt.state();
- p.velocity = pt.velocity();
- p.rawPositions = pt.rawScreenPositions();
- return p;
- }
- static QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QList<QTouchEvent::TouchPoint>& pointList)
- {
- QList<struct QWindowSystemInterface::TouchPoint> newList;
-
- Q_FOREACH (QTouchEvent::TouchPoint p, pointList)
- {
- newList.append(touchPoint(p));
- }
- return newList;
- }
-
- private:
+private:
#ifdef QT_WIDGETS_LIB
QTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit)
: targetWidget(widget), targetWindow(0), device(aDevice), commitWhenDestroyed(autoCommit)