I have been toying with this piece of code:
QGraphicsLineItem * anotherLine = this->addLine(50,50, 100, 100);
qDebug() << anotherLine->scenePos();
QGraphicsLineItem * anotherLine2 = this->addLine(80,10, 300, 300);
qDebug() << anotherLine2->scenePos();
Where the this
pointer refers to a QGraphicsScene
. In both cases, I get QPointF(0,0)
for both output.
From reading the document, I thought scenePos()
is supposed to return the position of the line within the scene, not where it is within its local coordinate system. What am I doing wrong?