PDA

View Full Version : How to set the location of an item in a scene



slewrate
16th May 2012, 21:43
Hello, I have the following code:



void MainWindow::on_actionTest_triggered()
{
QGraphicsScene* scene = new QGraphicsScene();
QGraphicsPixmapItem* item;
QImage image("test.JPG");
item = new QGraphicsPixmapItem(QPixmap::fromImage(image));
scene->addItem(item);
ui->graphicsView->setScene(scene);

}


I have no idea how I can set the location for the image.
Any suggestions would be appreciated.

amleto
17th May 2012, 09:38
rtfm :)

http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#setPos