diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-03-10 09:41:35 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-03-11 13:09:37 +0000 |
commit | 6589fb7e0da291a3d93ff1803d66fb7942bf393e (patch) | |
tree | f320616578e3585d70551dd339c7b1a08106ab8d /src/widgets/widgets/qdockarealayout.cpp | |
parent | 22f3d359350fd65e4bbe2e9420fcc4460e8a590a (diff) |
Workaround for programs depending on previous layout bug
Change 2bfee10f made QDockAreaLayout respect the maximum
size of the central widget. This broke some existing
programs which would set sizePolicy to Fixed on a
central widget without a sizeHint.
This patch restores the old behaviour for the special case
where there are no dock areas. It is highly unlikely that
the intention in this case is to have a very small central
widget with huge blank areas on either side.
Task-number: QTBUG-43797
Change-Id: I1e1fb17204f72166da3b0b054a7777e8183604a7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qdockarealayout.cpp')
-rw-r--r-- | src/widgets/widgets/qdockarealayout.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 702cd8bac9..340d2772f8 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2681,6 +2681,8 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list, ver_struct_list[i].sizeHint = qMax(ver_struct_list[i].sizeHint, ver_struct_list[i].minimumSize); } + if (have_central && ver_struct_list[0].empty && ver_struct_list[2].empty) + ver_struct_list[1].maximumSize = QWIDGETSIZE_MAX; } if (_hor_struct_list != 0) { @@ -2740,6 +2742,9 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list, hor_struct_list[i].sizeHint = qMax(hor_struct_list[i].sizeHint, hor_struct_list[i].minimumSize); } + if (have_central && hor_struct_list[0].empty && hor_struct_list[2].empty) + hor_struct_list[1].maximumSize = QWIDGETSIZE_MAX; + } } |