summaryrefslogtreecommitdiff
path: root/src/libs/qmldebug/basetoolsclient.cpp
blob: 201870665cb57d9ad637218d65eac3461eb66cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "basetoolsclient.h"

namespace QmlDebug {

BaseToolsClient::BaseToolsClient(QmlDebugConnection* client, QLatin1String clientName)
    : QmlDebugClient(clientName, client)
{
    setObjectName(clientName);
}

void BaseToolsClient::stateChanged(State state)
{
    emit newState(state);
}

void BaseToolsClient::recurseObjectIdList(const ObjectReference &ref,
                         QList<int> &debugIds, QList<QString> &objectIds)
{
    debugIds << ref.debugId();
    objectIds << ref.idString();
    const QList<ObjectReference> children = ref.children();
    for (const ObjectReference &child : children)
        recurseObjectIdList(child, debugIds, objectIds);
}

} // namespace QmlDebug