forked from qt-creator/qt-creator
Qml Debugger: process the contexts recursively
This commit is contained in:
@@ -279,19 +279,21 @@ void ClientProxy::queryEngineContext(int id)
|
|||||||
void ClientProxy::contextChanged()
|
void ClientProxy::contextChanged()
|
||||||
{
|
{
|
||||||
if (m_contextQuery) {
|
if (m_contextQuery) {
|
||||||
m_rootObjects = m_contextQuery->rootContext().objects();
|
m_rootObjects.clear();
|
||||||
|
QDeclarativeDebugContextReference rootContext = m_contextQuery->rootContext();
|
||||||
delete m_contextQuery;
|
delete m_contextQuery;
|
||||||
m_contextQuery = 0;
|
m_contextQuery = 0;
|
||||||
|
|
||||||
if (m_rootObjects.isEmpty()) {
|
|
||||||
emit objectTreeUpdated();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
qDeleteAll(m_objectTreeQuery);
|
qDeleteAll(m_objectTreeQuery);
|
||||||
m_objectTreeQuery.clear();
|
m_objectTreeQuery.clear();
|
||||||
|
|
||||||
foreach(const QDeclarativeDebugObjectReference & obj, m_rootObjects) {
|
fetchContextObjectRecusrsive(rootContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientProxy::fetchContextObjectRecusrsive(const QDeclarativeDebugContextReference& context)
|
||||||
|
{
|
||||||
|
foreach (const QDeclarativeDebugObjectReference & obj, context.objects()) {
|
||||||
QDeclarativeDebugObjectQuery* query = m_client->queryObjectRecursive(obj, this);
|
QDeclarativeDebugObjectQuery* query = m_client->queryObjectRecursive(obj, this);
|
||||||
if (!query->isWaiting()) {
|
if (!query->isWaiting()) {
|
||||||
query->deleteLater(); //ignore errors;
|
query->deleteLater(); //ignore errors;
|
||||||
@@ -302,10 +304,12 @@ void ClientProxy::contextChanged()
|
|||||||
SLOT(objectTreeFetched(QDeclarativeDebugQuery::State)));
|
SLOT(objectTreeFetched(QDeclarativeDebugQuery::State)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach (const QDeclarativeDebugContextReference& child, context.contexts()) {
|
||||||
|
fetchContextObjectRecusrsive(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClientProxy::objectTreeFetched(QDeclarativeDebugQuery::State state)
|
void ClientProxy::objectTreeFetched(QDeclarativeDebugQuery::State state)
|
||||||
{
|
{
|
||||||
QDeclarativeDebugObjectQuery *query = qobject_cast<QDeclarativeDebugObjectQuery *>(sender());
|
QDeclarativeDebugObjectQuery *query = qobject_cast<QDeclarativeDebugObjectQuery *>(sender());
|
||||||
|
@@ -124,6 +124,7 @@ private slots:
|
|||||||
void onCurrentObjectsChanged(const QList<int> &debugIds, bool requestIfNeeded = true);
|
void onCurrentObjectsChanged(const QList<int> &debugIds, bool requestIfNeeded = true);
|
||||||
void updateEngineList();
|
void updateEngineList();
|
||||||
void objectTreeFetched(QDeclarativeDebugQuery::State state = QDeclarativeDebugQuery::Completed);
|
void objectTreeFetched(QDeclarativeDebugQuery::State state = QDeclarativeDebugQuery::Completed);
|
||||||
|
void fetchContextObjectRecusrsive(const QmlJsDebugClient::QDeclarativeDebugContextReference& context);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isDesignClientConnected() const;
|
bool isDesignClientConnected() const;
|
||||||
|
Reference in New Issue
Block a user