PDA

View Full Version : Positioning of QFormLayout



Julieng031
28th August 2013, 22:37
Hello,

I have built a little QT-based application but I have a difficulty to correclty position a QFormLayout.

As it can be seen in the attached file, I have a QBoxLayout containing a form, a QFrame (separator line) and a graphic. I would like the QFormLayout to adjust in order to let as space as possible to the graphic but I did not succeed. Do you have any idea ? Thanks by advance !

9492

For information, I have used without success :


setSizeConstraint(QLayout::SetMinimumSize) on the QFormLayout
setSizeConstraint(QLayout::SetMaximumSize) on the graphic
setFieldGrowthPolicy(QFormLayout::FieldsStayAtSize Hint) on the QFromLayout

Santosh Reddy
29th August 2013, 05:49
Set minimum size policy on form, maximum size policy on graphics

(or)

While adding the widgets to the QVBoxLayout set the stretch as form=1, frame=1, graphic=2

Julieng031
29th August 2013, 10:13
Thanks a lot for your answer, the second solution works fine !



Set minimum size policy on form, maximum size policy on graphics


For my information, I know how to set sizepolicy to the graphic since it is a widget but I do not know how to do it on the form (it is a layout). I have found setsizeconstraint but not setsizepolicy or equivalent on a layout. Could you help me by giving the function or a reference to this function ?

Santosh Reddy
29th August 2013, 10:17
For layouts use setsizeconstraint

Julieng031
29th August 2013, 10:26
Ok, thanks again !