diff options
Diffstat (limited to 'tests/auto/quick/qquickvisualdatamodel/data/setDelegateNoDoubleChange.qml')
-rw-r--r-- | tests/auto/quick/qquickvisualdatamodel/data/setDelegateNoDoubleChange.qml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickvisualdatamodel/data/setDelegateNoDoubleChange.qml b/tests/auto/quick/qquickvisualdatamodel/data/setDelegateNoDoubleChange.qml new file mode 100644 index 0000000000..05623fbc5b --- /dev/null +++ b/tests/auto/quick/qquickvisualdatamodel/data/setDelegateNoDoubleChange.qml @@ -0,0 +1,43 @@ +import QtQuick 2.0 + +Item { + width: 200 + height: 200 + id: root + property int creationCount: 0 + property bool testStarted: false + + ListModel { + id: mymodel + ListElement {message: "This is my alarm"} + } + + Component { + id: aDelegate + Rectangle { + color: "blue" + width: 100 + height: 100 + } + } + + Component { + id: bDelegate + Rectangle { + color: "red" + width: 100 + height: 100 + Text {text: model.message } + Component.onCompleted: root.creationCount++ + } + } + + + ListView { + width: 200 + height: 200 + id: myListView + model: mymodel + delegate: testStarted ? bDelegate : aDelegate + } +} |