diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-08-02 15:19:06 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-05 04:56:52 +0200 |
commit | bbe72dadd3ab73a2a3a7dabfb9db3e99b36a272a (patch) | |
tree | 4df5c242fd4fbb23056c30e14717a01beed91eee /tests/auto/declarative/qsgpathview | |
parent | aa54e27adeff3c7e6f59e2d68e9f006e60e542dc (diff) |
Don't cache model data in VisualDataModel.
VisualDataModel doesn't have any way to monitor the lifetime of objects
cached other than relying on the source model to emit a changed signal.
If the model doesn't do this or a pointer property is referenced after
an item has been removed from the model then cache can return a stale
pointer. This can be avoided by querying the model directly whenever
a property is accessed.
Task-number: QTBUG-18036
Change-Id: I7688174c2337cb5c0f77eb7d31a01f4aa958071b
Reviewed-on: http://codereview.qt.nokia.com/2647
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qsgpathview')
-rw-r--r-- | tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp index 00202f7436..96a591f511 100644 --- a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp +++ b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp @@ -835,7 +835,7 @@ void tst_QSGPathView::modelChanges() QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel"); QVERIFY(alternateModel); - QVariant modelVariant = QVariant::fromValue(alternateModel); + QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel); QSignalSpy modelSpy(pathView, SIGNAL(modelChanged())); pathView->setModel(modelVariant); |