Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
5.0.0
-
None
-
4e931c4a436ea3dcf6e1921488771aa1e79eda13
Description
Run the code below. Note the output to the console, which is as expected.
Comment out the first for-loop, and comment in the other one. Run again and
note that the output to the console is now "child: 4" rather than the expected.
import QtQuick 2.0 Rectangle { width: 400; height: 600 Column { anchors.centerIn: parent spacing: 3 Repeater { model: 3 delegate: Rectangle { width: 50; height: 50; color: "blue" } } Component.onCompleted: { for(var i = 0; i < children.length; i++) { // works print("child: " + children[i].toString()); } // for(var i in children) { // doesn't work // print("child: " + children[i].toString()); // } } } }