summaryrefslogtreecommitdiff
path: root/tests/plugins
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-03-26 11:41:07 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-05-22 22:00:42 +0000
commit929c9a46aaa75ec3c77a226eb9e8a2e956e4763c (patch)
tree455371eefe3ad535062a0685d216905fadceab00 /tests/plugins
parentfb983f85cf2636529dbaec4713bbf4e9b679d0ba (diff)
downloadqtlocation-929c9a46aaa75ec3c77a226eb9e8a2e956e4763c.tar.gz
Enable and update map flick and pinch autotest.
Make pan drag distance inclusive in QDeclarativeGeoMapGestureArea which simplifies unit testing on different platforms. Use sceneCenter instead of lastPos for panning startup. lastPos is used with velocity sampling which makes it not reliable as a starting value. Change-Id: If0d98e834a5e2d4264a51d70c2c39846cd2a677b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp12
-rw-r--r--tests/plugins/declarativetestplugin/qdeclarativepinchgenerator_p.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp b/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp
index e1613cf7..98da18d0 100644
--- a/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp
+++ b/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp
@@ -36,6 +36,7 @@
#include <QtTest/QtTest>
#include <QtGui/QGuiApplication>
#include <QtGui/qpa/qwindowsysteminterface.h>
+#include <QtGui/QStyleHints>
QDeclarativePinchGenerator::QDeclarativePinchGenerator():
target_(0),
@@ -331,7 +332,7 @@ void QDeclarativePinchGenerator::pinchRelease(QPoint point1To, QPoint point2To)
QTest::touchEvent(window_, device_).release(0, point1To).release(1, point2To);
}
-Q_INVOKABLE void QDeclarativePinchGenerator::replay()
+void QDeclarativePinchGenerator::replay()
{
if (state_ != Idle) {
qDebug() << "Wrong state, will not replay pinch, state: " << state_;
@@ -354,7 +355,7 @@ Q_INVOKABLE void QDeclarativePinchGenerator::replay()
setState(Replaying);
}
-Q_INVOKABLE void QDeclarativePinchGenerator::clear()
+void QDeclarativePinchGenerator::clear()
{
stop();
delete activeSwipe_;
@@ -365,7 +366,7 @@ Q_INVOKABLE void QDeclarativePinchGenerator::clear()
}
}
-Q_INVOKABLE void QDeclarativePinchGenerator::stop()
+void QDeclarativePinchGenerator::stop()
{
if (state_ != Replaying)
return;
@@ -375,3 +376,8 @@ Q_INVOKABLE void QDeclarativePinchGenerator::stop()
replayTimer_ = -1;
setState(Idle);
}
+
+int QDeclarativePinchGenerator::startDragDistance()
+{
+ return qApp->styleHints()->startDragDistance();
+}
diff --git a/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator_p.h b/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator_p.h
index 3bf785e0..b2a4e77c 100644
--- a/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator_p.h
+++ b/tests/plugins/declarativetestplugin/qdeclarativepinchgenerator_p.h
@@ -76,6 +76,7 @@ public:
Q_INVOKABLE void replay();
Q_INVOKABLE void clear();
Q_INVOKABLE void stop();
+ Q_INVOKABLE int startDragDistance();
// programmatic interface, useful for autotests
Q_INVOKABLE void pinch(QPoint point1From,