diff options
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/declarativetestplugin/qdeclarativepinchgenerator.cpp | 12 | ||||
-rw-r--r-- | tests/plugins/declarativetestplugin/qdeclarativepinchgenerator_p.h | 1 |
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, |