Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.10
-
None
Description
Widgets can retain old minimum and maximum size constraints. Setting a new size constraint will not remove minimum and maximum values from another one.
The qlayout.cpp has mentions regarding that and an example can be tst_qlayout.cpp
void clearConstraintAndResize(QSize sz, Qt::Orientations o = Qt::Horizontal | Qt::Vertical) { if (o == (Qt::Horizontal | Qt::Vertical)) setSizeConstraint(QLayout::SizeConstraint::SetNoConstraint); else if (o == Qt::Vertical) setVerticalSizeConstraint(QLayout::SizeConstraint::SetNoConstraint); else if (o == Qt::Horizontal) setHorizontalSizeConstraint(QLayout::SizeConstraint::SetNoConstraint); parentWidget()->setMinimumSize(0, 0); // <== ***** Should NOT be needed **** parentWidget()->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); parentWidget()->resize(sz); activate(); }
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-137093 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
650038,2 | Avoid old sticking size constraints in QLayout | dev | qt/qtbase | Status: NEW | 0 | -1 |