summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativepathview
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-26 08:13:29 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-26 08:13:29 (GMT)
commitc4448162a00b6a069b562756d5608d821f700546 (patch)
tree9a3f9d56ced1ba229aef983721b09d0577c3e2c3 /tests/auto/declarative/qdeclarativepathview
parentd432123cec9ac927ec9162fa8b3d16684483f994 (diff)
downloadQt-c4448162a00b6a069b562756d5608d821f700546.zip
Qt-c4448162a00b6a069b562756d5608d821f700546.tar.gz
Qt-c4448162a00b6a069b562756d5608d821f700546.tar.bz2
Added highlight ranges/modes to PathView
Task-number: QT-319
Diffstat (limited to 'tests/auto/declarative/qdeclarativepathview')
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/displaypath.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview0.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview3.qml4
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml3
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp19
5 files changed, 16 insertions, 12 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml b/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml
index ab1538b..eded122 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/displaypath.qml
@@ -33,7 +33,6 @@ Rectangle {
height: 320
model: testModel
delegate: delegate
- snapPosition: 0.0001
path: Path {
startY: 120
startX: 160
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
index 8e2c251..1866875 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
@@ -48,7 +48,6 @@ Rectangle {
height: 320
model: testModel
delegate: delegate
- snapPosition: 0.0001
highlight: Rectangle {
width: 60
height: 20
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
index f1bc66e..b143294 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview3.qml
@@ -3,7 +3,9 @@ import Qt 4.6
PathView {
id: photoPathView
y: 100; width: 800; height: 330; pathItemCount: 4; offset: 1
- dragMargin: 24; snapPosition: 0.50
+ dragMargin: 24
+ preferredHighlightBegin: 0.50
+ preferredHighlightEnd: 0.50
path: Path {
startX: -50; startY: 40;
diff --git a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml
index db70b7b..1ae1ad2 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/propertychanges.qml
@@ -17,7 +17,8 @@ Rectangle {
}
PathView {
- snapPosition: 0.1
+ preferredHighlightBegin: 0.1
+ preferredHighlightEnd: 0.1
dragMargin: 5.0
id: pathView
objectName: "pathView"
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 6d7cc0d..4d43c68 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -194,7 +194,7 @@ void tst_QDeclarativePathView::initValues()
QCOMPARE(obj->model(), QVariant());
QCOMPARE(obj->currentIndex(), 0);
QCOMPARE(obj->offset(), 0.);
- QCOMPARE(obj->snapPosition(), 0.);
+ QCOMPARE(obj->preferredHighlightBegin(), 0.);
QCOMPARE(obj->dragMargin(), 0.);
QCOMPARE(obj->count(), 0);
QCOMPARE(obj->pathItemCount(), -1);
@@ -255,7 +255,7 @@ void tst_QDeclarativePathView::pathview2()
QVERIFY(obj->model() != QVariant());
QCOMPARE(obj->currentIndex(), 0);
QCOMPARE(obj->offset(), 0.);
- QCOMPARE(obj->snapPosition(), 0.);
+ QCOMPARE(obj->preferredHighlightBegin(), 0.);
QCOMPARE(obj->dragMargin(), 0.);
QCOMPARE(obj->count(), 8);
QCOMPARE(obj->pathItemCount(), 10);
@@ -273,7 +273,7 @@ void tst_QDeclarativePathView::pathview3()
QVERIFY(obj->model() != QVariant());
QCOMPARE(obj->currentIndex(), 0);
QCOMPARE(obj->offset(), 1.0);
- QCOMPARE(obj->snapPosition(), 0.5);
+ QCOMPARE(obj->preferredHighlightBegin(), 0.5);
QCOMPARE(obj->dragMargin(), 24.);
QCOMPARE(obj->count(), 8);
QCOMPARE(obj->pathItemCount(), 4);
@@ -534,22 +534,25 @@ void tst_QDeclarativePathView::propertyChanges()
QDeclarativePathView *pathView = canvas->rootObject()->findChild<QDeclarativePathView*>("pathView");
QVERIFY(pathView);
- QSignalSpy snapPositionSpy(pathView, SIGNAL(snapPositionChanged()));
+ QSignalSpy snapPositionSpy(pathView, SIGNAL(preferredHighlightBeginChanged()));
QSignalSpy dragMarginSpy(pathView, SIGNAL(dragMarginChanged()));
- QCOMPARE(pathView->snapPosition(), 0.1);
+ QCOMPARE(pathView->preferredHighlightBegin(), 0.1);
QCOMPARE(pathView->dragMargin(), 5.0);
- pathView->setSnapPosition(0.4);
+ pathView->setPreferredHighlightBegin(0.4);
+ pathView->setPreferredHighlightEnd(0.4);
pathView->setDragMargin(20.0);
- QCOMPARE(pathView->snapPosition(), 0.4);
+ QCOMPARE(pathView->preferredHighlightBegin(), 0.4);
+ QCOMPARE(pathView->preferredHighlightEnd(), 0.4);
QCOMPARE(pathView->dragMargin(), 20.0);
QCOMPARE(snapPositionSpy.count(), 1);
QCOMPARE(dragMarginSpy.count(), 1);
- pathView->setSnapPosition(0.4);
+ pathView->setPreferredHighlightBegin(0.4);
+ pathView->setPreferredHighlightEnd(0.4);
pathView->setDragMargin(20.0);
QCOMPARE(snapPositionSpy.count(), 1);