Transform only parent Item
-
How to transform only parent item without affection on children?
For example
@
Rectangle {
id: panel
width: 400
height: 200
x: parent.right-width/2
color: "white"
anchors.bottom: parent.bottom
clip: truetransform: Rotation { origin.x: page.width; origin.y: page.height; axis {x:0; y:0; z:1} angle:0 NumberAnimation on angle { from: 0; to: 90; duration: 3000; loops: Animation.Infinite } } Image { id: image1 x: 16 y: 27 source: "images/qt.svg" } }
@
I don't want rotate Qt logo, just stick in "World Position" and hide when parent bounding box live this coordinates.
-
You could place the Image at the appropriate offset on a transparent rectangle (or perhaps just a plain Item element) which was anchored at the exact point of panel's rotation, then set the transparent container's rotation to the opposite of pane's (container.rotation: -panel.rotation).
-
[quote author="mlong" date="1299275809"]You could place the Image at the appropriate offset on a transparent rectangle (or perhaps just a plain Item element) which was anchored at the exact point of panel's rotation, then set the transparent container's rotation to the opposite of pane's (container.rotation: -panel.rotation).[/quote]
Thanks, it's working
@
import QtQuick 1.0Rectangle {
id: mainRec
width: 600
height: 600
color: "grey"Rectangle { id: page anchors.centerIn: parent color: "black" width: 200 height: 400 clip: true Rectangle { id: pane width: 400 height: 400 x: parent.right-width/2 color: "white" clip: true anchors.bottom: parent.bottom transformOrigin: Item.Bottom NumberAnimation on rotation { from: 0; to: 90 duration: 3000 loops: Animation.Infinite } Item { id: container width: pane.width height: pane.height anchors.bottom: parent.bottom transformOrigin: Item.Bottom rotation: -parent.rotation Image { id: image1 x: 16 y: 27 source: "images/qt.svg" } } } }
}
@