diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2013-08-27 12:47:55 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-10 20:02:12 (GMT) |
commit | c3958b592a1d46eb1b536bd09cce1aa919d02635 (patch) | |
tree | aa4de6c11b0cf3e1d92f39b03c058d0146be4c2f /tests | |
parent | a908c3f351541f7b26549820d313a2932f1f9887 (diff) | |
download | Qt-c3958b592a1d46eb1b536bd09cce1aa919d02635.zip Qt-c3958b592a1d46eb1b536bd09cce1aa919d02635.tar.gz Qt-c3958b592a1d46eb1b536bd09cce1aa919d02635.tar.bz2 |
Fix layouts with expanding items with maximum size
Layout items with a Preferred size policy would be treated as fixed
size if they were in the same layout as an Expanding item (or one with
a stretch factor).
This occurred e.g. if a layout was configured similar to this:
1. One item with ExpandFlag/stretch but with a maximumSize set,
e.g. (100x100).
2. Another item with 'just' GrowFlag, and a maximum size bigger than
its size hint.
If the above layout was resized to e.g. (200x50) it would cause the
expanding item to correctly get the size (100x50), but the 'growing'
item would not stretch beyond its size hint.
Instead, it would distribute space around both items, behaving as if
the 'growing' item was fixed'.
The expected behavior is to continue to grow the 'growing' item after
the expanding item has reached its size limit.
Task-number: QTBUG-33104
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
(cherry picked from qtbase/b855e578044e49b588b32085968c63a910b9daae)
Change-Id: I943f1effd53fc7adc19824ce0747443797a0a235
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qboxlayout/tst_qboxlayout.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qboxlayout/tst_qboxlayout.cpp b/tests/auto/qboxlayout/tst_qboxlayout.cpp index a47dafe..d3965e8 100644 --- a/tests/auto/qboxlayout/tst_qboxlayout.cpp +++ b/tests/auto/qboxlayout/tst_qboxlayout.cpp @@ -446,6 +446,33 @@ void tst_QBoxLayout::testLayoutEngine_data() << (PosList() << 100 << 300 << 300) << (SizeList() << 100 << 0 << 100); + QTest::newRow("QTBUG-33104") + << (DescrList() << Descr(11, 75, 75, true) << Descr(75, 75)) + << 200 + << 0 + << (PosList() << 0 << 75) + << (SizeList() << 75 << 125); + + QTest::newRow("Expanding with maximumSize") + << (DescrList() << Descr(11, 75, 100, true) << Descr(75, 75)) + << 200 + << 0 + << (PosList() << 0 << 100) + << (SizeList() << 100 << 100); + + QTest::newRow("Stretch with maximumSize") + << (DescrList() << Descr(11, 75, 100, false, 1) << Descr(75, 75)) + << 200 + << 0 + << (PosList() << 0 << 100) + << (SizeList() << 100 << 100); + + QTest::newRow("Stretch with maximumSize last") + << (DescrList() << Descr(75, 75) << Descr(11, 75, 100, false, 1)) + << 200 + << 0 + << (PosList() << 0 << 100) + << (SizeList() << 100 << 100); } void tst_QBoxLayout::testLayoutEngine() |