forked from qt-creator/qt-creator
QmlJSInspector: New Objects created
Send the engineid, objectid and parentid. Change-Id: I7b340c1f20ba3eb3f1690d45b28819f6efaae013 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -188,7 +188,10 @@ void BaseEngineDebugClient::messageReceived(const QByteArray &data)
|
|||||||
ds >> type;
|
ds >> type;
|
||||||
|
|
||||||
if (type == "OBJECT_CREATED") {
|
if (type == "OBJECT_CREATED") {
|
||||||
emit newObjects();
|
int engineId;
|
||||||
|
int objectId;
|
||||||
|
ds >> engineId >> objectId;
|
||||||
|
emit newObject(engineId, objectId, -1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void newStatus(QmlDebug::ClientStatus status);
|
void newStatus(QmlDebug::ClientStatus status);
|
||||||
void newObjects();
|
void newObject(int engineId, int objectId, int parentId);
|
||||||
void valueChanged(int debugId, const QByteArray &name,
|
void valueChanged(int debugId, const QByteArray &name,
|
||||||
const QVariant &value);
|
const QVariant &value);
|
||||||
void result(quint32 queryId, const QVariant &result, const QByteArray &type);
|
void result(quint32 queryId, const QVariant &result, const QByteArray &type);
|
||||||
|
|||||||
@@ -90,4 +90,22 @@ quint32 QmlEngineDebugClient::setMethodBody(
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlEngineDebugClient::messageReceived(const QByteArray &data)
|
||||||
|
{
|
||||||
|
QDataStream ds(data);
|
||||||
|
int queryId;
|
||||||
|
QByteArray type;
|
||||||
|
ds >> type >> queryId;
|
||||||
|
|
||||||
|
if (type == "OBJECT_CREATED") {
|
||||||
|
int engineId;
|
||||||
|
int objectId;
|
||||||
|
int parentId;
|
||||||
|
ds >> engineId >> objectId >> parentId;
|
||||||
|
emit newObject(engineId, objectId, parentId);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
BaseEngineDebugClient::messageReceived(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
} // namespace QmlDebug
|
} // namespace QmlDebug
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ public:
|
|||||||
quint32 resetBindingForObject(int objectDebugId, const QString &propertyName);
|
quint32 resetBindingForObject(int objectDebugId, const QString &propertyName);
|
||||||
quint32 setMethodBody(int objectDebugId, const QString &methodName,
|
quint32 setMethodBody(int objectDebugId, const QString &methodName,
|
||||||
const QString &methodBody);
|
const QString &methodBody);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void messageReceived(const QByteArray &data);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDebug
|
} // namespace QmlDebug
|
||||||
|
|||||||
@@ -345,8 +345,8 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
|
|||||||
this, SLOT(updateStatus()));
|
this, SLOT(updateStatus()));
|
||||||
disconnect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
|
disconnect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
|
||||||
this, SLOT(onResult(quint32,QVariant,QByteArray)));
|
this, SLOT(onResult(quint32,QVariant,QByteArray)));
|
||||||
disconnect(m_engineClient, SIGNAL(newObjects()),
|
disconnect(m_engineClient, SIGNAL(newObject(int,int,int)),
|
||||||
this, SLOT(newObjects()));
|
this, SLOT(newObject(int,int,int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_engineClient = client;
|
m_engineClient = client;
|
||||||
@@ -356,8 +356,8 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
|
|||||||
this, SLOT(updateStatus()));
|
this, SLOT(updateStatus()));
|
||||||
connect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
|
connect(m_engineClient, SIGNAL(result(quint32,QVariant,QByteArray)),
|
||||||
this, SLOT(onResult(quint32,QVariant,QByteArray)));
|
this, SLOT(onResult(quint32,QVariant,QByteArray)));
|
||||||
connect(m_engineClient, SIGNAL(newObjects()),
|
connect(m_engineClient, SIGNAL(newObject(int,int,int)),
|
||||||
this, SLOT(newObjects()));
|
this, SLOT(newObject(int,int,int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStatus();
|
updateStatus();
|
||||||
@@ -425,7 +425,7 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlInspectorAgent::newObjects()
|
void QmlInspectorAgent::newObject(int /*engineId*/, int /*objectId*/, int /*parentId*/)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "()";
|
qDebug() << __FUNCTION__ << "()";
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ signals:
|
|||||||
private slots:
|
private slots:
|
||||||
void updateStatus();
|
void updateStatus();
|
||||||
void onResult(quint32 queryId, const QVariant &value, const QByteArray &type);
|
void onResult(quint32 queryId, const QVariant &value, const QByteArray &type);
|
||||||
void newObjects();
|
void newObject(int engineId, int objectId, int parentId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reloadEngines();
|
void reloadEngines();
|
||||||
|
|||||||
Reference in New Issue
Block a user