这是我的构造函数:
DiskUsage::DiskUsage() {
pathLineEdit = new QLineEdit;
generateButton = new QPushButton(tr("Generate"));
pathGroupBoxLayout = new QHBoxLayout;
pathGroupBoxLayout->addWidget(pathLineEdit);
pathGroupBoxLayout->addWidget(generateButton);
pathGroupBox = new QGroupBox(tr("Path"));
pathGroupBox->setLayout(pathGroupBoxLayout);
chartGroupBox = new QGroupBox(tr("Chart"));
mainLayout = new QVBoxLayout;
mainLayout->addWidget(pathGroupBox);
mainLayout->addWidget(chartGroupBox);
setLayout(mainLayout);
}
如何获得固定高度的 pathGroupBoxLayout(这是一个 QHBoxLayout)?我希望当窗口垂直调整大小时,只有 chartGroupBox 调整大小,而不是 pathGroupBoxLayout。