I have a QGraphicsScene to show some data points. Each data point is an QGraphicsItem object and added to the scene with QGraphicsScene::addItem() function. All data points are shown OK.

Then I want to add a text to the same scene. I use QGraphicsTextItem and the code looks something like:

QGraphicsTextItem *text = new QGraphicsTextItem("Data");
myScene->addItem(text);

But the text does not show up! Do I miss some settings for QGraphicsTextItem here? I checked some code examples on the forum and it looked as simple as above. Why mine does not work?

Also, if I want to put the text on a location on the scene, should I use QQGraphicsItem::setPos(x,y), where x and y are in scene coodinates?

Thanks a lot for any help!