Why does QPainter with underlying OpenGL module make some graphics items so bluray?
-
Hi, all! i wanna use OpenGL for handware acceleration, but a phenomenon troubled me. Some items in graphics scene became bluray, and they were very clear before I use OpenGL. What troubled me more, the other items are as clear as before.
Details:The item in the first picture is painted by Qt native GUI module. It's very clear.
The following pictures show the graphics painted by underlying OpenGL module:
The one below is part of my scene and has the same quality with that painted by native module. It works normally as before.
But this one is a terrible blur. This item and the item in Image1 are both instances of the same subclass of QGraphicsObject. Pixmap loaded is as clear as those image1 actually.
I used the codes below to set OpenGL as underlying module to render my view:
@
FitView(QGraphicsScene *scene) : QGraphicsView(scene) { //constructor
setSceneRect(Config.Rect); //Config saves user's setting data
setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing);#ifndef QT_NO_OPENGL
if (QGLFormat::hasOpenGL()) {
QGLWidget *widget = new QGLWidget(QGLFormat(QGL::SampleBuffers));setViewport(widget); setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); }
#endif
}
@Thank you for your concern!