Results 1 to 2 of 2

Thread: QGLWidget window redrawing contents when losing focus

  1. #1
    Join Date
    Feb 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QGLWidget window redrawing contents when losing focus

    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.

  2. #2
    Join Date
    Feb 2009
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGLWidget window redrawing contents when losing focus

    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?
    Last edited by Barry79; 3rd April 2009 at 14:56.

Similar Threads

  1. correct event for lose focus in a QGLWidget window
    By john_god in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2009, 02:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.