PDA

View Full Version : mirror for QGraphicsItem



jobrandt
14th March 2007, 08:34
QGraphicsItem has the functions rotate, translate, shear. But i need the function mirror.
This function should mirror the graphic at the x-axis and/or the y-axis.
E.g. if "/ " is a graphic and it is mirrored to the y-axis it becomes "\".
Is such a function implemented or how can i implement it.

camel
14th March 2007, 08:53
Is such a function implemented or how can i implement it.

Try scale with a negative value? ;-)

Or if you like to control everything, you can create the matrix yourself and call QGraphicsItem::setMatrix. See also The Graphics view Coordinate System (http://doc.trolltech.com/4.2/graphicsview.html#the-graphics-view-coordinate-system)

jobrandt
14th March 2007, 09:09
scale() works very good.
I have used scale(-1,1) to mirror to the x-axis and scale(1,-1) for the y-axis.
scale(-1,-1) should mirror to the origin, but i have not tried this.