title: How to make a Qt widget invisible without changing the position of the other Qt widgets?
body: <p>I've got a window full of QPushButtons and QLabels and various other fun QWidgets, all layed out dynamically using various <code>QLayout</code> objects... and what I'd like to do is occasionally make some of those widgets become invisible.  That is, the invisible widgets would still take up their normal space in the window's layout, but they wouldn't be rendered: instead, the user would just see the window's background color in the widget's rectangle/area.</p>
  
  <p><code>hide()</code> and/or <code>setVisible(false)</code> won't do the trick because they cause the widget to be removed from the layout entirely, allowing other widgets to expand to take up the "newly available" space; an effect that I want to avoid.</p>
  
  <p>I suppose I could make a subclass of every <code>QWidget</code> type that override <code>paintEvent()</code> (and <code>mousePressEvent()</code> and etc) to be a no-op (when appropriate), but I'd prefer a solution that doesn't require me to create three dozen different <code>QWidget</code> subclasses.</p>