I need some help with layouts.



  • I'm trying to create a widget where some controls can resize while others cannot (specifically see this picture http://imgur.com/J0W6e9Y ). I've tried some combination of layouts but none of them worked as I intended. Can anyone help please ?



  • Sorry mate, but this kind of question will not yield smart replies. Play around with the size hints, "Preferred" and "Expanding" are usually the most useful. Read the documentation.



  • Hi,
    Try to set a fixed size to the widgets you want to stay the same and the rest in the layout should resize as you resize the window.It should be something like

    @
    ui->nameOfYourWidget->setFixedSize(size);
    @



  • I would suggest that you do not use setFixedSize() to set the size, it might complicate things in future.

    What I do suggest:

    1. Make the Horizontal and Vertical Size policies of each of the Group Boxes 'Minimum'.
    2. Make the Horizontal and Vertical size policies of the TextLabel Expanding.
    3. Add a vertical spacer under the 2 GroupBoxes

    That should give you what you are looking for (I hope).

    (see http://imgur.com/FPxZA6d )[edit: fixed link]

    Regards,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.