QmlDesigner: fix memory usage of qml2puppet

In Qt Quick 2 the parent property is writable.
Therefore the InstanceSpy always collected the complete
object tree waisting memory.

Change-Id: I44f2d1ad90ef2bbea34a7cbd414f88cae37e0462
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
Thomas Hartmann
2013-03-12 15:06:08 +01:00
parent 2b11c75cad
commit ab675bb143
@@ -82,8 +82,9 @@ void NodeInstanceSignalSpy::registerObject(QObject *spiedObject, const QString &
// search recursive in objects
if (metaProperty.isReadable()
&& metaProperty.isWritable()
&& QQmlMetaType::isQObject(metaProperty.userType())) {
&& metaProperty.isWritable()
&& QQmlMetaType::isQObject(metaProperty.userType())
&& QLatin1String(metaProperty.name()) != QLatin1String("parent")) {
QObject *propertyObject = QQmlMetaType::toQObject(metaProperty.read(spiedObject));
if (propertyObject)
registerObject(propertyObject, prefix + metaProperty.name() + QLatin1Char('/'));