09-20-2012 05:38 AM
i would like to loop over about 50 components created manually in qml. They have ids like "comp1", "comp2", "comp3" and so on. So i thought i could use the following syntax inside the loop
["comp" + i].property
to address a components property, but it doesnt work.
Its strange because this kind of syntax works when accessing properties in qml:
console.log(main["testProperty"]) is the same and works
P.S. i know that i can do it with c++, but my goal is to do the view-related things in the qml-layer an i am just exploring how far i can go...
Solved! Go to Solution.
09-20-2012 07:51 AM
Ok, its not possible, but i just found another way to get the child components of a container:
container.controls gives an array of all children. Now i can easily loop with myContainer.controls[i] through all children of the container an set properties.