summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-02-15 13:00:27 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2011-02-16 08:17:02 (GMT)
commit35a36e91606eaf8374a2273cbb0101e0e614321e (patch)
tree326a85d5a3586980bb11cf415052d0c7e4fb33ca /src/declarative/qml
parent6c3868572d8f109884a1b3fb806331fda3ef84d4 (diff)
downloadQt-35a36e91606eaf8374a2273cbb0101e0e614321e.zip
Qt-35a36e91606eaf8374a2273cbb0101e0e614321e.tar.gz
Qt-35a36e91606eaf8374a2273cbb0101e0e614321e.tar.bz2
QDeclarativeDebug: Fix crash when serializing list of QObjects
Task-number: QTBUG-17444 Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 8c7f3ad..31fd516 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -167,17 +167,19 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) const
{
int userType = value.userType();
- if (QDeclarativeValueTypeFactory::isValueType(userType))
- return value;
- /*
- if (QDeclarativeMetaType::isList(userType)) {
- int count = QDeclarativeMetaType::listCount(value);
+ if (value.type() == QVariant::List) {
QVariantList contents;
- for (int i=0; i<count; i++)
- contents << valueContents(QDeclarativeMetaType::listAt(value, i));
+ QVariantList list = value.toList();
+ int count = list.size();
+ for (int i = 0; i < count; i++)
+ contents << valueContents(list.at(i));
return contents;
- } else */
+ }
+
+ if (QDeclarativeValueTypeFactory::isValueType(userType))
+ return value;
+
if (QDeclarativeMetaType::isQObject(userType)) {
QObject *o = QDeclarativeMetaType::toQObject(value);
if (o) {