We have a child widget that uses opengl, and this widget is a child of a tabview. And if another application, and some QMenus of our own process, overlaps our opengl widget,only the area that was overlapped never gets redrawn... and the pixels that do not get updated are that only of what was not overlapped. We need to switch tabs or minimize and restore the window for it to get restored, or sometimes it fixes itself after several seconds. We have one machine that almost never exhibits this behavior, and others where it is 100% consistent. We have the following attributes set for the widget:

Qt Code:
  1. setAutoFillBackground( false );
  2. setAttribute (Qt::WA_OpaquePaintEvent);
  3. setAttribute( Qt::WA_NoSystemBackground );
  4. setAttribute( Qt::WA_NativeWindow );
  5. setAttribute( Qt::WA_PaintOnScreen, true );
  6. setAttribute( Qt::WA_StyledBackground,false);
To copy to clipboard, switch view to plain text mode 

Is there a way to invalidate this region for qt to auto correct this or another solution to this problem? To clarify, we use our own QWidget for rendering with OpenGL, not a OGLWidget.

We have tried removing Qt::WA_OpaquePaintEvent, with no effect. We have also tried placing the following within the paintEvent:

HWND winId = this->winId ();
r.left = 0;
r.top = 0;
r.bottom = fHeight_;
r.right = fWidth_;

BOOL result = InvalidateRect (winId, &r, true);
This fixes the problem but creates constant flashing. We have also tried calling that every x seconds using a QTimer, but the flash every few seconds is very noticeable. We have also tried:

HWND winId = this->winId ();
BOOL result = InvalidateRgn(winId, NULL, false);
Within the paintEvent, this causes other parts of the GUI to become very slow and minimally responsive, especially tabs and context menus. If we run the code every x seconds via a QTimer, it has no effect on the problem.

Any ideas?