aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/qtquick2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/qtquick2.cpp')
-rw-r--r--src/quick/qtquick2.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 621c3ff18e..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));
}
}
@@ -135,10 +130,11 @@ void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context,
QQmlBinding *newBinding = 0;
if (!isLiteralValue) {
- newBinding = new QQmlBinding(expression.toString(), object, context);
+ newBinding = new QQmlBinding(expression.toString(), false, object,
+ QQmlContextData::get(context), fileName,
+ line, column);
newBinding->setTarget(property);
newBinding->setNotifyOnValueChanged(true);
- newBinding->setSourceLocation(fileName, line, column);
}
state->changeBindingInRevertList(object, propertyName, newBinding);