Dynamically create qml objects
-
wrote on 19 Jul 2011, 11:41 last edited by
Hi, is it possible, for example, to create dynamically some rectangles?
Something like this:
@function drawButtons (buttons) {
for(var i=0; i<buttons; i++){
//=====================
Rectangle{
id: eval('item' + i)
y: y_pos * i
width: width
height: height
color: "red"
}
//=====================
}
}@ -
wrote on 19 Jul 2011, 11:49 last edited by
"Dynamic Object Management in QML":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html.
-
wrote on 19 Jul 2011, 11:52 last edited by
Exactly what I was looking for. Missed while searching.
[quote author="Lukas Geyer" date="1311076161"]"Dynamic Object Management in QML":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html.[/quote]
1/3