diff options
author | Albert Astals Cid <albert.astals@canonical.com> | 2014-04-15 15:27:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-18 07:39:32 +0200 |
commit | 5772da7e911832e71634322345948b0c98d397bf (patch) | |
tree | 8526b8b4a782d3f1ff09b2aca783bd11d8bf1682 /tests/auto/qmltest/pathview | |
parent | dc051f28b865e54d3834824ffea6f2562f0836c1 (diff) |
QQuickItemView/QQuickPathView: Fix creation of delegates
When the delegate is set before the model and
after the ItemView/PathView has been created
Task-number: QTBUG-38368
Change-Id: I6963abe28087699cf4e8921153dc7641bae3b220
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'tests/auto/qmltest/pathview')
-rw-r--r-- | tests/auto/qmltest/pathview/tst_pathview.qml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/qmltest/pathview/tst_pathview.qml b/tests/auto/qmltest/pathview/tst_pathview.qml new file mode 100644 index 0000000000..820034c960 --- /dev/null +++ b/tests/auto/qmltest/pathview/tst_pathview.qml @@ -0,0 +1,35 @@ +import QtQuick 2.1 +import QtTest 1.0 + +Item { + id: top + + PathView { + id: pathViewDelegateModelAfterCreate + anchors.fill: parent + property int createdDelegates: 0 + path: Path { startX: 120; startY: 100 } + } + + Component { + id: delegateModelAfterCreateComponent + Rectangle { + width: 140 + height: 140 + border.color: "black" + color: "red" + Component.onCompleted: pathViewDelegateModelAfterCreate.createdDelegates++; + } + } + + TestCase { + name: "PathView" + when: windowShown + + function test_set_delegate_model_after_path_creation() { + pathViewDelegateModelAfterCreate.delegate = delegateModelAfterCreateComponent; + pathViewDelegateModelAfterCreate.model = 40; + verify(pathViewDelegateModelAfterCreate.createdDelegates > 0); + } + } +} |