diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-11-04 06:20:56 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-11-04 06:20:56 (GMT) |
commit | f447e64f378fdebea3b8f2fca5624f48546a0529 (patch) | |
tree | 7dc612db04c6eafe3c01a9560dd0df43c9c20fa5 | |
parent | 6225455eb1309ae5f1b441e1d4e8b4db547eb9b0 (diff) | |
download | Qt-f447e64f378fdebea3b8f2fca5624f48546a0529.zip Qt-f447e64f378fdebea3b8f2fca5624f48546a0529.tar.gz Qt-f447e64f378fdebea3b8f2fca5624f48546a0529.tar.bz2 |
Use QML type names in object tree
-rw-r--r-- | src/declarative/qml/qmlenginedebug.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 2d8acf7..52d54b9 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -271,10 +271,18 @@ QmlEngineDebugServer::objectData(QObject *object) } rv.objectName = object->objectName(); - rv.objectType = QString::fromUtf8(object->metaObject()->className()); rv.objectId = QmlDebugService::idForObject(object); rv.contextId = QmlDebugService::idForObject(qmlContext(object)); + QmlType *type = QmlMetaType::qmlType(object->metaObject()); + if (type) { + QString typeName = type->qmlTypeName(); + int lastSlash = typeName.lastIndexOf(QLatin1Char('/')); + rv.objectType = lastSlash < 0 ? typeName : typeName.mid(lastSlash+1); + } else { + rv.objectType = QString::fromUtf8(object->metaObject()->className()); + } + return rv; } |