summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-10-15 00:13:55 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-10-15 00:13:55 (GMT)
commitfb5d5ce1cd1e2714343c3e26338601aa5dd79a54 (patch)
tree535d19204e917e4ef82b8f11ce2e516828c62ea4 /src/declarative
parenta02233bb18706569fb78ccfaa1f6c05d5523bc3d (diff)
downloadQt-fb5d5ce1cd1e2714343c3e26338601aa5dd79a54.zip
Qt-fb5d5ce1cd1e2714343c3e26338601aa5dd79a54.tar.gz
Qt-fb5d5ce1cd1e2714343c3e26338601aa5dd79a54.tar.bz2
Give more information about the value of a property when the variant
toString() is empty.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlenginedebug.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp
index e20616a..1c7450a 100644
--- a/src/declarative/qml/qmlenginedebug.cpp
+++ b/src/declarative/qml/qmlenginedebug.cpp
@@ -318,7 +318,7 @@ void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QByteArra
QByteArray reply;
QVariant v;
QDataStream rs(&reply, QIODevice::WriteOnly);
-
+
if (value.type() == QVariant::UserType || QmlMetaType::isObject(value.userType())) {
QObject *o = QmlMetaType::toQObject(value);
if (o) {
@@ -327,9 +327,15 @@ void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QByteArra
objectName = QLatin1String("<unnamed>");
v = QString::fromUtf8(o->metaObject()->className()) +
QLatin1String(": ") + objectName;
+ } else {
+ v = QString::fromUtf8(value.typeName());
+ }
+ if (v.isNull()) {
+ QString s = value.toString();
+ if (s.isEmpty())
+ s = QLatin1String("<unknown>");
+ v = s;
}
- if (v.isNull())
- v = value.toString();
} else {
v = value;
}