I have this simple piece of code in a class constructor which is inherited from QGraphicsScene
:
setSceneRect(0,0,800,800);
addRect(sceneRect());
QGraphicsRectItem*r1 = addRect(200, 0, 5, 5);
qDebug()<<r1->pos();
Here I add a rect at pos(200,0) but qDebug()
prints QPointF(0, 0)
! I'm totally confused.
Even scenePos
returns (0,0)! Is it true?!