diff options
Diffstat (limited to 'tests')
-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; } |