[Qt-interest] Mirrored QGraphicsView
Andre Somers
andre at familiesomers.nl
Tue Jul 28 13:51:50 CEST 2009
(first send to Oliver directly by accident)
Oliver Demetz wrote:
> Hi,
>
> in principle this should be not a problem,
> but I was wondering how to set the display
> mode of a QGraphicsView to be *mirrored*?
>
> Mirrored for me means to either flip the
> displayed contents horizontically or vertically.
> This would conincide with a 180-degree-rotation
> around the y-axis or the x-axis, respectively.
>
No, it would not coincide with a rotation, unless your scene is rotation
symetric. Try it with a piece of text on a paper in front of a mirror...
> I cannot find a direct switch in the docs to
> realise this goal, and the QMatrix class represents
> a 3x3 matrix, not a 4x4 one which would be needed
> to rotate as described.
>
AFAIK, you need only a 3x3 matrix to do what you want. The basic idea is
to scale with a factor of -1 in either the x or the y axis. All you need
to do then is to translate the result so it will fit the original
coordinate system again.
André
More information about the Qt-interest-old
mailing list