diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-31 14:16:01 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-31 14:54:01 (GMT) |
commit | c57ed134a536c177d1774d9272ca187bdfb28e6b (patch) | |
tree | 9b93dcca114411550913184feb1c1ae3b3dfddbb /src/gui/kernel/qformlayout.cpp | |
parent | c6cdfcb02d74f726e79ead9f890f294587a7c63c (diff) | |
download | Qt-c57ed134a536c177d1774d9272ca187bdfb28e6b.zip Qt-c57ed134a536c177d1774d9272ca187bdfb28e6b.tar.gz Qt-c57ed134a536c177d1774d9272ca187bdfb28e6b.tar.bz2 |
Revert "Fix QFormLayout which allowed fields to be smaller that their minimum size"
This reverts commit 244f5ee9c2c34ddee200e4d5cdc1345762a5901b.
Valgrind complains about the label fields that are not inisialized yet,
and indeed. They are initialized right after, and need the maxLabelWidth
to be computed. This is a chicken and egg problem difficult to solve, so
I rather revert the change as the bug is not critical
Diffstat (limited to 'src/gui/kernel/qformlayout.cpp')
-rw-r--r-- | src/gui/kernel/qformlayout.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp index 0b7656f..de33f93 100644 --- a/src/gui/kernel/qformlayout.cpp +++ b/src/gui/kernel/qformlayout.cpp @@ -689,16 +689,12 @@ 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 && field && label->sideBySide) + if (label && (label->sizeHint.width() + (field ? field->minSize.width() : 0) <= width)) maxLabelWidth = qMax(maxLabelWidth, label->sizeHint.width()); - if (field) - maxFieldMinWidth = qMax(maxFieldMinWidth, field->minSize.width() + field->sbsHSpace); } - maxLabelWidth = qMin(maxLabelWidth, width - maxFieldMinWidth); } else { maxLabelWidth = width; } |