Changed qmldump to also output the default property when there is one.

This commit is contained in:
Erik Verbruggen
2010-03-31 14:09:49 +02:00
parent dc197e743c
commit 3d2f704817

View File

@@ -62,10 +62,10 @@ void processObject(QObject *object, QSet<const QMetaObject *> *metas)
QMetaProperty prop = meta->property(index);
if (QDeclarativeMetaType::isQObject(prop.userType())) {
QObject *oo = QDeclarativeMetaType::toQObject(prop.read(object));
processObject(oo, metas);
if (oo && !metas->contains(oo->metaObject()))
processObject(oo, metas);
}
}
}
void processDeclarativeType(const QDeclarativeType *ty, QSet<const QMetaObject *> *metas)
@@ -187,6 +187,14 @@ void dump(const QMetaObject *meta, QXmlStreamWriter *xml)
attributes.append(QXmlStreamAttribute("version", QString("%1.%2").arg(qmlTy->majorVersion()).arg(qmlTy->minorVersion())));
}
for (int index = meta->classInfoCount() - 1 ; index >= 0 ; --index) {
QMetaClassInfo classInfo = meta->classInfo(index);
if (QLatin1String(classInfo.name()) == QLatin1String("DefaultProperty")) {
attributes.append(QXmlStreamAttribute("defaultProperty", QLatin1String(classInfo.value())));
break;
}
}
QString version;
if (meta->superClass())