aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/qtquick2.cpp
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2012-03-12 14:08:56 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-19 10:49:45 +0100
commitcad5df2572d023d1d8ab213d7e736f8d15576916 (patch)
treea6622cb4597020a1da4be95de1dc47bc97529811 /src/quick/qtquick2.cpp
parentaf3a8708b46e8ae6e177dcee028364bd9fd285cd (diff)
QmlDebugging: Object Tree and States List
All created instances are stored under the root context. Check for the creation context of the object when building up the tree. Do the same when building up the states list. Change-Id: I8716d9966a61b8f7cb3ad4b7ab5acd4c94b4cd03 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'src/quick/qtquick2.cpp')
-rw-r--r--src/quick/qtquick2.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 32a9d382f2..a97dade106 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -63,7 +63,7 @@ class QQmlQtQuick2DebugStatesDelegate : public QQmlDebugStatesDelegate
public:
QQmlQtQuick2DebugStatesDelegate();
virtual ~QQmlQtQuick2DebugStatesDelegate();
- virtual void buildStatesList(QQmlContext *ctxt, bool cleanList);
+ virtual void buildStatesList(bool cleanList, const QList<QPointer<QObject> > &instances);
virtual void updateBinding(QQmlContext *context,
const QQmlProperty &property,
const QVariant &expression, bool isLiteralValue,
@@ -90,20 +90,15 @@ QQmlQtQuick2DebugStatesDelegate::~QQmlQtQuick2DebugStatesDelegate()
{
}
-void QQmlQtQuick2DebugStatesDelegate::buildStatesList(QQmlContext *ctxt, bool cleanList)
+void QQmlQtQuick2DebugStatesDelegate::buildStatesList(bool cleanList,
+ const QList<QPointer<QObject> > &instances)
{
if (cleanList)
m_allStates.clear();
- QQmlContextPrivate *ctxtPriv = QQmlContextPrivate::get(ctxt);
- for (int ii = 0; ii < ctxtPriv->instances.count(); ++ii) {
- buildStatesList(ctxtPriv->instances.at(ii));
- }
-
- QQmlContextData *child = QQmlContextData::get(ctxt)->childContexts;
- while (child) {
- buildStatesList(child->asQQmlContext());
- child = child->nextChild;
+ //only root context has all instances
+ for (int ii = 0; ii < instances.count(); ++ii) {
+ buildStatesList(instances.at(ii));
}
}