Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15, 6.5.3, 6.6
-
None
Description
When a widget in a layout has a size policy without the `QSizePolicy::ShrinkFlag` bit set (e.g. `QSizePolicy::Fixed`, `QSizePolicy::Minimum`), and the parent widget is forced with a size smaller than ideal, currently the child widget is shrunk anyway.
However according to the doc,
QSizePolicy::Fixed 0 The QWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button). QSizePolicy::Minimum GrowFlag The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().
it seems that such widgets should not be shrunk smaller than the `sizeHint()`.
For example, open the attached .ui file with Qt Designer, click "Preview" and drag the right border of the previewed window to shrink it, the result looks like this (below one is the preview). I think the first row looks wrong. It should be just like the second row.