import QtQuick 1.0
Item {
id: me
100
height: 300
GridView {
id: grid
anchors.fill: parent
model: 60
cellHeight: 20
cellWidth: 20
property int colcount: Math.floor(width / cellWidth)
delegate: Rectangle {
grid.cellWidth
height: grid.cellHeight
color: {
var rowIndex = Math.floor(index / grid.colcount);
switch (rowIndex % 3) {
case 0:
return "yellow";
case 1:
return "blue";
case 2:
return "grey";
}
}
Text {
anchors.centerIn: parent
font.pixelSize: 15
text: index
}
}
}
}