From 57953174549797d1e87543ff7f70571053caf370 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 23 Dec 2018 10:20:47 +0100 Subject: QFormLayout: honor vertical expanding size policy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QFormLayout did not honor the vertical expanding state for widgets. Therefore e.g. a QTextEdit was not expanded vertically when it was inside a QFormLayout but worked fine inside a QGridLayout. It was honored when a stretch factor was set though. Fix it by not adding a dummy stretch item when one item is expanding. [ChangeLog][QtWidgets][QFormLayout] Honor the vertical expanding state of a widget inside a QFormLayout. Fixes: QTBUG-72676 Change-Id: If4456145918afa5a10435063770cc93bb9315fbe Reviewed-by: Samuel Gaist Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/widgets/kernel/qformlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp index bd0ea2598a..9146ba84c8 100644 --- a/src/widgets/kernel/qformlayout.cpp +++ b/src/widgets/kernel/qformlayout.cpp @@ -783,7 +783,7 @@ void QFormLayoutPrivate::setupVerticalLayoutData(int width) vLayouts[vidx].expansive = expanding || (vLayouts[vidx].stretch > 0); vLayouts[vidx].empty = false; - if (vLayouts[vidx].stretch > 0) + if (vLayouts[vidx].expansive) addTopBottomStretch = false; if (vidx > 1) -- cgit v1.2.3