projects
/
profile
/
ivi
/
qtdeclarative.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Unit test for QTBUG-21742
[profile/ivi/qtdeclarative.git]
/
tests
/
auto
/
declarative
/
qsglistview
/
data
/
qtbug-21742.qml
1
import QtQuick 2.0
2
3
Rectangle {
4
height: 200
5
width: 200
6
property int count: menuView.count
7
8
Component.onCompleted: { setModel(); }
9
10
function setModel()
11
{
12
menuModel.append({"enabledItem" : true});
13
menuView.currentIndex = 0;
14
}
15
16
ListModel {
17
id: menuModel
18
}
19
20
ListView {
21
id: menuView
22
anchors.fill: parent
23
model: menuModel
24
delegate: mything
25
}
26
27
Component {
28
id: mything
29
Rectangle {
30
height: 50
31
width: 200
32
color: index == menuView.currentIndex ? "green" : "blue"
33
}
34
}
35
36
}