PDA

View Full Version : QGLWidget window redrawing contents when losing focus



Barry79
3rd April 2009, 12:24
Hi,

I have two windows which I display as fullscreen on my two computer screens. One is a gui and one is a QGLWidget object. The problem I'm having is that when I click on the gui window, the contents of the gl window are redrawn (i.e. the screen flashes and I can see each object in the scene graph being redrawn). Therefore, if I click on a button on the gui, there is a half second delay while it waits for the screen to redraw. The sceen is also redraw when the gl window recieves focus again. While the gl screen has focus, I can navigate through it without any problems and there is no such redrawing.

What can I do to ensure that the whole window isn't redraw as described when it loses and gains focus?

Thanks for your help,

Barry.

Barry79
3rd April 2009, 13:37
In fact, the gui window itself is also blinking (and it looks like its widgets are being redrawn) as it gains and loses focus. In otherwords, when I click on it or click on the gl window.

If I do the following -

glWindow->setGeometry(QApplication::desktop()->availableGeometry(1));
glWindow->show() ;

I get a fullscreen gl window, and I get my problem,

But if I don't set the geometry, like so -

glWindow->show() ;

then I don't get the problem described above but I also don't get a full screen gl window.

paintGL() is called then the window gains and loses focus only if I have set the geometry, so this might have something to do with things.

Any ideas?