PDA

View Full Version : [QPainter] difference SetWorldMatrix and setWorldTransform



Boy
5th March 2008, 15:43
Hi!

I have a question regarding QPainter::setWorldMatrix and QPainter::setWorldTransform...

in the Qt4 assistant in the description of setWorldMatrix it says:


Note: It is advisable to use setWorldTransform() instead of this function to preserve the properties of perspective transformations.

But when you check the implementation of QPainter::setWorldMatrix, it directly calls setWorldTransform:


void QPainter::setWorldMatrix(const QMatrix &matrix, bool combine)
{
setWorldTransform(QTransform(matrix), combine);
}


I don't even know what exactly is meant with 'preserve the properties of the perspective transformations', but I don't think it will give any different result calling one or the other function. Is this an error in the documentation or is it something that is planned for the future and not yet implemented?

wysota
5th March 2008, 20:57
But when you check the implementation of QPainter::setWorldMatrix, it directly calls setWorldTransform:
Not directly. It creates a 3D matrix out of 2D matrix first.


I don't even know what exactly is meant with 'preserve the properties of the perspective transformations', but I don't think it will give any different result calling one or the other function.
It depends on the transformation set previously.