[Interest] QOpenGLWidget inside QDockWidget

Laszlo Agocs laszlo.agocs at qt.io
Tue Mar 28 10:02:34 CEST 2017


Hi,


Because it tears down and then reinitializes graphics resources when changing the associated top-level window. This does not explain the flicker, though. As a workaround try doing QCoreApplication::setAttribute(Qt:AA_ShareOpenGLContexts)  before constructing the QApplication.


See the sections starting with "Note: For widgets that change their associated top-level window ..." in http://doc.qt.io/qt-5/qopenglwidget.html#resource-initialization-and-cleanup


<http://doc.qt.io/qt-5/qopenglwidget.html#resource-initialization-and-cleanup>Best regards,

Laszlo





________________________________
From: Interest <interest-bounces+laszlo.agocs=qt.io at qt-project.org> on behalf of Alexandre Ribeiro <alexandregomesribeiro at gmail.com>
Sent: Monday, March 27, 2017 11:58:55 PM
To: interest at qt-project.org
Subject: [Interest] QOpenGLWidget inside QDockWidget

Hi,

I've placed a QOpenGLWidget inside a QDockWidget and everything works as expected.

However when I drag the dockwidget from the main window there's a blue flicker in the QOpenGLWidget. This blue flicker has nothing to do with my OpenGL code (right now it's merely clearing the background with red).

Any idea on what might be happening?

Best regards,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170328/21cd4dce/attachment.html>


More information about the Interest mailing list