summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-22 08:06:40 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-22 08:06:40 (GMT)
commit0b6fd8966972616232054c5194243c52ca360bf8 (patch)
tree06dc40958aefc6f5e118dccfa192ff77528a014d /tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
parent1c47be7174ca1e9ed393a12461742975079710d7 (diff)
parente9da512e321c6ea7795a4abc0b9d24bf4d3d2527 (diff)
downloadQt-0b6fd8966972616232054c5194243c52ca360bf8.zip
Qt-0b6fd8966972616232054c5194243c52ca360bf8.tar.gz
Qt-0b6fd8966972616232054c5194243c52ca360bf8.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (135 commits) Do not treat images in qml examples differently. Replace Flickable overshoot property with boundsBehavior Autotests and doc Give error on attempt to import types from too-early version number. Remove (undocumented) QML bindings for effects. De-straighten them lines. Doc: fix QStringList model doc (really). Doc: fix QStringList model docs Change return type to match value(). Add duration and easing properties to AnchorAnimation. Autotest Remove dead code Compile on Windows (export decl fix). Fix versioning of Qt Declarative's in-built types Fixed declarative/parserstress autotest. Fix parsing of regular expression literals. Fill out QGraphicsLayout bindings Update test files to new syntax Compile without Qt3 support. Ensure workerscript.qml works (autotested). ...
Diffstat (limited to 'tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index a345a60..9ce9c49 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -57,7 +57,7 @@ private slots:
void horizontalViewportSize();
void verticalViewportSize();
void properties();
- void overShoot();
+ void boundsBehavior();
void maximumFlickVelocity();
void flickDeceleration();
void pressDelay();
@@ -88,7 +88,7 @@ void tst_qdeclarativeflickable::create()
QCOMPARE(obj->verticalVelocity(), 0.);
QCOMPARE(obj->isInteractive(), true);
- QCOMPARE(obj->overShoot(), true);
+ QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::DragAndOvershootBounds);
QCOMPARE(obj->pressDelay(), 0);
QCOMPARE(obj->maximumFlickVelocity(), 2000.);
@@ -137,34 +137,40 @@ void tst_qdeclarativeflickable::properties()
QVERIFY(obj != 0);
QCOMPARE(obj->isInteractive(), false);
- QCOMPARE(obj->overShoot(), false);
+ QCOMPARE(obj->boundsBehavior(), QDeclarativeFlickable::StopAtBounds);
QCOMPARE(obj->pressDelay(), 200);
QCOMPARE(obj->maximumFlickVelocity(), 2000.);
delete obj;
}
-void tst_qdeclarativeflickable::overShoot()
+void tst_qdeclarativeflickable::boundsBehavior()
{
QDeclarativeComponent component(&engine);
- component.setData("import Qt 4.7; Flickable { overShoot: false; }", QUrl::fromLocalFile(""));
+ component.setData("import Qt 4.7; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile(""));
QDeclarativeFlickable *flickable = qobject_cast<QDeclarativeFlickable*>(component.create());
- QSignalSpy spy(flickable, SIGNAL(overShootChanged()));
+ QSignalSpy spy(flickable, SIGNAL(boundsBehaviorChanged()));
QVERIFY(flickable);
- QVERIFY(!flickable->overShoot());
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds);
- flickable->setOverShoot(true);
- QVERIFY(flickable->overShoot());
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragAndOvershootBounds);
QCOMPARE(spy.count(),1);
- flickable->setOverShoot(true);
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragAndOvershootBounds);
QCOMPARE(spy.count(),1);
- flickable->setOverShoot(false);
- QVERIFY(!flickable->overShoot());
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::DragOverBounds);
QCOMPARE(spy.count(),2);
- flickable->setOverShoot(false);
+ flickable->setBoundsBehavior(QDeclarativeFlickable::DragOverBounds);
QCOMPARE(spy.count(),2);
+
+ flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds);
+ QVERIFY(flickable->boundsBehavior() == QDeclarativeFlickable::StopAtBounds);
+ QCOMPARE(spy.count(),3);
+ flickable->setBoundsBehavior(QDeclarativeFlickable::StopAtBounds);
+ QCOMPARE(spy.count(),3);
}
void tst_qdeclarativeflickable::maximumFlickVelocity()