Right now I'm displaying pixmaps at the central widget in a QMainWindow.

The problem is the pixmap does not auto-scale to smaller than the original size automatically, although I can scale it smaller using QPixmap::scaleTo().

The problem with using scaleTo() is I want to call it when the user is resizing the QMainWindow, but QMainWindow does not generate a resizeEvent() if the user is trying to make the window smaller than what the child widgets can hold. Since my QLabel that displays the pixmaps is always expanding, any shrinking of the window will be seen as too small for the child widgets and the resizeEvent function never gets called.

So I'm trying to figure out how I can catch the code when the user clicks on the sizeGrip so I can properly set the parameters in scaleTo().

I suppose I could subclass a QSizeGrip, re-implement the mouseClickEvent, and then disable the default QSizeGrip I get for free using the QMainWindow class.

Would that work? Is there a more elegant way to do it?