summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-27 12:15:49 +0100
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-27 12:17:20 +0100
commitbc49cbaab3356770eb4b27dcbc2e585bf21e9200 (patch)
tree4e21e292cb4764ec498d6929b9570f4a73fc49fb /tests/auto/qtableview
parentca7640ff5e12f9e818d3b8ca38318f0fdcf47e3e (diff)
QTableView would not correctly resize to contents
The problem was that we didn't call ensurePolished when getting the size of the sections. Task-number: QTBUG-1002 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index d8110e138e..8f8781da70 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -2017,8 +2017,9 @@ void tst_QTableView::resizeRowsToContents()
view.resizeRowsToContents();
QCOMPARE(resizedSpy.count(), model.rowCount());
- for (int r = 0; r < model.rowCount(); ++r)
+ for (int r = 0; r < model.rowCount(); ++r) {
QCOMPARE(view.rowHeight(r), rowHeight);
+ }
}
void tst_QTableView::resizeColumnsToContents_data()
@@ -3267,12 +3268,12 @@ void tst_QTableView::resizeToContents()
//now let's check the row/col sizes
for(int i = 0;i<table.columnCount();i++) {
- QVERIFY( table.columnWidth(i) == table2.columnWidth(i));
- QVERIFY( table2.columnWidth(i) == table3.columnWidth(i));
+ QCOMPARE( table.columnWidth(i), table2.columnWidth(i));
+ QCOMPARE( table2.columnWidth(i), table3.columnWidth(i));
}
for(int i = 0;i<table.rowCount();i++) {
- QVERIFY( table.rowHeight(i) == table2.rowHeight(i));
- QVERIFY( table2.rowHeight(i) == table3.rowHeight(i));
+ QCOMPARE( table.rowHeight(i), table2.rowHeight(i));
+ QCOMPARE( table2.rowHeight(i), table3.rowHeight(i));
}
}