Hi everyone,
I am a little confused by the QGraphics framework coordiantes system. If I add a QGraphicsRectItem to a QGraphicsScene by the function
QGraphicsRectItem * QGraphicsScene::addRect ( const
QRectF &
rect, const QPen &
pen = QPen(), const QBrush &
brush = QBrush() ), let's say the QRectF is given as QRectF(x, y, Width, Height), how do those values correspond to the scene coordinates? I can see that the top-left corner of the item I added in the scene is (x,y), so I assume the first two arguments in QRectF(x,y, Width, Height) mean the scene coordinates (or parent coordiantes). However, if I use QGraphicsItem::scenePos() to get the scene coordinates of the item I just added, it shows that it is (0,0). So I am totally lost. And my next question derived from the last one is, if I just create a QRectF item but don't add it to any scene or item, then what's the meaning of the first two arguments in the constructor? Any can help me? Thanks!
Cheers