Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QVBoxLayout - no stretch/expanding



  • Hi,

    I have a QScrollArea with a QBoxLayout. At runtime I insert widgets into the scroll area using insertWidget(0,widget). I want the widgets to be listed directly below each other, but instead they are centered with space around them. How can I change that?

    Thanks for any hints,

    Best regards,

    Eddy



  • The space around them is controlled by the spacing parameter of the layout. Change that property in your layout to 0.


Log in to reply