summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsgridlayout
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2010-08-11 07:28:32 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-08-11 11:28:55 (GMT)
commit98b7e8ac793d95a6a8350c7fc25faebd6f44cd21 (patch)
treeff7f4e9428bc3c2e02704af8727cbcbed209a4ba /tests/auto/qgraphicsgridlayout
parentbb696453f6f87cad58982af3455335478fedb8cc (diff)
downloadQt-98b7e8ac793d95a6a8350c7fc25faebd6f44cd21.zip
Qt-98b7e8ac793d95a6a8350c7fc25faebd6f44cd21.tar.gz
Qt-98b7e8ac793d95a6a8350c7fc25faebd6f44cd21.tar.bz2
Layout items had the wrong size if the layout was resized to maximum.
The problem was that if targetSize was the layouts maximum size, then sumAvailable could be reduced to exactly 0 in the "while (keepGoing)" loop. That would mean that we would not enter the block that actually copied the new sizes from the temporary "newSizes" array to the output "sizes" array due to the "if (sumAvailable > 0)" condition. Task-number: none, discovered while fixing QT-3570 Reviewed-by: Frederik Gladhorn
Diffstat (limited to 'tests/auto/qgraphicsgridlayout')
-rw-r--r--tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index d1d6860..5b03767 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -485,12 +485,12 @@ void tst_QGraphicsGridLayout::alignment()
widget->resize(widget->effectiveSizeHint(Qt::MaximumSize));
QApplication::processEvents();
- QCOMPARE(layout->itemAt(0,0)->geometry(), QRectF(0, 0, 50, 25));
- QCOMPARE(layout->itemAt(1,0)->geometry(), QRectF(0, 25, 50, 25));
- QCOMPARE(layout->itemAt(0,1)->geometry(), QRectF(125, 0, 50, 25));
- QCOMPARE(layout->itemAt(1,1)->geometry(), QRectF(125, 25, 50, 25));
- QCOMPARE(layout->itemAt(0,2)->geometry(), QRectF(250, 0, 50, 25));
- QCOMPARE(layout->itemAt(1,2)->geometry(), QRectF(250, 25, 50, 25));
+ QCOMPARE(layout->itemAt(0,0)->geometry(), QRectF(0, 0, 50, 50));
+ QCOMPARE(layout->itemAt(1,0)->geometry(), QRectF(0, 50, 50, 50));
+ QCOMPARE(layout->itemAt(0,1)->geometry(), QRectF(125, 0, 50, 50));
+ QCOMPARE(layout->itemAt(1,1)->geometry(), QRectF(125, 50, 50, 50));
+ QCOMPARE(layout->itemAt(0,2)->geometry(), QRectF(250, 0, 50, 50));
+ QCOMPARE(layout->itemAt(1,2)->geometry(), QRectF(250, 50, 50, 50));
delete widget;
}
@@ -544,12 +544,12 @@ void tst_QGraphicsGridLayout::columnAlignment()
| HCenter | Right | Left |
+---------------------------------+
*/
- QCOMPARE(layout->itemAt(0,0)->geometry(), QRectF(0, 0, 50, 25));
- QCOMPARE(layout->itemAt(1,0)->geometry(), QRectF(25, 26, 50, 25)); // item is king
- QCOMPARE(layout->itemAt(0,1)->geometry(), QRectF(126, 0, 50, 25));
- QCOMPARE(layout->itemAt(1,1)->geometry(), QRectF(151, 26, 50, 25)); // item is king
- QCOMPARE(layout->itemAt(0,2)->geometry(), QRectF(252, 0, 50, 25));
- QCOMPARE(layout->itemAt(1,2)->geometry(), QRectF(202, 26, 50, 25)); // item is king
+ QCOMPARE(layout->itemAt(0,0)->geometry(), QRectF(0, 0, 50, 50));
+ QCOMPARE(layout->itemAt(1,0)->geometry(), QRectF(25, 51, 50, 50)); // item is king
+ QCOMPARE(layout->itemAt(0,1)->geometry(), QRectF(126, 0, 50, 50));
+ QCOMPARE(layout->itemAt(1,1)->geometry(), QRectF(151, 51, 50, 50)); // item is king
+ QCOMPARE(layout->itemAt(0,2)->geometry(), QRectF(252, 0, 50, 50));
+ QCOMPARE(layout->itemAt(1,2)->geometry(), QRectF(202, 51, 50, 50)); // item is king
delete widget;
}