Are you sure anything at all is displayed? You instanciate a QGraphicsScene on stack so it gets deleted as soon as the program leaves the scope where it has been created (in this case the open() method...). You'd better allocate it on heap (i.e. using new) or make it a member of your mainwindow class.
scene->setSceneRect( -100.0, -100.0, 200.0, 200.0 );
//graphicsViewRaw is globally declared as QGraphicsView
graphicsViewRaw->setScene(scene);
graphicsViewRaw->show();
QGraphicsScene *scene = new QGraphicsScene;
scene->setSceneRect( -100.0, -100.0, 200.0, 200.0 );
QGraphicsPixmapItem *item = new QGraphicsPixmapItem(QPixmap::fromImage(image), 0, scene);
item->setShapeMode(QGraphicsPixmapItem::BoundingRectSha pe);
//graphicsViewRaw is globally declared as QGraphicsView
graphicsViewRaw->setScene(scene);
graphicsViewRaw->show();
To copy to clipboard, switch view to plain text mode
p.s : next time use put your code within [c o d e] and [/ c o d e] tags (withut spaces...
)
Bookmarks