Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This issue could be caused by incorrect settings of the size policies or stretch factors of the widgets within the QFormLayout. To solve this, you can try adjusting the following:

  1. set the horizontal stretch factor of the labels to 1 and the fields to 2 or more to allow the fields to take up more horizontal space
  2. set the vertical size policy of the labels and fields to "MinimumExpanding" so they will adjust their size based on available space
  3. use QSizePolicy::Expanding for the size policy of the QFormLayout to allow it to expand and shrink according to the size of its parent widget
  4. adjust the margins of the QFormLayout to give more space between the rows.

You may need to experiment with these settings to find the optimal values for your layout.