From e528394f428ba815fe61e4d2f5248b9bd11db375 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 16 Dec 2009 14:50:39 +1000 Subject: Include more info for state debugging. --- src/declarative/util/qmlstate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 98cc0b6..1749c3a 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -444,10 +444,10 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever if (stateChangeDebug()) { foreach(const Action &action, applyList) { if (action.event) - qWarning() << " Action event:" << action.event; + qWarning() << " Action event:" << action.event->typeName(); else qWarning() << " Action:" << action.property.object() - << action.property.name() << action.toValue; + << action.property.name() << action.fromValue << action.toValue; } } -- cgit v0.12 From 6fe6e803f08750534a6c14b4a2847a6ec1b29350 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 16 Dec 2009 15:35:44 +1000 Subject: Use the component name as the base class name for dynamic meta objects when appropriate. This allows for much improved debug presentation. e.g. what used to be shown as "QmlGraphicsRectangle_QML_3" can now be show as "MyComponent". --- src/declarative/qml/qmlcompiler.cpp | 8 ++++++++ src/declarative/qml/qmlenginedebug.cpp | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 9df9b40..197cc0f 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -2182,6 +2182,14 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) newClassName.append("_QML_"); int idx = classIndexCounter()->fetchAndAddRelaxed(1); newClassName.append(QByteArray::number(idx)); + if (compileState.root == obj) { + QString path = output->url.path(); + int lastSlash = path.lastIndexOf(QLatin1Char('/')); + if (lastSlash > -1) { + QString nameBase = path.mid(lastSlash + 1, path.length()-lastSlash-5); + newClassName = nameBase.toUtf8() + "_QMLTYPE_" + QByteArray::number(idx); + } + } QMetaObjectBuilder builder; builder.setClassName(newClassName); diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 6cb57b2..46490fb 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -285,6 +285,9 @@ QmlEngineDebugServer::objectData(QObject *object) 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); } return rv; -- cgit v0.12