I've removed my container widget, which wasn't really doing anything beyond wrapping a QGridLayout inside a widget anyways.
So now, the parent widget is a QTabWidget, my two widgets that I'm putting in the grid are a QwtPlot (col 0) and a QwtLegend (col 1). I've included the relevant code below.
ui->tab_2->setLayout(grid);
int i=0;
{
grid->addWidget(plot,i,0);
legend->setMaxColumns(1);
grid->addWidget(legend, i, 1);
i++;
}
QGridLayout* grid = new QGridLayout();
ui->tab_2->setLayout(grid);
int i=0;
foreach (QwtPlot* plot, plots)
{
plot->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
grid->addWidget(plot,i,0);
QwtLegend* legend = new QwtLegend();
legend->setMaxColumns(1);
legend->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
grid->addWidget(legend, i, 1);
i++;
}
To copy to clipboard, switch view to plain text mode
This code is in my MainWindow constructor, and when the application launches, it takes up more vertical space than I'd expect it to. In the Qt Creator Designer tab, my MainWindow class has a geometry of 1158x738. When the application launches, the MainWindow size is 1158 x 1997...
Bookmarks