flickering when using QGLWidget as the viewport of QGraphicsView

Home / Uncategorized / flickering when using QGLWidget as the viewport of QGraphicsView

Question:
I’m doing a project with qt 4.8.6 and running it on embedded system(x11). In the beginning, every thing is fine, but if I open a widget which has code QGraphicsView.setViewport(new QGLWidget) in constructor function, it will flicker.

If I replace the QGLWidget with QWidget, it is fine. By comparing the difference between QGLWidget and QWidget, I have tried this:QGraphicsScene* scene = new QGraphicsScene(this);
QGraphicsView* view = new QGraphicsView (scene,this);
view -> setViewport(new QGLWidget);

1 view->viewport()->setWindowFlags(Qt::Widget);
2 view->viewport()->setAutoFillBackground(false);
3 view->viewport()->setAttribute(Qt::WA_PaintOnScreen,false);
4 view->viewport()->setAttribute(Qt::WA_OpaquePaintEvent);

However this doesn’t fix the issue. What could be the issue?


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *