-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
None
-
a9f1eaa6a368bf7a72b52c428728a3e3e0a76209
Run the code below and note the initial output in the console,
which is correct. Click the window, and note that number of items
printed in the console is 4 rather than 7, followed by an error.
import QtQuick 1.1 Item { width: 640 height: 480 Column { anchors.centerIn: parent Repeater { id: repeater model: 4 onModelChanged: printWidths() delegate: Rectangle { color: "red" width: (index+1)*50 height: 50 } } } Component.onCompleted: printWidths() function printWidths() { print("Repeater has " + repeater.count + " items") for(var i = 0; i < repeater.count; i++) { var c = repeater.itemAt(i); print("Width of item " + i + ": " + c.width) } } MouseArea { anchors.fill: parent onClicked: repeater.model = 7 } }