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.
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.