From 6589fb7e0da291a3d93ff1803d66fb7942bf393e Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 10 Mar 2015 09:41:35 +0100 Subject: [PATCH] Workaround for programs depending on previous layout bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/widgets/widgets/qdockarealayout.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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 *_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 *_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; + } }