QmlDesigner: Implement debugOutput

Change-Id: I081866dcba41a8cbed1243dd9e235aca5c30beee
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Thomas Hartmann
2015-07-09 12:50:02 +02:00
committed by Thomas Hartmann
parent c64657da22
commit 9b4512f906
2 changed files with 18 additions and 1 deletions

View File

@@ -157,6 +157,7 @@ public:
signals: signals:
void qmlPuppetCrashed(); void qmlPuppetCrashed();
void qmlPuppetError(const QString &errorMessage);
private: // functions private: // functions
void activateState(const NodeInstance &instance); void activateState(const NodeInstance &instance);

View File

@@ -69,6 +69,7 @@
#include "componentcompletedcommand.h" #include "componentcompletedcommand.h"
#include "tokencommand.h" #include "tokencommand.h"
#include "removesharedmemorycommand.h" #include "removesharedmemorycommand.h"
#include "debugoutputcommand.h"
#include "nodeinstanceserverproxy.h" #include "nodeinstanceserverproxy.h"
@@ -1285,8 +1286,23 @@ void NodeInstanceView::token(const TokenCommand &command)
emitInstanceToken(command.tokenName(), command.tokenNumber(), nodeVector); emitInstanceToken(command.tokenName(), command.tokenNumber(), nodeVector);
} }
void NodeInstanceView::debugOutput(const DebugOutputCommand & /*command*/) void NodeInstanceView::debugOutput(const DebugOutputCommand & command)
{ {
if (command.instanceIds().isEmpty()) {
qmlPuppetError(command.text()); // TODO: connect that somewhere to show that to the user
} else {
QVector<qint32> instanceIdsWithChangedErrors;
foreach (qint32 instanceId, command.instanceIds()) {
NodeInstance instance = instanceForId(instanceId);
if (instance.isValid()) {
if (instance.setError(command.text()))
instanceIdsWithChangedErrors.append(instanceId);
} else {
qmlPuppetError(command.text()); // TODO: connect that somewhere to show that to the user
}
}
emitInstanceErrorChange(instanceIdsWithChangedErrors);
}
} }
void NodeInstanceView::sendToken(const QString &token, int number, const QVector<ModelNode> &nodeVector) void NodeInstanceView::sendToken(const QString &token, int number, const QVector<ModelNode> &nodeVector)