Results 1 to 3 of 3

Thread: GLWidget lags behind

  1. #1
    Join Date
    Oct 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default GLWidget lags behind

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GLWidget lags behind

    Can you provide a minimal compilable example (using QGLWidget) which reproduces the problem?

  3. #3
    Join Date
    Oct 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: GLWidget lags behind

    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?
    Attached Files Attached Files

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.