diff options
-rw-r--r-- | src/declarative/items/qsgvisualitemmodel.cpp | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/declarative/items/qsgvisualitemmodel.cpp b/src/declarative/items/qsgvisualitemmodel.cpp index 4dd508d0aa..c6e5896373 100644 --- a/src/declarative/items/qsgvisualitemmodel.cpp +++ b/src/declarative/items/qsgvisualitemmodel.cpp @@ -984,7 +984,7 @@ void QSGVisualDataModel::setDelegate(QDeclarativeComponent *delegate) emit countChanged(); } if (wasValid && !d->m_delegate && d->modelCount()) { - emit itemsRemoved(0, d->modelCount()); + _q_itemsRemoved(0, d->modelCount()); emit countChanged(); } } @@ -1035,7 +1035,7 @@ void QSGVisualDataModel::setRootIndex(const QVariant &root) d->m_abstractItemModel->fetchMore(modelIndex); int newCount = d->modelCount(); if (d->m_delegate && oldCount) - emit itemsRemoved(0, oldCount); + _q_itemsRemoved(0, oldCount); if (d->m_delegate && newCount) emit itemsInserted(0, newCount); if (newCount != oldCount) diff --git a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp index f8a2a1f859..d1dc6c97b9 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp +++ b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp @@ -274,6 +274,7 @@ void tst_qsgvisualdatamodel::childChanged() QSGVisualDataModel *vdm = listview->findChild<QSGVisualDataModel*>("visualModel"); vdm->setRootIndex(QVariant::fromValue(model.indexFromItem(model.item(1,0)))); + QCOMPARE(listview->count(), 1); QSGText *name = findItem<QSGText>(contentItem, "display", 0); QVERIFY(name); @@ -289,7 +290,7 @@ void tst_qsgvisualdatamodel::childChanged() QCOMPARE(name->text(), QString("Row 2 updated child")); model.item(1,0)->appendRow(new QStandardItem(QLatin1String("Row 2 Child Item 2"))); - QTest::qWait(300); + QCOMPARE(listview->count(), 2); name = findItem<QSGText>(contentItem, "display", 1); QVERIFY(name != 0); @@ -300,7 +301,7 @@ void tst_qsgvisualdatamodel::childChanged() QVERIFY(name == 0); vdm->setRootIndex(QVariant::fromValue(QModelIndex())); - QTest::qWait(300); + QCOMPARE(listview->count(), 3); name = findItem<QSGText>(contentItem, "display", 0); QVERIFY(name); QCOMPARE(name->text(), QString("Row 1 Item")); |