c++ - How to create a compact Qt4 vBoxLayout -
I have got a vBoxLayout that has 3 simple buttons, when I increase the size of the widget with layout, between the inter buttons Increases I want to stop this behavior and keep the button in a consistent and compact layout, regardless of the size of the parent widget. This is what I have so far received, but this vacancy, no suggestion changes? Thanks.
button_layout = new QVBoxLayout; Button_layout - & gt; (0) setSpacing; Button_layout - & gt; SetContentsMargins (0,0,0,0);
You would like to add an expandable spacer to the layout:
This button is always due to being at the bottom of the widget, note that the horizontal section will still spread if your widget has expanded in this way; To fix this, you'll need to either either wrap it in another (hbbox) layout or switch to grid layout.
Comments
Post a Comment