qt - Set rotation point of Rectangle -
is there way set rotation point in rectangle , use rotation property without other additional component? want rotate rectangle binding property of rotation: value * 180 this
rectangle{ id: body rotation: value anchors.centerin: parent.center antialiasing: true } onvaluechanged: body.rotation = value i got rotation around left upper corner of parent. please me understand behavior or suggest me way implement rotation on center.
rotation property rotates item clockwise around transformorigin property 1 of these 9 points :

so can rotate around 1 of them :
rectangle{ id: body rotation: value transformorigin: item.center anchors.centerin: parent.center antialiasing: true } if want rotate around arbitrary point should use rotation transform type :
rectangle{ id: body transform: rotation { origin.x: 25; origin.y: 25; angle: value} anchors.centerin: parent.center antialiasing: true }
Comments
Post a Comment