diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-07-17 10:47:45 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-17 12:49:15 +0200 |
commit | 6a79d26b8353c241c3ffa21931efa279eeee1a28 (patch) | |
tree | 7be32929c6cc179a25eb16270e5713f23fd037ea /tests/auto/quick/shared | |
parent | ba94fbedd648b04a28d67b920db2883e73459d1f (diff) |
Don't double reference items created following a model reset.
If the model was reset then regenerate and exit immediately rather
than processing the change set.
Task-number: QTBUG-26536
Change-Id: I9d4f20d450a5116957c9468ba6088caad026a497
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/shared')
-rw-r--r-- | tests/auto/quick/shared/viewtestutil.cpp | 7 | ||||
-rw-r--r-- | tests/auto/quick/shared/viewtestutil.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp index 59ebed50b9..f68ca1fd33 100644 --- a/tests/auto/quick/shared/viewtestutil.cpp +++ b/tests/auto/quick/shared/viewtestutil.cpp @@ -403,6 +403,13 @@ void QQuickViewTestUtil::QaimModel::reset() emit endResetModel(); } +void QQuickViewTestUtil::QaimModel::resetItems(const QList<QPair<QString, QString> > &items) +{ + beginResetModel(); + list = items; + endResetModel(); +} + void QQuickViewTestUtil::QaimModel::matchAgainst(const QList<QPair<QString, QString> > &other, const QString &error1, const QString &error2) { for (int i=0; i<other.count(); i++) { QVERIFY2(list.contains(other[i]), diff --git a/tests/auto/quick/shared/viewtestutil.h b/tests/auto/quick/shared/viewtestutil.h index 66921a7273..3108030406 100644 --- a/tests/auto/quick/shared/viewtestutil.h +++ b/tests/auto/quick/shared/viewtestutil.h @@ -144,6 +144,7 @@ namespace QQuickViewTestUtil void clear(); void reset(); + void resetItems(const QList<QPair<QString, QString> > &items); void matchAgainst(const QList<QPair<QString, QString> > &other, const QString &error1, const QString &error2); |