PDA

View Full Version : QTransform rotation differs from setRotation() upon transformation origin point



gentunian
29th September 2011, 00:18
Hi all! I'm new in this forum :)

I'm developing a pyqt application. It's a GUI client for a custom protocol for sharing and discussing images, so I'm using plenty of the Qt View Framework.

The problem I have is the following I have asked in stackoverflow:

http://stackoverflow.com/questions/7577371/qt-using-qtransform-object-for-rotate-differs-from-setting-setrotation-in-qgra

Basically, when I create a transformation matrix for rotating an item and then apply that transformation to the item differs from setting the item method QGraphicsItem::setRotation() in what the transformation origin point matter.

No matter if I set the QGraphicsItem::setTransformOriginPoint() when using a custom transformation matrix object. As I mention in the stack overflow question, I read the C++ source code for QGraphicsItem but things gets even more confusing to me for two reason:

* I don't know much about C++ (but I can read C code)
* And the item transformation has a special field for the rotation while using QGraphicsItem::setRotation() that Qt Doc says this will be combined with all transformations.

I really need help here. I dig up as long as I could before asking anything and this problem I'm having has some weeks in my project =(

Hope somebody could help, if my project code is needed I could leave the link here. It's hosted in google code and it's GPL.
Best Regards,