[Qt-interest] Mirrored QGraphicsView

Oliver Demetz forenbeitraege at oliverdemetz.de
Tue Jul 28 13:46:46 CEST 2009


Thank you very much!!!!

scale(-1,1)

does what I want (for horizontal mirroring)!

Best regards,
Oliver

Andre Somers schrieb:
> 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 cooincide 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. 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