summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-06-09 14:24:23 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2010-07-28 14:01:06 +0200
commit033def369cb0bda5ce134b7dabe97465596ed3e1 (patch)
treefee19117d460f87c41e6338ac410b3bb3a2595f6
parent24a736b602878c9f89b5d1a7cf0fda278f8f1da5 (diff)
downloadqt-creator-033def369cb0bda5ce134b7dabe97465596ed3e1.tar.gz
QmlJS: Make qmldump not dump open/dynamic meta objects.
They would need special treatment, like the Qml extended objects. The issue is they lead to two meta objects with the same classname and the dumper can't handle that. (cherry picked from commit 206c190e7ff3e7dfd59341fa99207c0d1bff0dd7)
-rw-r--r--src/tools/qml/qmldump/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/qml/qmldump/main.cpp b/src/tools/qml/qmldump/main.cpp
index 525ccd8335..4dcdb0156c 100644
--- a/src/tools/qml/qmldump/main.cpp
+++ b/src/tools/qml/qmldump/main.cpp
@@ -9,7 +9,10 @@
#include <QDebug>
#include <iostream>
#include <QtDeclarative>
+#include <QtCore/private/qobject_p.h>
+#include <QtCore/private/qmetaobject_p.h>
#include <QtDeclarative/private/qdeclarativemetatype_p.h>
+#include <QtDeclarative/private/qdeclarativeopenmetaobject_p.h>
#include <QtDeclarative/QDeclarativeView>
static QHash<QByteArray, const QDeclarativeType *> qmlTypeByCppName;
@@ -46,7 +49,11 @@ void processMetaObject(const QMetaObject *meta, QSet<const QMetaObject *> *metas
if (! meta || metas->contains(meta))
return;
- metas->insert(meta);
+ // dynamic meta objects break things badly
+ const QMetaObjectPrivate *mop = reinterpret_cast<const QMetaObjectPrivate *>(meta->d.data);
+ if (!(mop->flags & DynamicMetaObject))
+ metas->insert(meta);
+
processMetaObject(meta->superClass(), metas);
}