Probably the easiest way to do this is to use a QTimer and a Boolean member variable that you set when the windows is resizing. When you get the first resize event, set the Boolean to true and start the timer with a short timeout (say 250 ms). Each time you get another resize event, you stop the timer if it is still running and then restart it. In your paint event, you check the Boolean to see if you are in the middle of the resize. If you are, then you don't do anything, otherwise you process your paint event normally.
In the QTimer's timeout handler, you set the Boolean to false and call update() for force a repaint.
The logic is that as long as the user is resizing the window, the timer will continue to be reset and the paint event bypassed. Once the mouse stops moving, the timer fires and the window repaints. You could do this without the Boolean and simply check QTimer::isActive() in the paint event, but I prefer having the Boolean just for debugging purposes.
It usually makes things look nicer to not completely ignore the paint event, but to paint something else (like just fill the window rect) so the user isn't looking at some partially painted window. If you wanted to get really fancy, you could render the window to a pixmap at the start of the resize, and then paint it to the window with scaling. It'll give the impression of a resized window but without the overhead of repainting the real thing..
Bookmarks