You need a layout for all widgets containing other widgets, starting from the top-most one. If your widget is derived from QWidget, you need to apply a layout on it as well (and on the groupbox). If it is derived directly from the groupbox, you need to apply a layout on the groupbox (and possibly on other widgets acting as containers).