[Development] OpenGL sluggishness on Qt5 vs Qt4

Dov Grobgeld dov.grobgeld at gmail.com
Sat Nov 22 22:16:49 CET 2014

Thanks Reaud and Mathew! The s/update/updateGL/ fixed the problem!

Btw, I initially copied the use of updateGL() from
.../examples/opengl/hellogl/glwidget.cpp, which still (git HEAD) uses it.
Shouldn't this be changed for the same reason as well?


On Fri, Nov 21, 2014 at 11:39 PM, Matthew Woehlke <
mw_triad at users.sourceforge.net> wrote:

> On 2014-11-21 05:22, Renaud wrote:
> > I saw in your small example  that you use "updateGL()", I suggest you to
> > change it to "update()".
> >
> > It may help the performance on Qt5.
> Hoo boy... I'm not sure why this would work better on Qt4 (see possible
> idea, below), but updateGL() *IMMEDIATELY* calls your paintGL, i.e.
> forces an immediate render to occur and don't return until the render is
> completed. You *almost never* want to do that (if you're about to grab
> the buffer is probably the only time you would). If you do that in a
> mouse event handler, then (referring to your original observation) you
> will indeed get a render for every mouse event that is processed.
> update() on the other hand tells Qt that your widget needs to be
> repainted "some time". In particular, "some time" generally means "when
> you're done processing outstanding events". This will let you handle a
> bunch of mouse events, do whatever changes you need, and then paint
> (render) once all of them have been handled.
> It may be that in Qt4 there is some coalescing of mouse events happening
> that is not happening in Qt5.
> At any rate, you will probably get much more similar performance with
> update() vs. updateGL().
> --
> Matthew
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20141122/54930645/attachment.html>

More information about the Development mailing list