diff options
Diffstat (limited to 'src/declarative/qml/qmlenginedebug.cpp')
-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; } |