summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-03-09 04:22:07 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-03-09 04:22:07 (GMT)
commit6a5891e7bfd182a52fd71f1b5fdf4d73def63603 (patch)
tree483385969c470974d505c32184620add5f841d5c /src/corelib
parentc04a6e34b3d4da24d3cc26e192bebff2d3b79d19 (diff)
downloadQt-6a5891e7bfd182a52fd71f1b5fdf4d73def63603.zip
Qt-6a5891e7bfd182a52fd71f1b5fdf4d73def63603.tar.gz
Qt-6a5891e7bfd182a52fd71f1b5fdf4d73def63603.tar.bz2
Integrate QML's object ownership with the JS collector
QML now behaves in a way similar to QtScript when it comes to QObject ownership. QT-2803
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/kernel/qobject_p.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 389e6e7..68f34ca 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2033,6 +2033,8 @@ void QObjectPrivate::setParent_helper(QObject *o)
}
}
}
+ if (!wasDeleted && declarativeData)
+ declarativeData->parentChanged(q, o);
}
/*!
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index cc5bf97..20e3da1 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -90,6 +90,7 @@ class Q_CORE_EXPORT QDeclarativeData
public:
virtual ~QDeclarativeData();
virtual void destroyed(QObject *) = 0;
+ virtual void parentChanged(QObject *, QObject *) = 0;
};
class Q_CORE_EXPORT QObjectPrivate : public QObjectData