Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.0, 5.12
-
None
-
-
57953174549797d1e87543ff7f70571053caf370 (qt/qtbase/dev)
Description
Consider the following code :
#include <QApplication> #include <QFormLayout> #include <QPlainTextEdit> #include <QLineEdit> #include <QDialog> int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog w; QFormLayout lay{&w}; QLineEdit w1{&w}; QPlainTextEdit w2{&w}; w2.setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); w2.setMinimumHeight(300); w2.setMaximumHeight(30000); lay.addRow("foo", &w1); lay.addRow("bar", &w2); w.show(); return a.exec(); }
Even though the textedit's maximumHeight is set to 30000, whenever the windows grows, the height of the widget won't ever go past its minimumHeight.
The same thing with a QGridLayout works as expected :
#include <QApplication> #include <QFormLayout> #include <QPlainTextEdit> #include <QLineEdit> #include <QDialog> #include <QLabel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog w; QGridLayout lay{&w}; QLineEdit w1{&w}; QPlainTextEdit w2{&w}; w2.setMinimumHeight(300); w2.setMaximumHeight(30000); lay.addWidget(new QLabel("foo"), 0, 0, 1, 1); lay.addWidget(&w1, 0, 1, 1, 1); lay.addWidget(new QLabel("bar"), 1, 0, 1, 1); lay.addWidget(&w2, 1, 1, 1, 1); w.show(); return a.exec(); }