Create OpenGL 3.2 context on windows through Qt


I have succeeded in creating an OpenGL 3.2 context on Ubuntu using a QWidget with Qt 4.6 (and GLX). I would like to make it work on Windows with WGL.

For now, my context is created and I can display on it using the QWidget::paintEvent(…) method. The problem is that the content is only displayed when I am resizing the windows and it looks like it’s drawn one time and then cleared with black (whereas my glClearColor is red…).

Do you have any idea why the content is erased just after it’s drawn ?

Thank you very much.