Respect minimum size of heightForWidth layouts
Since we cannot support heightForWidth constraints on toplevel windows, it is impossible to solve this perfectly: if the window is resizable at all, the user will be able to resize it too small. Our old solution was just to give up and allow completely free resizing, even down to 0x0. This makes very little sense. It is clearly better to use the minimum size that we have already computed, even though it is not perfect. This reverts a behavior change introduced in commit 36e9516f85fbb9c9a236f5ca034d5a0126d86c12 (September 9th, 2002) [ChangeLog][QtWidgets][QLayout] Widgets and dialogs containing layouts with heightForWidth (such as a label with word wrap) will no longer get a minimum size of 0x0. Task-number: QTBUG-37673 Change-Id: If26b7ef9c80edbf9d54c6519b36646df408b7652 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This commit is contained in:
parent
2fcc88d021
commit
c5bc66df2f
@ -1106,15 +1106,6 @@ bool QLayout::activate()
|
||||
ms.setWidth(mw->minimumSize().width());
|
||||
if (heightSet)
|
||||
ms.setHeight(mw->minimumSize().height());
|
||||
if ((!heightSet || !widthSet) && hasHeightForWidth()) {
|
||||
int h = minimumHeightForWidth(ms.width());
|
||||
if (h > ms.height()) {
|
||||
if (!heightSet)
|
||||
ms.setHeight(0);
|
||||
if (!widthSet)
|
||||
ms.setWidth(0);
|
||||
}
|
||||
}
|
||||
mw->setMinimumSize(ms);
|
||||
} else if (!widthSet || !heightSet) {
|
||||
QSize ms = mw->minimumSize();
|
||||
|
Loading…
Reference in New Issue
Block a user