Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
Description
Run the code below. Note that the three blue rectangles print
TypeError: Cannot call method 'toString' of null in their
Component.onCompleted while the green and yellow rects print
the name of their parents as expected.
import QtQuick 2.0 Rectangle { width: 400; height: 600 Row { anchors.centerIn: parent spacing: 3 Rectangle { width: 50; height: 50; color: "green" Component.onCompleted: { print(parent.toString()); } } Loader { sourceComponent: Rectangle { width: 50; height: 50; color: "yellow" Component.onCompleted: { print(parent.toString()); } } } Repeater { model: 3 delegate: Rectangle { width: 50; height: 50; color: "blue" Component.onCompleted: { print(parent.toString()); } } } } }