Qml Debugging: only read properties that can be displayed in the debugger
authorChristiaan Janssen <christiaan.janssen@nokia.com>
Tue, 19 Jul 2011 16:07:46 +0000 (18:07 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 21 Jul 2011 10:10:54 +0000 (12:10 +0200)
Change-Id: I68a6636aae271924bcec31ce7ad76c01fc43080b
Task-number: QTCREATORBUG-5075
Reviewed-on: http://codereview.qt.nokia.com/1893
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
src/declarative/qml/qdeclarativeenginedebug.cpp
src/declarative/qml/qdeclarativewatcher.cpp

index af99f05..6c605cb 100644 (file)
@@ -147,12 +147,6 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
     if (binding)
         rv.binding = binding->expression();
 
-    QVariant value;
-    if (prop.userType() != 0) {
-        value = prop.read(obj);
-    }
-    rv.value = valueContents(value);
-
     if (QDeclarativeValueTypeFactory::isValueType(prop.userType())) {
         rv.type = QDeclarativeObjectProperty::Basic;
     } else if (QDeclarativeMetaType::isQObject(prop.userType()))  {
@@ -161,6 +155,12 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
         rv.type = QDeclarativeObjectProperty::List;
     }
 
+    QVariant value;
+    if (rv.type != QDeclarativeObjectProperty::Unknown && prop.userType() != 0) {
+        value = prop.read(obj);
+    }
+    rv.value = valueContents(value);
+
     return rv;
 }
 
index c174998..33f0358 100644 (file)
@@ -47,6 +47,7 @@
 
 #include <qdeclarativedebugservice_p.h>
 #include "private/qdeclarativeproperty_p.h"
+#include "private/qdeclarativevaluetype_p.h"
 
 #include <QtCore/qmetaobject.h>
 #include <QtCore/qdebug.h>
@@ -112,7 +113,7 @@ void QDeclarativeWatchProxy::notifyValueChanged()
     QVariant v;
     if (m_expr)
         v = m_expr->evaluate();
-    else
+    else if (QDeclarativeValueTypeFactory::isValueType(m_property.userType()))
         v = m_property.read(m_object);
 
     emit m_watch->propertyChanged(m_id, m_debugId, m_property, v);