summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-05-27 14:30:23 +1000
committerMartin Jones <martin.jones@nokia.com>2010-05-27 14:30:23 +1000
commit0da1b076bf4e33f239ebe9dc4d8f5363ee24110b (patch)
tree3795ad9240f513edd8459e09cacbfb5fb600aaa9 /tests
parenta9462494b6eb5e07f8320cf7d99bdad9c9917434 (diff)
If a pathview delegate changes size, reposition center on path
Task-number: QTBUG-11006
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/pathview0.qml6
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
index a3afd38dc9..895620524d 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
@@ -4,6 +4,8 @@ Rectangle {
id: root
property int currentA: -1
property int currentB: -1
+ property real delegateWidth: 60
+ property real delegateHeight: 20
width: 240
height: 320
color: "#ffffff"
@@ -13,8 +15,8 @@ Rectangle {
Rectangle {
id: wrapper
objectName: "wrapper"
- height: 20
- width: 60
+ height: root.delegateHeight
+ width: root.delegateWidth
color: PathView.isCurrentItem ? "lightsteelblue" : "white"
border.color: "black"
Text {
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index f32a6c7796..dffc7ac35c 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -445,6 +445,12 @@ void tst_QDeclarativePathView::pathMoved()
pathview->setOffset(0.0);
QCOMPARE(firstItem->pos() + offset, start);
+ // Change delegate size
+ canvas->rootObject()->setProperty("delegateWidth", 30);
+ QCOMPARE(firstItem->width(), 30.0);
+ offset.setX(firstItem->width()/2);
+ QTRY_COMPARE(firstItem->pos() + offset, start);
+
delete canvas;
}