diff options
Diffstat (limited to 'tests/auto/quick/qquicklistview/data/qtbug-21742.qml')
-rw-r--r-- | tests/auto/quick/qquicklistview/data/qtbug-21742.qml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/qtbug-21742.qml b/tests/auto/quick/qquicklistview/data/qtbug-21742.qml new file mode 100644 index 0000000000..774f9041fb --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/qtbug-21742.qml @@ -0,0 +1,36 @@ +import QtQuick 2.0 + +Rectangle { + height: 200 + width: 200 + property int count: menuView.count + + Component.onCompleted: { setModel(); } + + function setModel() + { + menuModel.append({"enabledItem" : true}); + menuView.currentIndex = 0; + } + + ListModel { + id: menuModel + } + + ListView { + id: menuView + anchors.fill: parent + model: menuModel + delegate: mything + } + + Component { + id: mything + Rectangle { + height: 50 + width: 200 + color: index == menuView.currentIndex ? "green" : "blue" + } + } + +}
\ No newline at end of file |