summaryrefslogtreecommitdiff
path: root/tests/auto/declarative/qdeclarativeflickable
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-05-11 13:33:48 +1000
committerYann Bodson <yann.bodson@nokia.com>2010-05-12 15:37:17 +1000
commit71187a1f0d26ff61c033a7c2d46892f48816fc45 (patch)
tree0234f975938886f4b675a794a56a829a87d89c5f /tests/auto/declarative/qdeclarativeflickable
parent798bdb4543f84d427659b950a3a1643ae4987b8b (diff)
downloadqt4-tools-71187a1f0d26ff61c033a7c2d46892f48816fc45.tar.gz
Flickable small API changes.
- Split moving into movingHorizontally anf movingVertically - Split flicking into flickingHorizontally and flickingVertically - Rename flickDirection to flickableDirection - onMovementStarted, onMovementEnded, onFlickStarted and onFlickEnded signals removed Task-number: QTBUG-10572 Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativeflickable')
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index 9ce9c49cc6..2c6890ec21 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -61,6 +61,7 @@ private slots:
void maximumFlickVelocity();
void flickDeceleration();
void pressDelay();
+ void flickableDirection();
private:
QDeclarativeEngine engine;
@@ -224,6 +225,33 @@ void tst_qdeclarativeflickable::pressDelay()
QCOMPARE(spy.count(),1);
}
+void tst_qdeclarativeflickable::flickableDirection()
+{
+ QDeclarativeComponent component(&engine);
+ component.setData("import Qt 4.7; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
+ QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
+ QSignalSpy spy(flickable, SIGNAL(flickableDirectionChanged()));
+
+ QVERIFY(flickable);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::VerticalFlick);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalAndVerticalFlick);
+ QCOMPARE(spy.count(),1);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::AutoFlickDirection);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::AutoFlickDirection);
+ QCOMPARE(spy.count(),2);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(spy.count(),3);
+
+ flickable->setFlickableDirection(QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(flickable->flickableDirection(), QDeclarativeFlickable::HorizontalFlick);
+ QCOMPARE(spy.count(),3);
+}
+
QTEST_MAIN(tst_qdeclarativeflickable)
#include "tst_qdeclarativeflickable.moc"