summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-22 03:35:10 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-22 03:35:10 (GMT)
commit47862497693ffac597557f940535909df549d897 (patch)
tree955c2c9d0f014e79ec6f3fe801f2e2baa4b4bfa1 /tests/auto
parentfb94bfda66ac8767c96cb521a1f77c6b8be5bb95 (diff)
downloadQt-47862497693ffac597557f940535909df549d897.zip
Qt-47862497693ffac597557f940535909df549d897.tar.gz
Qt-47862497693ffac597557f940535909df549d897.tar.bz2
Replace Flickable overshoot property with boundsBehavior
Task-number: QTBUG-9993
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp32
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml5
3 files changed, 22 insertions, 17 deletions
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
index ff742f0..aa156ed 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
@@ -3,7 +3,7 @@ import Qt 4.7
Flickable {
width: 100; height: 100
contentWidth: column.width; contentHeight: column.height
- pressDelay: 200; overShoot: false; interactive: false
+ pressDelay: 200; boundsBehavior: Flickable.StopAtBounds; interactive: false
maximumFlickVelocity: 2000
Column {
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()
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml
index 09e414d..d845353 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml
+++ b/tests/auto/declarative/qmlvisual/qdeclarativeflickable/flickable-vertical.qml
@@ -15,7 +15,7 @@ Rectangle {
ListElement { dayColor: "orange" }
}
- flickable {
+ Flickable {
id: flick
height: parent.height-50
width: parent.width; contentHeight: column.height
@@ -33,7 +33,6 @@ Rectangle {
}
}
clip: true
- reportedVelocitySmoothing: 1000
}
Rectangle {
radius: 3
@@ -77,7 +76,7 @@ Rectangle {
color: "yellow"
MouseArea {
anchors.fill: parent
- onClicked: flick.overShoot = flick.overShoot > 0 ? 0 : 30
+ onClicked: flick.boundsBehavior = flick.boundsBehavior == Flickable.StopAtBounds ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
}
}