I have a QGridLayout that has a number of widgets in six rows. Rows 1, 3 and 5 contain a QLabel, a QLineEdit and a QPushButton that opens up a file selection dialog. Rows 2, 4, and 6 contain a QLabel that is used to present validation errors to the user. The errors are hidden in the image below.
When the window is able to take up as much space as it likes, this issue does not appear. But when I restrict the size of the window at all, the elements in this list look like this:

So my question is, how do I ensure that all qwidgets in the QGridLayout can take up as much space as they need?
EDIT:
Following @Avaris’ suggestion, I tried calling setMinimumSize() for each widget in the QGridLayout (all 6 rows), and the visible elements look much better (thanks, @Avaris!). Yet now when I cause a validation error, the error itself (a red QLabel) is laid over the other widgets. Can I force the QGridLayout to not overlap?
Here’s what it looks like now:

While searching around for a solution, I found something in the TrollTech archives that supported @Avaris’s idea about setting the minimum size of the widget. The post suggests setting a minimum size for each widget in the QGridLayout.
My implementation looks like this as I loop through all elements to be added to my QGridLayout:
The validity of a hint varies on the layout used, but widget sizehints always seem to be valid when I use a QGridLayout.