Hi all, I'm new QT so please excuse the following if it's obvious.

There seems to be two item-based coordinate systems for QGraphics items (at least for translations) and they seem to be independent and have a cumulative effect. One you can access via setPos(), moveBy() etc the other via translate() etc by setting the transform matrix.

I've read in other posts that translate() is only provided for "completeness" and we should use pos() and setPos(), and in the API docs that translate and moveBy are "conceptually separate" . I'm of a mathematical bent and I like affine transforms. I want to set up complex nested transformations which just amounts to matrix multiplication for the affine coordinate system, but it would be a real pain to have to set all movements in a separate co-ordinate system from scaling and rotations ...

Here is an example (it's pyqt but should be clear)...

I've created an item in a scene, initially the scenePos and pos are the same:
Qt Code:
  1. >>> self.scenePos()
  2. PyQt4.QtCore.QPointF(10.0, 10.0)
  3. >>> self.pos()
  4. PyQt4.QtCore.QPointF(10.0, 10.0)
To copy to clipboard, switch view to plain text mode 

the translation shows 0,0:
Qt Code:
  1. >>> t=self.transform();t.dx();t.dy()
  2. 0.0
  3. 0.0
To copy to clipboard, switch view to plain text mode 

now translate it to the origin in scene coords:
Qt Code:
  1. >>> self.translate(-10,-10)
  2. >>> t=self.transform();t.dx();t.dy()
  3. -10.0
  4. -10.0
  5. >>> self.scenePos()
  6. PyQt4.QtCore.QPointF(0.0, 0.0)
  7. >>> self.pos()
  8. PyQt4.QtCore.QPointF(10.0, 10.0)
To copy to clipboard, switch view to plain text mode 
you'll notice that the translation and pos coordinate systems are working against each other to have no net effect in the scene coordinates

Now we can move it back with moveBy() which affects the pos() coordinate system not the translation coordinate system:
Qt Code:
  1. >>> self.moveBy(10,10)
  2. >>> self.scenePos()
  3. PyQt4.QtCore.QPointF(10.0, 10.0)
  4. >>> self.pos()
  5. PyQt4.QtCore.QPointF(20.0, 20.0)
  6. >>> t=self.transform();t.dx();t.dy()
  7. -10.0
  8. -10.0
To copy to clipboard, switch view to plain text mode 

I guess my question boils down to the following: since the affine transform coordinate system is much nicer and richer than the separate movement coordinate system, is it OK to base my code just on the former and always have the pos() at (0,0) or will this bite me later with things like boundingRect() shape() etc ?