[Qt-interest] Layout problem in QtDesigner
Robert Hairgrove
evorgriahr at hispeed.ch
Sun Dec 13 09:26:47 CET 2009
Robert Hairgrove wrote:
> I am trying to create a dialog for a contact management application. The
> layout I am trying to achieve is your standard database entry form:
> labels are right-aligned in a column on the left next to the
> corresponding line edit controls.
>
> If there is only one label and one line edit per row, everything works
> fine by putting the labels and edit controls in their corresponding
> vertical layouts, then putting both the layouts in a horizontal layout.
>
> Unfortunately, as soon as I include sublayouts or buttons in the scheme,
> I cannot get the labels on the left to line up with their edit controls
> anymore. The text "creeps" down towards the bottom of the window.
OK, I found a solution -- the vertical spacer has a property "sizeType"
which defaults to "Expanding". For the spacer on the left in the labels
column property, I changed this to "Maximum" and set its vertical size
equal to 27 which is the height of the line edit controls. Now they line
up perfectly!
More information about the Qt-interest-old
mailing list