aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-03-15 12:12:22 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-03-31 08:30:56 +0000
commit9b4d31825e5f76e91af555549223ea6b33dd37e6 (patch)
tree47a8d363f4dee6cf8be7257b8255bb861566559d /src/plugins
parentda6fd9c762561d41ce3372c98a555771d18241d6 (diff)
Qml Debugger: Make sure all objects have a type
QQmlMetaType::prettyTypeName() does a better job in finding a valid type name for our objects than we can do ourselves. Task-number: QTCREATORBUG-17741 Change-Id: Ie8a192aceb230e73b5295b745987692548aff641 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index 151e44c4d4..3fb0522cd1 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -409,18 +409,7 @@ QQmlEngineDebugServiceImpl::objectData(QObject *object)
rv.objectId = QQmlDebugService::idForObject(object);
rv.contextId = QQmlDebugService::idForObject(qmlContext(object));
rv.parentId = QQmlDebugService::idForObject(object->parent());
- QQmlType *type = QQmlMetaType::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());
- int marker = rv.objectType.indexOf(QLatin1String("_QMLTYPE_"));
- if (marker != -1)
- rv.objectType = rv.objectType.left(marker);
- }
-
+ rv.objectType = QQmlMetaType::prettyTypeName(object);
return rv;
}