summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qformlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qformlayout.cpp')
-rw-r--r--src/gui/kernel/qformlayout.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp
index e2d6108..a665c89 100644
--- a/src/gui/kernel/qformlayout.cpp
+++ b/src/gui/kernel/qformlayout.cpp
@@ -689,12 +689,16 @@ void QFormLayoutPrivate::setupVerticalLayoutData(int width)
// are split.
maxLabelWidth = 0;
if (!wrapAllRows) {
+ int maxFieldMinWidth = 0; //the maximum minimum size of the field
for (int i = 0; i < rr; ++i) {
const QFormLayoutItem *label = m_matrix(i, 0);
const QFormLayoutItem *field = m_matrix(i, 1);
- if (label && (label->sizeHint.width() + (field ? field->minSize.width() : 0) <= width))
+ if (label && field && label->sideBySide)
maxLabelWidth = qMax(maxLabelWidth, label->sizeHint.width());
+ if (field)
+ maxFieldMinWidth = qMax(maxFieldMinWidth, field->minSize.width() + field->sbsHSpace);
}
+ maxLabelWidth = qMin(maxLabelWidth, width - maxFieldMinWidth);
} else {
maxLabelWidth = width;
}