diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-05-27 04:30:23 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-05-27 04:30:23 (GMT) |
commit | 0da1b076bf4e33f239ebe9dc4d8f5363ee24110b (patch) | |
tree | 3795ad9240f513edd8459e09cacbfb5fb600aaa9 /tests/auto/declarative | |
parent | a9462494b6eb5e07f8320cf7d99bdad9c9917434 (diff) | |
download | Qt-0da1b076bf4e33f239ebe9dc4d8f5363ee24110b.zip Qt-0da1b076bf4e33f239ebe9dc4d8f5363ee24110b.tar.gz Qt-0da1b076bf4e33f239ebe9dc4d8f5363ee24110b.tar.bz2 |
If a pathview delegate changes size, reposition center on path
Task-number: QTBUG-11006
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qdeclarativepathview/data/pathview0.qml | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp | 6 |
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 a3afd38..8956205 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 f32a6c7..dffc7ac 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; } |