path: root/src
diff options
authorChristian Ehrlicher <>2018-12-23 10:20:47 +0100
committerChristian Ehrlicher <>2019-02-14 16:48:14 +0000
commit57953174549797d1e87543ff7f70571053caf370 (patch)
tree2f886997ca562563f6f5ec9c11f513c2b43d5d14 /src
parentd99162754f225ca98318e96184e80a57c33fa1ed (diff)
QFormLayout: honor vertical expanding size policy
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 <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
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)