Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
GroupBox positioning in the main window
thomas11live.com.sg last edited by
I have three group boxes, horizontalGroupBox, gridGroupBox and formGroupBox.
If I add like that in the program, they all are positioned vertically.
But I want to arrange them, horizontalGroupBox is the first group box at the first row and
gridGroupBox and formGroupBox are at the second row and these two are side by side.
How can I arrange them in the program?
giesbert last edited by
I expect mainLayout is a VBoxLayout?
You can cascade the layouts or use a grid layoud to achieve what you want.
QGridLayout* mainLayout = ...
mainLayout->addWidget(horizontalGroupBox, 0, 0, 1, 2);
mainLayout->addWidget(gridGroupBox, 1, 0);
mainLayout->addWidget(formGroupBox, 1, 1);
Disclaimer: written directly from brain, no guarantee... ;-)