diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-20 09:29:40 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-20 09:29:40 (GMT) |
commit | 33afa6c1fbe230dec4eea435f9ad5d4141c128a8 (patch) | |
tree | 2ace5c779c10288503b348a8d8bac8748dad0cae /tests/auto/qtreeview | |
parent | ee1e6222114028c2ff181f972e32f15011723b5f (diff) | |
parent | 9f668a352df15404234ea30bc9bb0c1ef774c1b0 (diff) | |
download | Qt-33afa6c1fbe230dec4eea435f9ad5d4141c128a8.zip Qt-33afa6c1fbe230dec4eea435f9ad5d4141c128a8.tar.gz Qt-33afa6c1fbe230dec4eea435f9ad5d4141c128a8.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into windows-7-multitouch
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index a96dbac..37cb5b0 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -475,11 +475,7 @@ void tst_QTreeView::construction() QCOMPARE(view.iconSize(), QSize()); QCOMPARE(view.indexAt(QPoint()), QModelIndex()); QVERIFY(!view.indexWidget(QModelIndex())); -#if QT_VERSION >= 0x040400 QVERIFY(qobject_cast<QStyledItemDelegate *>(view.itemDelegate())); -#else - QVERIFY(qobject_cast<QItemDelegate *>(view.itemDelegate())); -#endif QVERIFY(!view.itemDelegateForColumn(-1)); QVERIFY(!view.itemDelegateForColumn(0)); QVERIFY(!view.itemDelegateForColumn(1)); @@ -1004,11 +1000,7 @@ void tst_QTreeView::itemDelegate() { QTreeView view; -#if QT_VERSION >= 0x040400 QVERIFY(qobject_cast<QStyledItemDelegate *>(view.itemDelegate())); -#else - QVERIFY(qobject_cast<QItemDelegate *>(view.itemDelegate())); -#endif QPointer<QAbstractItemDelegate> oldDelegate = view.itemDelegate(); otherItemDelegate = new QItemDelegate; @@ -1683,9 +1675,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); @@ -1865,14 +1864,8 @@ void tst_QTreeView::indexBelow() i = view.indexBelow(i); QVERIFY(i.isValid()); QCOMPARE(i.row(), 1); -#if QT_VERSION >= 0x040100 i = view.indexBelow(i); QVERIFY(!i.isValid()); -#else - // Qt 4.0.x returns the bottom index - i = view.indexBelow(i); - QVERIFY(i.isValid()); -#endif } void tst_QTreeView::clicked() |