Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Possible to tell the number of an item within a repeater?

$
0
0
Hi, You can use the index property inside the Repeater. Based on it you can set the images. For eg. Item {     width: 400     height: 400       Repeater {         id: repeater         model: 5         Rectangle {             x: index * 50             y: 0             width: 50             height: 50             color: '#'+Math.floor(Math.random()*16777215).toString(16)         }     } } Here i have used index property to change x property of every Rectangle in the repeater. Is this what you expect ?

Viewing all articles
Browse latest Browse all 4972

Trending Articles