diff options
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 81ccec3571..d082b9a8fd 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) |