Can't get property values of text inside onCompleted
-
Hi. I was wondering how to get the values of parent properties in onCompleted. I can't read value of property which is set in c++ when reading it from onCompleted, too. My goal is to set the position of the text which does not depend on rotation of the image.
I stuck here:Item {
id:myThing property int rotationAngle: 0 //this property is set in c++ side
Image {
id: myImage antialiasing: true x: xCoordinate y: yCoordinate width: elementWidht height: elementHeight rotation: rotationAngle fillMode: cellFill smooth: cellSmooth source: "qrc:/pics/folder/Frame.svg" property string cname: "myImage" Component.onCompleted: { console.log(cname, "successfully created!"); } //print caption property alias text3: caption.text Text { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter id: caption //width: parent.width height: 29 color: "red" text: "dynamically changed text..." font.pointSize: 9 rotation: 360- parent.rotation //here parent rotation is not 0 Component.onCompleted: { console.log(parent.rotation) // here rotation is 0...? if(rotationAngle == 180) { console.log("here") anchors.top =parent.bottom } } }
}