summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-11-21 10:34:40 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-22 12:16:13 +0100
commit774eebf9978ac3bf68b124a9e88729cd21068433 (patch)
tree67acb235fade1689232d8624e80fd82736e9171d /tools
parent64b26c6bdac01ec8017c51c5d3e2e21bd997605b (diff)
qmlplugindump: Fix QObject dump.
* Hide deleteLater and the destroyed signal. * Add destroy and toString functions. Task-number: QTCREATORBUG-4903 Change-Id: Icbae3e1c82605baa84ac9cc8f38cd747e4dcf687 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlplugindump/main.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 4dd3fe9871..d52469a5c5 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -374,8 +374,36 @@ public:
implicitSignals.insert(QString("%1Changed").arg(QString::fromUtf8(property.name())));
}
- for (int index = meta->methodOffset(); index < meta->methodCount(); ++index)
- dump(meta->method(index), implicitSignals);
+ if (meta == &QObject::staticMetaObject) {
+ // for QObject, hide deleteLater() and onDestroyed
+ for (int index = meta->methodOffset(); index < meta->methodCount(); ++index) {
+ QMetaMethod method = meta->method(index);
+ const char *signature(method.signature());
+ if (signature == QLatin1String("destroyed(QObject*)")
+ || signature == QLatin1String("destroyed()")
+ || signature == QLatin1String("deleteLater()"))
+ continue;
+ dump(method, implicitSignals);
+ }
+
+ // and add toString(), destroy() and destroy(int)
+ qml->writeStartObject(QLatin1String("Method"));
+ qml->writeScriptBinding(QLatin1String("name"), enquote(QLatin1String("toString")));
+ qml->writeEndObject();
+ qml->writeStartObject(QLatin1String("Method"));
+ qml->writeScriptBinding(QLatin1String("name"), enquote(QLatin1String("destroy")));
+ qml->writeEndObject();
+ qml->writeStartObject(QLatin1String("Method"));
+ qml->writeScriptBinding(QLatin1String("name"), enquote(QLatin1String("destroy")));
+ qml->writeStartObject(QLatin1String("Parameter"));
+ qml->writeScriptBinding(QLatin1String("name"), enquote(QLatin1String("delay")));
+ qml->writeScriptBinding(QLatin1String("type"), enquote(QLatin1String("int")));
+ qml->writeEndObject();
+ qml->writeEndObject();
+ } else {
+ for (int index = meta->methodOffset(); index < meta->methodCount(); ++index)
+ dump(meta->method(index), implicitSignals);
+ }
qml->writeEndObject();
}