diff options
author | Felix Geyer <debfx@fobos.de> | 2010-08-18 12:27:40 +0400 |
---|---|---|
committer | Felix Geyer <debfx@fobos.de> | 2010-08-18 12:27:40 +0400 |
commit | 623b325fa157230dc553fb65b50bff5789c7a73a (patch) | |
tree | b17e792aa0b5cc8ade8363a430e2903afc692fde /tests/TestGroupModel.cpp | |
parent | e28ed4891b40725b183472407d71396cbf2c9c9e (diff) |
Implement support for group tree changes in GroupModel.
Diffstat (limited to 'tests/TestGroupModel.cpp')
-rw-r--r-- | tests/TestGroupModel.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/TestGroupModel.cpp b/tests/TestGroupModel.cpp index e9d193084..d4c5deab4 100644 --- a/tests/TestGroupModel.cpp +++ b/tests/TestGroupModel.cpp @@ -77,10 +77,22 @@ void TestGroupModel::test() QVERIFY(model->data(index121) == "group121"); QVERIFY(model->data(index2) == "group2"); - QSignalSpy spy(model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))); + QSignalSpy spy1(model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&))); group11->setName("test"); group121->setIcon(4); - QVERIFY(spy.count() == 2); + QCOMPARE(spy1.count(), 2); + + QSignalSpy spyAboutToAdd(model, SIGNAL(rowsAboutToBeInserted(const QModelIndex&,int,int))); + QSignalSpy spyAdded(model, SIGNAL(rowsInserted(const QModelIndex&,int,int))); + QSignalSpy spyAboutToRemove(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&,int,int))); + QSignalSpy spyRemoved(model, SIGNAL(rowsRemoved(const QModelIndex&,int,int))); + + group12->setParent(group1, 0); + + QCOMPARE(spyAboutToAdd.count(), 1); + QCOMPARE(spyAdded.count(), 1); + QCOMPARE(spyAboutToRemove.count(), 1); + QCOMPARE(spyRemoved.count(), 1); delete groupRoot; delete db; |