QGridLayout issue



  • I have a problem with when setting my centralwidget with QGridLayout. I have three widgets in my centralwidget. One is one bar in the top that covers all the horizontal length of the centralwidget and the other two are two frames, one square in the left and other one in the right.

    My purpose is that the top bar won't change vertically and the left square can expand both vertical and horizontal, and the right on stays without expansion and always in the right corner of the centralwidget giving the left one space to expand.

    The problem is when setting the size policy of the right one. If I put fixed the left one will take all the space.

    I don't know if you get the idea. Sorry, this is the best I can explain. I would be very appreciated if you could help me.



  • how about setting right widget's min,max size to some fixed size you want?

    @
    rightWidget->setMaximumSize(someFixed);
    rightWidget->setMinimumSize(someFixed);
    @



  • It worked, thank you, but now I just have one problem, what if I want the left square to increase only proportionally, being always a square.



  • @jys0224
    I know it's old but you can set minimum height and width for other widgets . It worked for me .


Log in to reply
 

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