PDA

View Full Version : GLWidget lags behind



waveydavey
9th October 2006, 11:50
Hi,

I've added a GLWidget as a child to a custom widget. However, when I move the GLWidget around it seems to lag a little, as in-- it seems to be painted at the previous spot that the parent widget was on.

This also happens when I replace the GLWidget with a DirectX-based widget. I've set the proper flags (NoPaintBackground, OpaquePaintEvent, etc). Also, in the places where the widget is *supposed* to paint, Qt doesn't fill the background, resulting in ugly flicker. The DirectX widget does a 'present' call in the paintEvent to the winId() of the window, but again, the problem is present in the GL Widget as well.

This makes resizing and moving the window look pretty bad, and although I currently have 'fixed' it by doing resizes and moves with QRubberBand, I'd still like to fix this.

wysota
13th October 2006, 21:15
Can you provide a minimal compilable example (using QGLWidget) which reproduces the problem?

waveydavey
19th October 2006, 16:18
Hi, I have attached a minimal example (cpp + moc).

It shows a green background containing a smaller widget with a red background containing a GL Widget (the trolltech 3d-logo, taken from the examples). The smaller widget moves horizontally using a sine function.

Now, not only can you see the GL Widget lagging behind the red window (its parent), you can even occasionally see the green background at the seams where the red window and the GL Widget meet.

Clearly this shouldn't be happening, should it?