From f447e64f378fdebea3b8f2fca5624f48546a0529 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 4 Nov 2009 16:20:56 +1000 Subject: Use QML type names in object tree --- src/declarative/qml/qmlenginedebug.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- cgit v0.12