I have the following layout:

Qt Code:
  1. <vl>
  2. <hl>
  3. <otherstuff/>
  4. </hl>
  5. <hl2>
  6. <tabwidget/>
  7. </hl2>
  8. <vl>
To copy to clipboard, switch view to plain text mode 

"Other stuff" includes a toggle button. If this button is toggled, i'd like to hide <tabwidget> or the entire <hl2> layout.
I cant seem to find a way to hide an entire layout, so i called setVisible() on the tabwidget:



Qt Code:
  1. ui.tabWidget->setVisible(ui.btnTog->isChecked());
  2. this->updateGeometry();
  3. this->update();
  4. ui.horizontalLayout_5->update();
To copy to clipboard, switch view to plain text mode 

As you can see i called all update/refresh related methods afterwards, but the dialog layout doesnt change.
That means there's a big, empty unused spot where the tabwidget used to be.


What do i have to do to force the widget to recalculate its layout and consider the now hidden tabwidget?