[Development] Under Windows QWindow receiving QExposeEvent on window drag.

Trent Reed treed0803 at gmail.com
Sun Jan 18 06:04:02 CET 2015


I am attempting to animate a QOpenGLWindow, so I'm connecting
SIGNAL(frameSwapped()) with SLOT(update()) to force update on vsync as
recommended in the documentation. So far so good, under *nix OSes this
works fine. (Tested on x64 Ubuntu and OS X)

But on Windows, when dragging a window around, the QExposeEvent gets sent
out while dragging the window, causing the window to lag noticeably. (This
does NOT happen on *nix OSes!)

I am able to "hack" a fix by caching the previous QRegion in my derived
QOpenGLWindow class, and checking to see if the new exposeEvent->region()
is the same as the cached QRegion. If the cached region is the same, I
ignore the event. If they are different, I pass it down to QOpenGLWindow.
This appears to fix the problem.

Here is my change that fixes the problem under my own project:
https://github.com/TReed0803/QtOpenGL/commit/f243e879b1d639fd838deffd6b2ca095062addc1

I feel I shouldn't have to do this, it seems kind of hacky. Is this a bug?

Thanks,
- Trent Reed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150117/ebe1161e/attachment.html>


More information about the Development mailing list