[Interest] QOpenGLWidget inside QDockWidget

Alexandre Ribeiro alexandregomesribeiro at gmail.com
Tue Mar 28 14:27:53 CEST 2017


Thanks, this solved it.

I would probably end up sharing the context between all QOpenGLWidget so I
guess your workaround is a permanent solution for this app.


On Tue, Mar 28, 2017 at 9:02 AM, Laszlo Agocs <laszlo.agocs at qt.io> wrote:

> 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/71d2cd2a/attachment.html>


More information about the Interest mailing list