I have a reimplementation of QMainWindow, whose contents change size dynamically. When they shrink, I can't get MainWindow to shrink along with them. When I manually adjust the size of the window, it automatically snaps to the right size, but no combination of setGeometry(), resize(), adjustSize() or fiddling with size policies and size hints has worked. I fumbled across a solution by calling:

Qt Code:
  1. hide();
  2. showMinimized();
  3. show();
  4. showNormal();
  5.  
  6. QResizeEvent *event = new QResizeEvent( QSize(0,0), QSize(0,0) );
  7. QCoreApplication::sendEvent( this, event );
To copy to clipboard, switch view to plain text mode 

which works.. but obviously isn't ideal. And I'm not quite sure why it works. Anyone have any thoughts?