I have several QHBoxLayout's that are all contained in a QVBoxLayout.
QHBoxLayout *hb1 = new QHBoxLayout;
// ...
QHBoxLayout *hb2 = new QHBoxLayout;
// ...
QWidget *hb1_layout = new QWidget;
hb1_layout->setLayout(hb1);
QWidget *hb2_layout = new QWidget;
hb2_layout->setLayout(hb2);
// ...
QVBoxLayout *ps = new QVBoxLayout;
ps->addWidget(hb1_layout);
ps->addWidget(hb2_layout);
ps->addWidget(hb3_layout);
ps->addWidget(hb4_layout);
What I'm trying to do is pack the widgets within each QHBoxLayout closer to the widgets in the QHBoxLayout next down. I.e., there's a lot of space between each row of widgets between the horizontal layouts.
When resizing the window, there needs to be a minimum size that the widgets won't go beyond. But when resizing larger, they evenly spread out.
If I resize the window, I can get it to look like what I want. But I don't know how to programmatically initialize the window to the right size in the first place. When I start my app, I have to minimize by resizing the window to get the widgets to appear nicely packed.
Thoughts?