diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-05-12 05:20:16 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-05-12 05:20:16 (GMT) |
commit | 4e19d0393dd4b4ddcdbe1677987d9370a5d605bb (patch) | |
tree | 2a4ff75f98fab22c4073e3ab4cf5cacf467e83f8 /src/declarative/fx/qfxvisualitemmodel.cpp | |
parent | 8d90fe1e4a3d50b64cff84ac10bfa2e6a17a35b9 (diff) | |
download | Qt-4e19d0393dd4b4ddcdbe1677987d9370a5d605bb.zip Qt-4e19d0393dd4b4ddcdbe1677987d9370a5d605bb.tar.gz Qt-4e19d0393dd4b4ddcdbe1677987d9370a5d605bb.tar.bz2 |
More robust error handling (in ListView) and reporting (in VisualModel).
Diffstat (limited to 'src/declarative/fx/qfxvisualitemmodel.cpp')
-rw-r--r-- | src/declarative/fx/qfxvisualitemmodel.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index 61f08de..533917e 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -512,12 +512,17 @@ QFxItem *QFxVisualItemModel::item(int index, const QByteArray &viewId, bool comp nobj = d->m_delegate->beginCreate(ctxt); if (complete) d->m_delegate->completeCreate(); - ctxt->setParent(nobj); - data->setParent(nobj); + if (nobj) { + ctxt->setParent(nobj); + data->setParent(nobj); - d->m_cache.insert(index, nobj); + d->m_cache.insert(index, nobj); + } else { + delete data; + delete ctxt; + qWarning() << d->m_delegate->errors(); + } } - QFxItem *item = qobject_cast<QFxItem *>(nobj); if (!item) { QmlPackage *package = qobject_cast<QmlPackage *>(nobj); |