Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.4, 4.8.0, 5.0.0 Beta 1
-
None
-
Windows7
-
c3958b592a1d46eb1b536bd09cce1aa919d02635 b855e578044e49b588b32085968c63a910b9daae
Description
If we have one widget in grid layout having maximum width fixed, other widgets in the layout does not get sufficient space.
Following example demonstrate this.
#include <QtGui> int main(int argc, char** argv) { QApplication app(argc, argv); QWidget widget; QGridLayout grid(&widget); QHBoxLayout hbox; hbox.addWidget(new QRadioButton("Button one", &widget)); hbox.addWidget(new QRadioButton("Button two", &widget)); hbox.addWidget(new QRadioButton("Button three", &widget)); grid.addLayout(&hbox, 0, 0,1,6);// with this combo box is not fully shown //grid.addLayout(&hbox, 0, 0); // with this there is huge space between line edit and labels QLineEdit* edit(new QLineEdit(&widget)); edit->setMaximumWidth(40); grid.addWidget(edit, 1, 0); grid.addWidget(new QLabel("A", &widget), 1, 1); grid.addWidget(new QLabel("B", &widget), 1, 2); grid.addWidget(new QLabel("C", &widget), 1, 3); grid.addWidget(new QLabel("D", &widget), 1, 4); grid.addWidget(new QLabel("E", &widget), 1, 5); widget.show(); return app.exec(); }
Using gridlayout25801:
- Run example
- Run example with option -m: Note widgets are squeezed.
Attachments
Issue Links
- resulted in
-
QTBUG-33104 Layout with an expanding item that has a maximum size does not grow non-expanding items.
- Closed