summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Bugge Monsen <mmonsen@trolltech.com>2009-06-03 17:01:57 +0200
committerMarius Bugge Monsen <mmonsen@trolltech.com>2009-06-03 17:01:57 +0200
commit36527d1853ee2eb1864df3fef9762d20e2981ef9 (patch)
tree92f373994314b67f59fa0191452fa22c10140b45
parent62fddf64c8c1cf152ffc0a42c33943e0eefca254 (diff)
Add some comments to make the QtTableGraphicsView::layout() test data-sets a little more readable.
-rw-r--r--tests/qgraphicstableview/tst_qgraphicstableview.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/qgraphicstableview/tst_qgraphicstableview.cpp b/tests/qgraphicstableview/tst_qgraphicstableview.cpp
index ed3a95d..7ac1939 100644
--- a/tests/qgraphicstableview/tst_qgraphicstableview.cpp
+++ b/tests/qgraphicstableview/tst_qgraphicstableview.cpp
@@ -133,7 +133,7 @@ void tst_QtGraphicsTableView::layout_data()
{
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
- QTest::addColumn<QSizeF>("size");
+ QTest::addColumn<QSizeF>("viewSize");
QTest::addColumn<QtCell>("firstCell");
QTest::addColumn<qreal>("horizontalOffset");
QTest::addColumn<qreal>("verticalOffset");
@@ -141,12 +141,12 @@ void tst_QtGraphicsTableView::layout_data()
QTest::addColumn<QList<QtCell> >("expectedCells");
QTest::newRow("no cells")
- << 0 << 0
- << QSizeF(100, 100)
- << QtCell()
- << 0. << 0.
- << QList<QRectF>()
- << QList<QtCell>();
+ << 0 << 0 // table dimensions
+ << QSizeF(100, 100) // view size
+ << QtCell() // first view row and column
+ << 0. << 0. // offsets
+ << QList<QRectF>() // expected geometries
+ << QList<QtCell>(); // expected cells
QTest::newRow("1 row, 1 column, all visible")
<< 1 << 1
@@ -163,13 +163,15 @@ void tst_QtGraphicsTableView::layout_data()
<< 0. << 0.
<< (QList<QRectF>() << QRectF(0, 0, 100, 30) << QRectF(0, 30, 100, 30) << QRectF(0, 60, 100, 30))
<< (QList<QtCell>() << QtCell(0, 0) << QtCell(1, 0) << QtCell(2, 0));
+
+ // ### FIXME: add more data-sets
}
void tst_QtGraphicsTableView::layout()
{
QFETCH(int, rowCount);
QFETCH(int, columnCount);
- QFETCH(QSizeF, size);
+ QFETCH(QSizeF, viewSize);
QFETCH(QtCell, firstCell);
QFETCH(qreal, horizontalOffset);
QFETCH(qreal, verticalOffset);
@@ -178,7 +180,7 @@ void tst_QtGraphicsTableView::layout()
QtTableDefaultModel model(rowCount, columnCount);
- view->setGeometry(QRectF(QPointF(0, 0), size));
+ view->setGeometry(QRectF(QPointF(0, 0), viewSize));
view->setModel(&model);
view->setFirstRow(firstCell.row);
view->setFirstColumn(firstCell.column);
@@ -186,6 +188,7 @@ void tst_QtGraphicsTableView::layout()
view->setVerticalOffset(verticalOffset);
view->doLayout();
+ // ### FIXME: this section relies on the order of the child items (internal functionality)
QList<QGraphicsItem*> items = view->childItems();
QCOMPARE(items.count(), expectedGeometries.count());
QCOMPARE(items.count(), expectedCells.count());