View Full Version : dynamic object id
jovin
29th April 2012, 23:47
Hello,
Repeater {
model: 10
MyWindow {
id: "mywindownumber" + index
x: 20 + index * 30
y: 200
}
}
It's obviously not working, but is there a way to achieve something similar?
hurmatt
30th April 2012, 05:17
Maybe it's possible to use dynamically created components, which you can refer to by the Javascript variable but only within a function (http://qt-project.org/doc/qt-4.8/qdeclarativedynamicobjects.html). I use this method for creating and destroying dynamic components.
You can also create a component from a QML file (http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedocuments.html) but I don't know if you can assign the id after it's created.
there s an itemAt(index) method
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.