Qt: How to set the maximum width of a QVBoxlayout
c++, qt
Solution
You can do a "hack" and place your layout inside a widget, for which you can define a maximum width:
QWidget *controlsRestrictorWidget = new QWidget();
QVBoxLayout *layoutVControls = new QVBoxLayout();
controlsRestrictorWidget->setLayout(layoutVControls);
controlsRestrictorWidget->setMaximumWidth(350);
It works :)
Problem
I currently have a horziontal layout that has two vertical layouts in it. `Vlayout1` and `VLayout2`. Now I want to set a maximum width limit of `VLayout1` so that if the form is expanded after that, only `Vlayout1` expands. Any suggestions on how I could accomplish this?