Commit 3d2f7048 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

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

parent dc197e74
......@@ -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())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment