Mirroring in Flipable
-
I'm trying to use Flipable's back to draw some elements (text, rectangles...). Based on examples distributed with Qt code, I've done something like this:
@
Flipable {
id: flipable
back: Rectangle {
Text {
text: 'some text'
}
}transform: Rotation { id: rotation origin.x: flipable.width/2 axis { y: 1; z: 0 } } states: State { name: 'back' PropertyChanges { target: rotation angle: 180 } }
}
@My problem is that the elements disposed in the back of the Flipable are being displayed mirrored, and this is a big problem, specially for text.
What is getting me confused is that the examples in Qt code don't seem to have the same problem. Am I doing something wrong?
Thanks
-
Wow! I would never find it by myself! Thanks, Michael!
Is that behaviour intentional? Or is it more like a bug?
I'm asking it because it seems to be counterintuitive (at least for me) that a non-declared geometry property on a component has the side effect of a mirroring in it and its children. Why is it like this? -
Hi,
We calculate the transform for the back item by rotating it around the center x- and y-axis of the item. When the item has no geometry, the center is (0,0), which leads to flips. I'm not sure if there is a better method that could be used -- it certainly isn't intuitive to track down what's going wrong when you do hit this issue.
Regards,
Michael