PDA

View Full Version : how can we put the text in some certain place with QGraphicsScene



learning_qt
27th November 2008, 14:29
I hope to use the function QGraphicsScene::addText() to put some texts in some specified place. But the default position is: (0,0).

How can I work around this problem?

Thanks!

aamer4yu
27th November 2008, 17:01
QGraphicsTextItem * QGraphicsScene::addText ( const QString & text, const QFont & font = QFont() )
it returns a graphics text item which is inherited from graphics item. You can set the position using QGraphicsTextItem ->setPos(x,y) ... :)

goldhappywang
21st April 2009, 04:07
I try it, but why my QGraphicsTextItem still at the default position is: (0,0).?

aamer4yu
21st April 2009, 06:25
You can set the position using QGraphicsTextItem->setPos(x,y) .
Did you try that too ??? setPos function ?