diff options
| author | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-08-10 16:33:07 +0200 |
|---|---|---|
| committer | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-08-10 16:33:07 +0200 |
| commit | 1bca6a469a21d635781c700a9606ffb1f963d98b (patch) | |
| tree | f2de7f81188f045df5c5e9453a3fae9a885cac8b /tests | |
| parent | 38ff2e6f21b1196948eca97979f4a9840fe071f1 (diff) | |
Updates to enable itemviews-ng use qml and to be used by qml.
QGraphicsObject is now the base class for view items.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/qgraphicslistview/tst_qgraphicslistview.cpp | 5 | ||||
| -rw-r--r-- | tests/qgraphicstableview/tst_qgraphicstableview.cpp | 9 | ||||
| -rw-r--r-- | tests/qgraphicstreeview/tst_qgraphicstreeview.cpp | 5 |
3 files changed, 11 insertions, 8 deletions
diff --git a/tests/qgraphicslistview/tst_qgraphicslistview.cpp b/tests/qgraphicslistview/tst_qgraphicslistview.cpp index 1d99bf8..e8c25e6 100644 --- a/tests/qgraphicslistview/tst_qgraphicslistview.cpp +++ b/tests/qgraphicslistview/tst_qgraphicslistview.cpp @@ -820,8 +820,9 @@ void tst_QtGraphicsListView::layout() for (int j = 0; j < expectedIndexes.count(); ++j) { QGraphicsItem *item = view->itemForIndex(expectedIndexes.at(j)); QVERIFY(item); - //QCOMPARE(item->index(), expectedIndexes.at(j)); - //QCOMPARE(item->geometry(), expectedGeometries.at(j)); + QVERIFY(item->isWidget()); + QCOMPARE(static_cast<QtGraphicsListViewItem*>(item)->index(), expectedIndexes.at(j)); + QCOMPARE(static_cast<QtGraphicsListViewItem*>(item)->geometry(), expectedGeometries.at(j)); } } diff --git a/tests/qgraphicstableview/tst_qgraphicstableview.cpp b/tests/qgraphicstableview/tst_qgraphicstableview.cpp index 845895a..75f78ef 100644 --- a/tests/qgraphicstableview/tst_qgraphicstableview.cpp +++ b/tests/qgraphicstableview/tst_qgraphicstableview.cpp @@ -261,11 +261,12 @@ void tst_QtGraphicsTableView::layout() for (int j = 0; j < cells.count(); ++j) { QtCell cell = cells.at(j); - QtGraphicsTableViewItem *item = view->itemForCell(cell.row, cell.column); + QGraphicsObject *item = view->itemForCell(cell.row, cell.column); QVERIFY(item); - QCOMPARE(item->row(), cell.row); - QCOMPARE(item->column(), cell.column); - QCOMPARE(item->geometry(), geometries.at(j)); + QVERIFY(item->isWidget()); + QCOMPARE(static_cast<QtGraphicsTableViewItem*>(item)->row(), cell.row); + QCOMPARE(static_cast<QtGraphicsTableViewItem*>(item)->column(), cell.column); + QCOMPARE(static_cast<QtGraphicsTableViewItem*>(item)->geometry(), geometries.at(j)); } } diff --git a/tests/qgraphicstreeview/tst_qgraphicstreeview.cpp b/tests/qgraphicstreeview/tst_qgraphicstreeview.cpp index 8aa31c3..b1f2281 100644 --- a/tests/qgraphicstreeview/tst_qgraphicstreeview.cpp +++ b/tests/qgraphicstreeview/tst_qgraphicstreeview.cpp @@ -256,9 +256,10 @@ void tst_QtGraphicsTreeView::layout() QtTreeModelIterator it = view->itemAt(QPointF(10, 10)); for (int j = 0; j < expectedGeometries.count(); ++j) { QVERIFY(it.isValid()); - QtGraphicsTreeViewItem *item = view->itemForIterator(it); + QGraphicsObject *item = view->itemForIterator(it); QVERIFY(item); - QCOMPARE(item->geometry(), expectedGeometries.at(j)); + QVERIFY(item->isWidget()); + QCOMPARE(static_cast<QtGraphicsTreeViewItem*>(item)->geometry(), expectedGeometries.at(j)); view->nextItem(it); } } |
