summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-04-16 10:20:11 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-04-16 10:20:41 (GMT)
commit049f9e85b6ca50ccc53596160ebe4a5fe3de3f80 (patch)
tree4943cbba232fcad9177221a47a1f872b890f4db9 /tests/auto
parent97ff2bde044838be0d5210a86c2fafd23c05d994 (diff)
downloadQt-049f9e85b6ca50ccc53596160ebe4a5fe3de3f80.zip
Qt-049f9e85b6ca50ccc53596160ebe4a5fe3de3f80.tar.gz
Qt-049f9e85b6ca50ccc53596160ebe4a5fe3de3f80.tar.bz2
autotest fix in QtreeView
reviewed-by: ogoffart
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index dfccd9e..a337b81 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -1682,9 +1682,16 @@ void tst_QTreeView::moveCursor()
view.setColumnHidden(0, true);
QVERIFY(view.isColumnHidden(0));
view.show();
+ qApp->setActiveWindow(&view);
- QModelIndex actual = view.moveCursor(PublicView::MoveDown, Qt::NoModifier);
+ //here the first visible index should be selected
+ //because the view got the focus
QModelIndex expected = model.index(1, 1, QModelIndex());
+ QCOMPARE(view.currentIndex(), expected);
+
+ //then pressing down should go to the next line
+ QModelIndex actual = view.moveCursor(PublicView::MoveDown, Qt::NoModifier);
+ expected = model.index(2, 1, QModelIndex());
QCOMPARE(actual, expected);
view.setRowHidden(0, QModelIndex(), false);