diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2011-04-20 12:16:03 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2011-04-20 12:16:03 (GMT) |
commit | 5184d55d434296710041812976656ed6825447ec (patch) | |
tree | ad68ae3ba1ef15d6ed2fed74f76b93e5e9fa1e25 /src/declarative | |
parent | e684cfbe8a873040f1e6b0f7fe4bae76a6c1c5de (diff) | |
download | Qt-5184d55d434296710041812976656ed6825447ec.zip Qt-5184d55d434296710041812976656ed6825447ec.tar.gz Qt-5184d55d434296710041812976656ed6825447ec.tar.bz2 |
QDeclarativeDebug: Fix endless loop for property with SCRITABLE false
Trying to read a property marked as non-scriptable results in an
endless loop in QDeclarativePropertyCache::create .
Task-number: QTBUG-18758
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativeenginedebug.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 31fd516..b2a05c3 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -249,10 +249,16 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message, return; } - message << (object->metaObject()->propertyCount() + fakeProperties.count()); + QList<int> propertyIndexes; + for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii) { + if (object->metaObject()->property(ii).isScriptable()) + propertyIndexes << ii; + } + + message << propertyIndexes.size() + fakeProperties.count(); - for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii) - message << propertyData(object, ii); + for (int ii = 0; ii < propertyIndexes.size(); ++ii) + message << propertyData(object, propertyIndexes.at(ii)); for (int ii = 0; ii < fakeProperties.count(); ++ii) message << fakeProperties[ii]; |