summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-10-16 07:34:38 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-10-16 07:34:38 (GMT)
commit7644b352297e9fd1ee271421e9ce8b7256946b12 (patch)
tree81f8ad1d09f056c630666a8f0d8fb5ca2bf71e89 /tests/auto/qtableview
parent8ef83e60df0291ba2a36cc744e1f0c11f465f1e2 (diff)
downloadQt-7644b352297e9fd1ee271421e9ce8b7256946b12.zip
Qt-7644b352297e9fd1ee271421e9ce8b7256946b12.tar.gz
Qt-7644b352297e9fd1ee271421e9ce8b7256946b12.tar.bz2
Fixed typo in qtableview.cpp.
Auto-test included. Will timeout on fail. Reviewed-by: Alexis
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index d75cfa7..d8110e1 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -1195,6 +1195,13 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< 0 << 5 << (IntList() << int(QtTestTableView::MoveNext))
<< 1 << 0;
+ QTest::newRow("Last column disabled. Task QTBUG-3878") << -1 << -1
+ << IntList()
+ << (IntList() << 6)
+ << QRect()
+ << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << 0 << 5;
+
QTest::newRow("Span, anchor column hidden") << -1 << 1
<< IntList()
<< IntList()
@@ -1250,6 +1257,24 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< QRect(1, 2, 2, 3)
<< 5 << 2 << (IntList() << int(QtTestTableView::MoveUp) << int(QtTestTableView::MoveUp))
<< 1 << 2;
+
+ IntList fullList;
+ for (int i = 0; i < 7; ++i)
+ fullList << i;
+
+ QTest::newRow("All disabled, wrap forward. Timeout => FAIL") << -1 << -1
+ << fullList
+ << fullList
+ << QRect()
+ << 1 << 0 << (IntList() << int(QtTestTableView::MoveNext))
+ << 1 << 0;
+
+ QTest::newRow("All disabled, wrap backwards. Timeout => FAIL") << -1 << -1
+ << fullList
+ << fullList
+ << QRect()
+ << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << 1 << 0;
}
void tst_QTableView::moveCursorStrikesBack()
@@ -1272,11 +1297,6 @@ void tst_QTableView::moveCursorStrikesBack()
view.hideRow(hideRow);
view.hideColumn(hideColumn);
- foreach (int row, disableRows)
- model.disableRow(row);
- foreach (int column, disableColumns)
- model.disableColumn(column);
-
if (span.height() && span.width())
view.setSpan(span.top(), span.left(), span.height(), span.width());
view.show();
@@ -1284,6 +1304,11 @@ void tst_QTableView::moveCursorStrikesBack()
QModelIndex index = model.index(startRow, startColumn);
view.setCurrentIndex(index);
+ foreach (int row, disableRows)
+ model.disableRow(row);
+ foreach (int column, disableColumns)
+ model.disableColumn(column);
+
int newRow = -1;
int newColumn = -1;
foreach (int cursorMoveAction, cursorMoveActions) {