diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-11-26 10:01:56 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-11-26 10:02:56 +0100 |
commit | ee6aa999ab0439dcb7a95af3dc9905a6daf13491 (patch) | |
tree | 8c83fc72ce62676b8431a1226f9cb9d6f39da4a0 /src/qml/qml/qqmlengine.cpp | |
parent | f449534020adc8623ebfced5daae331ef56c4421 (diff) | |
parent | ce38c71b1c300f700a9ff004b7c163cc290ecae9 (diff) |
Merge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative into stable
Change-Id: I0bf06be69927d5961f1bdb4948c3572ef6111923
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 67e1556486..1eec710c84 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -615,12 +615,18 @@ void QQmlPrivate::qdeclarativeelement_destructor(QObject *o) void QQmlData::destroyed(QAbstractDeclarativeData *d, QObject *o) { - static_cast<QQmlData *>(d)->destroyed(o); + QQmlData *ddata = static_cast<QQmlData *>(d); + if (ddata->ownedByQml1) + return; + ddata->destroyed(o); } void QQmlData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QObject *p) { - static_cast<QQmlData *>(d)->parentChanged(o, p); + QQmlData *ddata = static_cast<QQmlData *>(d); + if (ddata->ownedByQml1) + return; + ddata->parentChanged(o, p); } class QQmlThreadNotifierProxyObject : public QObject @@ -649,6 +655,7 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in { QQmlData *ddata = QQmlData::get(object, false); if (!ddata) return; // Probably being deleted + if (ddata->ownedByQml1) return; // In general, QML only supports QObject's that live on the same thread as the QQmlEngine // that they're exposed to. However, to make writing "worker objects" that calculate data @@ -706,12 +713,18 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in int QQmlData::receivers(QAbstractDeclarativeData *d, const QObject *, int index) { - return static_cast<QQmlData *>(d)->endpointCount(index); + QQmlData *ddata = static_cast<QQmlData *>(d); + if (ddata->ownedByQml1) + return 0; + return ddata->endpointCount(index); } bool QQmlData::isSignalConnected(QAbstractDeclarativeData *d, const QObject *, int index) { - return static_cast<QQmlData *>(d)->signalHasEndpoint(index); + QQmlData *ddata = static_cast<QQmlData *>(d); + if (ddata->ownedByQml1) + return false; + return ddata->signalHasEndpoint(index); } int QQmlData::endpointCount(int index) |