From a5a925748ff3893e4acf2d41bd8aee0d11a3285a Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Mon, 17 Aug 2009 19:52:17 -0300 Subject: QGraphicsAnchorLayout: fix calculation of sizeAt* values for Sequential This commit implements what's described in the previous commit QGraphicsAnchorLayout: fix expected values for parallel test When filling the sizeAt* values (the three points used for interpolation when setting geometry), now sequential anchors distribute the sizes to the children in a fair way, i.e. proportionally in relation to the existing min/pref/max hints. Each value is defined in relation of the pref (either as a shrinkage in pref or a grow in pref). In both cases the shrinking/growing factor is the same for all children. When we implement support for QSizePolicies, this distribution might be changed by setting size policies for a certain item or anchor. This makes two tests work -- so no more expected fail. Also fixed a typo in one test's expected results. --- tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/auto/qgraphicsanchorlayout') diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index 3bab0ce6fc..dcda12dfe0 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -234,7 +234,6 @@ void tst_QGraphicsAnchorLayout::parallel() // solution found by the solver at runtime. p.resize(layoutMaximumSize); QCOMPARE(a->geometry(), QRectF(0, 0, 200, 100)); - QEXPECT_FAIL("", "see commit 23441f49a23cbf936b60140c5c8a6d5cb3ca00a7 for explanation", Abort); QCOMPARE(b->geometry(), QRectF(200, 100, 175, 100)); QCOMPARE(c->geometry(), QRectF(200, 200, 350, 100)); QCOMPARE(d->geometry(), QRectF(375, 300, 175, 100)); @@ -609,9 +608,8 @@ void tst_QGraphicsAnchorLayout::proportionalPreferred() qreal factor = 12.0 / 24.0; QCOMPARE(c->size().width(), d->size().width()); - QEXPECT_FAIL("", "see commit 23441f49a23cbf936b60140c5c8a6d5cb3ca00a7 for explanation", Abort); - QCOMPARE(a->size().width() * factor, 10 * factor); - QCOMPARE(c->size().width() * factor, 14 * factor); + QCOMPARE(a->size().width(), 10 * factor); + QCOMPARE(c->size().width(), 14 * factor); QCOMPARE(p.size(), QSizeF(12, 400)); } -- cgit v1.2.3