How to reduce the size of QVBoxLayout

  • Hello guys i have a QVBoxLayout and in that i have some qwidgets but when i run the code it displays a big QVBoxLayout and in that widget in that i want the QVBoxLayout to upto the size of widget so that no extra space should be dere in the QVBoxLayout.
    How can ia do this can u help me in this

  • Qt Champions 2017

    Layout does according to widget. Your QWidget should be guiding this. Can you check what is the size of the widget you are putting ? Did you check on setGeometry on layout ? Can you post your sample code ?

  • widget size is normal its not an issue.Issue is with size of QVBoxLayout

  • Hi,
    The layout will resize with the parent object. The widgets in the layout will resize accordingly. Only when your widgets are set to fixed sizes or limited size the layout will expand and 'empty' space will be shown. So how do you build up your parent widget? (MainWindow??).

Log in to reply