I should have posted the code I am using.
scene.setSceneRect(0,0,5000,5000)
scene.addItem(&testImage);
testImage.scale(.5,.5);
view.showMaximized();
view.setBackgroundBrush(Qt::black);
QGraphicsScene scene;
scene.setSceneRect(0,0,5000,5000)
QGraphicsPixmapItem testImage(QPixmap("./MOATHOUSE-FINAL.jpg"));
scene.addItem(&testImage);
testImage.scale(.5,.5);
QGraphicsView view(&scene);
view.showMaximized();
view.setBackgroundBrush(Qt::black);
To copy to clipboard, switch view to plain text mode
When I scroll the view to where the image is located scrolling becomes very choppy. I have tried both
testImage.
setCacheMode(QGraphicsItem::ItemCoordinateCache,
QSize((testImage.
boundingRect().
width(),testImage.
boundingRect().
height()));
testImage.setCacheMode(QGraphicsItem::ItemCoordinateCache,QSize((testImage.boundingRect().width(),testImage.boundingRect().height()));
To copy to clipboard, switch view to plain text mode
and
testImage.setCacheMode(QGraphicsItem::DeviceCoordinateCache);
To copy to clipboard, switch view to plain text mode
Setting the cache mode works until I change the scale again and then scrolling the view is slow again when the pixmap is displayed.
Bookmarks