I have used QPixmapItem to display the images in a QGraphicsview viewport. I'm loading thousands of pixmaps at a time. So I decided to set some options to cache the pixmaps I'm loading for the images. Here's what I've done:
View->scene()->setItemIndexMethod(QGraphicsScene::NoIndex);
View->setRenderHint(QPainter::Antialiasing, false);
QGLFormat fmt;
fmt.setSampleBuffers(true);
fmt.setSamples(2);
//View->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
View->setViewport(new QGLWidget(fmt));
View->setOptimizationFlags(QGraphicsView::DontSavePainterState | QGraphicsView::DontAdjustForAntialiasing);
View->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
View->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
View->setCacheMode(QGraphicsView::CacheBackground);
If I don't use QGLWidget and OpenGL as viewport of QGraphicsVIew the pixmaps are looking normal, but if I use OpenGL viewport, the rendered pixmaps are looking "blurred". The "blurred" case is on the left, normal on the right.