Remove disabled code in QItemView test.
authorJason McDonald <jason.mcdonald@nokia.com>
Tue, 1 Nov 2011 01:52:29 +0000 (11:52 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 Nov 2011 23:53:26 +0000 (00:53 +0100)
The removed code was disabled in January 2007.  The commit history does
not make clear what the code was supposed to achieve and the code
doesn't do what the comment at the top says (that looks like a TODO).
Best to delete it and start again.

Change-Id: I42b6b1d865c96518d74dc189a4a41d0d2776e5bc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp

index d4cf394..df77687 100644 (file)
@@ -866,62 +866,6 @@ void tst_QItemView::moveCursor()
         events.push(Event(Qt::Key_Right, firstRow.sibling(0, 2),        firstRow.sibling(0, 3), "first_2, first_3"));
         events.push(Event(Qt::Key_Right, firstRow.sibling(0, treeModel->columnCount()-1), firstRow.sibling(0, treeModel->columnCount()-1), "first_3, sec"));
     }
-
-#if 0 // ### disable this part for now
-
-    // ### hide the first/last row,column and re-run all of these tests
-    // ### Not 100% sure, but I think the next to are tableview specific only and everyone else just does up/down
-    // QAbstractItemView::MoveNext, AbstractItemView::MovePrevious
-
-    while (!events.isEmpty()) {
-        Event event = events.pop();
-        view->setCurrentIndex(event.start);
-        QCOMPARE(view->currentIndex(), event.start);
-
-        if (event.key == Qt::Key_PageUp && event.end == QModelIndex()) {
-            QModelIndex x = view->indexAt(QPoint(1,1));
-            if (x.row() == 0)
-                event.end = x;
-            else
-                event.end = x.sibling(x.row() - 1, x.column());
-        }
-        if (event.key == Qt::Key_PageDown && event.end == QModelIndex()) {
-            QModelIndex x = view->indexAt(QPoint(1, view->viewport()->height() - 10));
-            if (x.row() == view->model()->rowCount() - 1)
-                event.end = x;
-            else
-                event.end = x.sibling(x.row() + 1, x.column());
-        }
-
-        QTest::keyPress(view, event.key);
-        QTest::keyRelease(view, event.key);
-        QModelIndex current = view->currentIndex();
-        if (event.key == Qt::Key_PageUp) {
-            int diff = event.end.row() - current.row();
-            QVERIFY(diff <= 2);
-            continue;
-        }
-        if (event.key == Qt::Key_PageDown) {
-            int diff = current.row() - event.end.row();
-            QVERIFY(diff <= 2);
-            continue;
-        }
-
-        if (current != event.end) {
-            QString k;
-            if (event.key == Qt::Key_Up) k = "up";
-            if (event.key == Qt::Key_Right) k = "right";
-            if (event.key == Qt::Key_Left) k = "left";
-            if (event.key == Qt::Key_PageUp) k = "page up";
-            if (event.key == Qt::Key_PageDown) k = "page down";
-            if (event.key == Qt::Key_Down) k = "down";
-            if (event.key == Qt::Key_Home) k = "home";
-            if (event.key == Qt::Key_End) k = "end";
-            qDebug() << k << event.name << event.start << event.end << current;
-        }
-        QCOMPARE(current, event.end);
-    }
-#endif
 }
 
 QTEST_MAIN(tst_QItemView)