PDA

View Full Version : QTransform rotate and scale order



qlands
22nd June 2010, 12:34
Hi,

I have an application that applies transformations to QGraphicsPolygonItems.

The working code is:


QTransform trans;
trans = trans.rotate(formerRotation);
trans = trans.scale(currentXFactor,currentYFactor);
setTransform(trans,false); //Replaces the tranformation


However if I first scale and then rotate the result is completely different as rotating and then scaling.

Any idea why?

SixDegrees
22nd June 2010, 12:53
Because the transformations are applied one at a time, in the order given, and the order in which transformations are applied makes a difference.

qlands
22nd June 2010, 13:06
Cool, Thanks.