It is not just setPos(), but also setScale() and setRotation(), and setTransformations(), that do not affect the separate transform() matrix. (e.g. transform() returns the same matrix before and after a call to setScale().)
I won't argue which is the best approach for the API, but I will say that the Qt approach is not conventional: most graphics programming texts approach use a single transform matrix that a rotation operation would change.
And the Qt documentation must be read VERY carefully. For example: "The scale is combined with the item's rotation(), transform() and transformations() to map the item's coordinate system to the parent item." Why doesn't it mention pos()? Then you should follow the link to "Transformations" to learn what "combine" means. And "scale a transformation" is QTransform.scale(), not the same thing as calling "setScale()" on a graphic item. QTransform.scale() is a verb setter, QGraphicsItem.scale() is a noun getter. QTransform is separate from QGraphicsTransform. transform() is not the same as transformations(), even though both are noun getters with too similar names.
This discussion is related to how to serialize a QGraphicsItem. Do you need to serialize (pos(), scale(), rotation(), transform(), transformations()) or can you somehow get a single matrix representing all of those?
Bookmarks