Your idea seems to be very good for me. However I have problems adding the pixmap to the GraphicScene's origin, which is supposed to be in the scene's upper left border.
I tried the following:
view->setScene(scene);
pixmapItem->setPos(0, 0);
QGraphicsScene* scene = new QGraphicsScene(0, 0, 500, 500);
QGraphicsView* view = new QGraphicsView;
view->setScene(scene);
QPixmap pixmap = QPixmap::fromImage(image);
QGraphicsPixmapItem* pixmapItem = scene->addPixmap(pixmap);
pixmapItem->setPos(0, 0);
To copy to clipboard, switch view to plain text mode
however my image now appears somewhere (but not quite!) in the middle of my view.
Why doesn't it appear in the upper left corner? SetPos is supposed to work in parent's coordinates and when i print the scenePos() coordinates of the PixmapItem I get (0, 0)... But it's not there...
Does anyone have a clue?
Bookmarks