I have a vertical layout I'm filling with file names.
I have a QFileDialog to select files, then the slot is adding names to the layout.
fileNames = QFileDialog::getOpenFileNames(this, tr("Open File"), "./FilesToConvert", tr("Test Files (*.txt)"));
for each (QString item in fileNames)
QLabel *name = new QLabel(this);
You need some kind of automatic layout on the parent widget. For example, if mainLayout is a child widget of centralLayout, set the centralLayout to have vertical layout (or any other automatic layout). Than it will expand automatically.
If you break the layout of the parent, the size of the child widgets is fixed and does not update automatically.