Commit 9ac25a29 authored by Aurindam Jana's avatar Aurindam Jana Committed by hjk

ScriptConsole: Move from Debugger to QmlJSTools

The console is now a part of qmljstools plugin. The console
appears as an output pane. A dummy QScriptEngine evaluates
expressions when a declarative debug session is not in
progress. During a debug session, the expressions are
evaluated by the debug services.

Task-Number: QTCREATORBUG-7402

Change-Id: Ic2eeac44fb335c706be03b89f8672b0356efe984
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@digia.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 614bb335
......@@ -70,12 +70,6 @@ HEADERS += \
debuggertooltipmanager.h \
debuggersourcepathmappingwidget.h \
memoryview.h \
qtmessagelogwindow.h \
qtmessagelogeditor.h \
qtmessagelogview.h \
qtmessagelogproxymodel.h \
qtmessagelogitemdelegate.h \
qtmessageloghandler.h \
localsandexpressionswindow.h
SOURCES += \
......@@ -123,12 +117,6 @@ SOURCES += \
debuggertooltipmanager.cpp \
debuggersourcepathmappingwidget.cpp \
memoryview.cpp \
qtmessagelogwindow.cpp \
qtmessagelogproxymodel.cpp \
qtmessagelogview.cpp \
qtmessagelogitemdelegate.cpp \
qtmessageloghandler.cpp \
qtmessagelogeditor.cpp \
localsandexpressionswindow.cpp
FORMS += \
......
......@@ -101,18 +101,6 @@ QtcPlugin {
"outputcollector.h",
"procinterrupt.cpp",
"procinterrupt.h",
"qtmessagelogeditor.cpp",
"qtmessagelogeditor.h",
"qtmessageloghandler.cpp",
"qtmessageloghandler.h",
"qtmessagelogitemdelegate.cpp",
"qtmessagelogitemdelegate.h",
"qtmessagelogproxymodel.cpp",
"qtmessagelogproxymodel.h",
"qtmessagelogview.cpp",
"qtmessagelogview.h",
"qtmessagelogwindow.cpp",
"qtmessagelogwindow.h",
"registerhandler.cpp",
"registerhandler.h",
"registerwindow.cpp",
......
......@@ -30,12 +30,6 @@
<file>images/location_16.png</file>
<file>images/location_24.png</file>
<file>images/pin.xpm</file>
<file>images/collapse.png</file>
<file>images/error.png</file>
<file>images/expand.png</file>
<file>images/log.png</file>
<file>images/prompt.png</file>
<file>images/warning.png</file>
<file>images/qml/zoom.png</file>
<file>images/qml/select.png</file>
<file>images/qml/app-on-top.png</file>
......
......@@ -3,6 +3,7 @@ include(../../plugins/cpptools/cpptools.pri)
include(../../plugins/find/find.pri)
include(../../plugins/projectexplorer/projectexplorer.pri)
include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/qmljstools/qmljstools.pri)
include(../../libs/cplusplus/cplusplus.pri)
include(../../libs/utils/utils.pri)
include(../../libs/qmljs/qmljs.pri)
......
......@@ -75,7 +75,6 @@ const char DOCKWIDGET_THREADS[] = "Debugger.Docks.Threads";
const char DOCKWIDGET_WATCHERS[] = "Debugger.Docks.LocalsAndWatchers";
const char DOCKWIDGET_QML_INSPECTOR[] = "Debugger.Docks.QmlInspector";
const char DOCKWIDGET_QML_SCRIPTCONSOLE[] = "Debugger.Docks.ScriptConsole";
const char DOCKWIDGET_DEFAULT_AREA[] = "Debugger.Docks.DefaultArea";
} // namespace Constants
......@@ -182,9 +181,8 @@ enum LogChannel
AppOutput, // stdout
AppError, // stderr
AppStuff, // (possibly) windows debug channel
StatusBar, // LogStatus and also put to the status bar
QtMessageLogOutput,
QtMessageLogStatus
StatusBar, // LogStatus and also put to the status bar
ConsoleOutput // Used to output to console
};
enum DebuggerEngineType
......
......@@ -48,7 +48,6 @@
#include "stackhandler.h"
#include "threadshandler.h"
#include "watchhandler.h"
#include "qtmessageloghandler.h"
#include <coreplugin/icore.h>
#include <coreplugin/idocument.h>
......@@ -66,6 +65,8 @@
#include <utils/qtcassert.h>
#include <utils/fileinprojectfinder.h>
#include <qmljstools/qmlconsolemanager.h>
#include <QDebug>
#include <QTimer>
#include <QFile>
......@@ -297,7 +298,6 @@ public:
StackHandler m_stackHandler;
ThreadsHandler m_threadsHandler;
WatchHandler m_watchHandler;
QtMessageLogHandler m_qtMessageHandler;
QFutureInterface<void> m_progress;
DisassemblerAgent m_disassemblerAgent;
......@@ -428,11 +428,6 @@ WatchHandler *DebuggerEngine::watchHandler() const
: &d->m_watchHandler;
}
QtMessageLogHandler *DebuggerEngine::qtMessageLogHandler() const
{
return &d->m_qtMessageHandler;
}
SourceFilesHandler *DebuggerEngine::sourceFilesHandler() const
{
return d->m_masterEngine
......@@ -510,14 +505,6 @@ QAbstractItemModel *DebuggerEngine::sourceFilesModel() const
return model;
}
QAbstractItemModel *DebuggerEngine::qtMessageLogModel() const
{
QAbstractItemModel *model = qtMessageLogHandler()->model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("QtMessageLogModel"));
return model;
}
void DebuggerEngine::fetchMemory(MemoryAgent *, QObject *,
quint64 addr, quint64 length)
{
......@@ -546,8 +533,9 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c
}
//if (msg.size() && msg.at(0).isUpper() && msg.at(1).isUpper())
// qDebug() << qPrintable(msg) << "IN STATE" << state();
if (channel == QtMessageLogOutput)
qtMessageLogHandler()->appendMessage(QtMessageLogHandler::UndefinedType, msg);
QmlJSTools::QmlConsoleManager *consoleManager = QmlJSTools::QmlConsoleManager::instance();
if (channel == ConsoleOutput && consoleManager)
consoleManager->printToConsolePane(QmlJSTools::QmlConsoleItem::UndefinedType, msg);
debuggerCore()->showMessage(msg, channel, timeout);
if (d->m_runControl) {
......
......@@ -77,7 +77,6 @@ class QmlAdapter;
class QmlCppEngine;
class DebuggerToolTipContext;
class MemoryMarkup;
class QtMessageLogHandler;
struct WatchUpdateFlags
{
......@@ -216,7 +215,6 @@ public:
virtual Internal::WatchHandler *watchHandler() const;
virtual Internal::SourceFilesHandler *sourceFilesHandler() const;
virtual Internal::BreakHandler *breakHandler() const;
virtual Internal::QtMessageLogHandler *qtMessageLogHandler() const;
virtual QAbstractItemModel *modulesModel() const;
virtual QAbstractItemModel *registerModel() const;
......@@ -229,7 +227,6 @@ public:
virtual QAbstractItemModel *toolTipsModel() const; // Deprecated, FIXME: use watchModel
virtual QAbstractItemModel *watchModel() const;
virtual QAbstractItemModel *sourceFilesModel() const;
virtual QAbstractItemModel *qtMessageLogModel() const;
void progressPing();
void handleFinished();
......@@ -273,6 +270,8 @@ public:
QString toFileInProject(const QUrl &fileUrl);
virtual bool evaluateScriptExpression(const QString &expression);
signals:
void stateChanged(Debugger::DebuggerState state);
// A new stack frame is on display including locals.
......@@ -354,7 +353,6 @@ protected:
virtual void executeRunToFunction(const QString &functionName);
virtual void executeJumpToLine(const Internal::ContextData &data);
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
virtual bool evaluateScriptExpression(const QString &expression);
virtual void frameUp();
virtual void frameDown();
......
......@@ -690,7 +690,6 @@ void DebuggerMainWindowPrivate::setSimpleDockWidgetArrangement()
QDockWidget *threadsDock = q->dockWidget(QLatin1String(DOCKWIDGET_THREADS));
QDockWidget *outputDock = q->dockWidget(QLatin1String(DOCKWIDGET_OUTPUT));
QDockWidget *qmlInspectorDock = q->dockWidget(QLatin1String(DOCKWIDGET_QML_INSPECTOR));
QDockWidget *consoleDock = q->dockWidget(QLatin1String(DOCKWIDGET_QML_SCRIPTCONSOLE));
QDockWidget *modulesDock = q->dockWidget(QLatin1String(DOCKWIDGET_MODULES));
QDockWidget *registerDock = q->dockWidget(QLatin1String(DOCKWIDGET_REGISTER));
QDockWidget *sourceFilesDock = q->dockWidget(QLatin1String(DOCKWIDGET_SOURCE_FILES));
......@@ -701,7 +700,6 @@ void DebuggerMainWindowPrivate::setSimpleDockWidgetArrangement()
QTC_ASSERT(snapshotsDock, return);
QTC_ASSERT(threadsDock, return);
QTC_ASSERT(outputDock, return);
QTC_ASSERT(consoleDock, return);
QTC_ASSERT(modulesDock, return);
QTC_ASSERT(registerDock, return);
QTC_ASSERT(sourceFilesDock, return);
......@@ -714,7 +712,7 @@ void DebuggerMainWindowPrivate::setSimpleDockWidgetArrangement()
// toolBar
// --------------------------------------------------------------------------------
// stack,qmlinspector | breakpoints,modules,register,threads,sourceFiles,snapshots,scriptconsole
// stack,qmlinspector | breakpoints,modules,register,threads,sourceFiles,snapshots
//
q->splitDockWidget(toolBarDock, stackDock, Qt::Vertical);
q->splitDockWidget(stackDock, breakDock, Qt::Horizontal);
......@@ -727,13 +725,10 @@ void DebuggerMainWindowPrivate::setSimpleDockWidgetArrangement()
q->tabifyDockWidget(breakDock, threadsDock);
q->tabifyDockWidget(breakDock, sourceFilesDock);
q->tabifyDockWidget(breakDock, snapshotsDock);
q->tabifyDockWidget(breakDock, consoleDock);
if (m_activeDebugLanguages.testFlag(Debugger::QmlLanguage)) {
if (qmlInspectorDock)
qmlInspectorDock->show();
if (consoleDock)
consoleDock->show();
} else {
// CPP only
threadsDock->show();
......
......@@ -46,7 +46,6 @@
#include "breakpoint.h"
#include "breakhandler.h"
#include "breakwindow.h"
#include "qtmessagelogwindow.h"
#include "disassemblerlines.h"
#include "logwindow.h"
#include "moduleswindow.h"
......@@ -126,6 +125,8 @@
# include <utils/winutils.h>
#endif
#include <qmljstools/qmlconsolemanager.h>
#include <QComboBox>
#include <QDockWidget>
#include <QFileDialog>
......@@ -1283,7 +1284,6 @@ public:
BaseWindow *m_breakWindow;
BreakHandler *m_breakHandler;
QtMessageLogWindow *m_qtMessageLogWindow;
WatchWindow *m_returnWindow;
WatchWindow *m_localsWindow;
WatchWindow *m_watchersWindow;
......@@ -1349,7 +1349,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_threadsWindow = 0;
m_logWindow = 0;
m_localsAndExpressionsWindow = 0;
m_qtMessageLogWindow = 0;
m_mainWindow = 0;
m_snapshotHandler = 0;
......@@ -2066,12 +2065,18 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
m_threadsWindow->setModel(engine->threadsModel());
m_watchersWindow->setModel(engine->watchersModel());
m_inspectorWindow->setModel(engine->inspectorModel());
m_qtMessageLogWindow->setModel(engine->qtMessageLogModel());
engine->watchHandler()->rebuildModel();
mainWindow()->setEngineDebugLanguages(engine->startParameters().languages);
mainWindow()->setCurrentEngine(engine);
QmlJSTools::QmlConsoleManager *consoleManager = QmlJSTools::QmlConsoleManager::instance();
if (consoleManager) {
if (engine->startParameters().languages & QmlLanguage)
consoleManager->setDebuggerEngine(engine);
else
consoleManager->setDebuggerEngine(0);
}
}
static void changeFontSize(QWidget *widget, qreal size)
......@@ -2194,7 +2199,6 @@ void DebuggerPluginPrivate::setInitialState()
action(AutoDerefPointers)->setEnabled(true);
action(ExpandStack)->setEnabled(false);
m_qtMessageLogWindow->setEnabled(true);
}
void DebuggerPluginPrivate::updateWatchersWindow(bool showWatch, bool showReturn)
......@@ -2559,10 +2563,6 @@ void DebuggerPluginPrivate::showMessage(const QString &msg, int channel, int tim
m_logWindow->showInput(LogError, QLatin1String("ERROR: ") + msg);
m_logWindow->showOutput(LogError, QLatin1String("ERROR: ") + msg);
break;
case QtMessageLogStatus:
QTC_ASSERT(m_qtMessageLogWindow, return);
m_qtMessageLogWindow->showStatus(msg, timeout);
break;
default:
m_logWindow->showOutput(channel, msg);
break;
......@@ -2739,8 +2739,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_breakWindow->setObjectName(QLatin1String(DOCKWIDGET_BREAK));
m_breakWindow->setModel(m_breakHandler->model());
m_qtMessageLogWindow = new QtMessageLogWindow();
m_qtMessageLogWindow->setObjectName(QLatin1String(DOCKWIDGET_QML_SCRIPTCONSOLE));
m_modulesWindow = new ModulesWindow;
m_modulesWindow->setObjectName(QLatin1String(DOCKWIDGET_MODULES));
m_logWindow = new LogWindow;
......@@ -2885,7 +2883,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
dock->setProperty(DOCKWIDGET_DEFAULT_AREA, Qt::TopDockWidgetArea);
m_mainWindow->createDockWidget(CppLanguage, m_breakWindow);
m_mainWindow->createDockWidget(QmlLanguage, m_qtMessageLogWindow);
m_mainWindow->createDockWidget(CppLanguage, m_snapshotWindow);
m_mainWindow->createDockWidget(CppLanguage, m_stackWindow);
m_mainWindow->createDockWidget(CppLanguage, m_threadsWindow);
......
......@@ -34,7 +34,6 @@
#include "debuggerstartparameters.h"
#include "stackhandler.h"
#include "qmlengine.h"
#include "qtmessageloghandler.h"
#include "watchdata.h"
#include <coreplugin/icore.h>
......@@ -794,11 +793,6 @@ void QmlCppEngine::resetLocation()
DebuggerEngine::resetLocation();
}
Internal::QtMessageLogHandler *QmlCppEngine::qtMessageLogHandler() const
{
return d->m_qmlEngine->qtMessageLogHandler();
}
DebuggerEngine *QmlCppEngine::cppEngine() const
{
return d->m_cppEngine;
......
......@@ -93,8 +93,6 @@ public:
int timeout = -1) const;
void resetLocation();
Internal::QtMessageLogHandler *qtMessageLogHandler() const;
void notifyInferiorIll();
protected:
......
......@@ -50,7 +50,6 @@
#include "watchhandler.h"
#include "sourcefileshandler.h"
#include "watchutils.h"
#include "qtmessageloghandler.h"
#include <extensionsystem/pluginmanager.h>
#include <qmldebug/baseenginedebugclient.h>
......@@ -68,6 +67,9 @@
#include <texteditor/itexteditor.h>
#include <qmljstools/qmlconsolemanager.h>
#include <qmljstools/qmlconsoleitem.h>
#include <QDateTime>
#include <QDebug>
#include <QDir>
......@@ -330,8 +332,6 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters)
m_noDebugOutputTimer.setInterval(8000);
connect(&m_noDebugOutputTimer, SIGNAL(timeout()), this, SLOT(tryToConnect()));
qtMessageLogHandler()->setHasEditableRow(true);
connect(ModelManagerInterface::instance(),
SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
this,
......@@ -1031,14 +1031,61 @@ void QmlEngine::synchronizeWatchers()
}
}
QmlJSTools::QmlConsoleItem *constructLogItemTree(QmlJSTools::QmlConsoleItem *parent,
const QVariant &result,
const QString &key = QString())
{
using namespace QmlJSTools;
bool sorted = debuggerCore()->boolSetting(SortStructMembers);
if (!result.isValid())
return 0;
QmlConsoleItem *item = new QmlConsoleItem(parent);
if (result.type() == QVariant::Map) {
if (key.isEmpty())
item->setText(_("Object"));
else
item->setText(key + _(" : Object"));
QMapIterator<QString, QVariant> i(result.toMap());
while (i.hasNext()) {
i.next();
QmlConsoleItem *child = constructLogItemTree(item, i.value(), i.key());
if (child)
item->insertChild(child, sorted);
}
} else if (result.type() == QVariant::List) {
if (key.isEmpty())
item->setText(_("List"));
else
item->setText(QString(_("[%1] : List")).arg(key));
QVariantList resultList = result.toList();
for (int i = 0; i < resultList.count(); i++) {
QmlConsoleItem *child = constructLogItemTree(item, resultList.at(i),
QString::number(i));
if (child)
item->insertChild(child, sorted);
}
} else if (result.canConvert(QVariant::String)) {
item->setText(result.toString());
} else {
item->setText(_("Unknown Value"));
}
return item;
}
void QmlEngine::expressionEvaluated(quint32 queryId, const QVariant &result)
{
if (queryIds.contains(queryId)) {
queryIds.removeOne(queryId);
QtMessageLogItem *item = constructLogItemTree(qtMessageLogHandler()->root(),
result);
if (item)
qtMessageLogHandler()->appendItem(item);
using namespace QmlJSTools;
QmlConsoleManager *consoleManager = QmlConsoleManager::instance();
if (consoleManager) {
QmlConsoleItem *item = constructLogItemTree(consoleManager->rootItem(), result);
if (item)
consoleManager->printToConsolePane(item);
}
}
}
......@@ -1092,35 +1139,40 @@ void QmlEngine::documentUpdated(QmlJS::Document::Ptr doc)
void QmlEngine::updateCurrentContext()
{
const QString context = state() == InferiorStopOk ?
stackHandler()->currentFrame().function :
m_inspectorAdapter.currentSelectedDisplayName();
showMessage(tr("Context: ").append(context), QtMessageLogStatus);
stackHandler()->currentFrame().function
: m_inspectorAdapter.currentSelectedDisplayName();
QmlJSTools::QmlConsoleManager *consoleManager = QmlJSTools::QmlConsoleManager::instance();
if (consoleManager)
consoleManager->setContext(tr("Context: ").append(context));
}
void QmlEngine::appendDebugOutput(QtMsgType type, const QString &message,
const QmlDebug::QDebugContextInfo &info)
{
QtMessageLogHandler::ItemType itemType;
using namespace QmlJSTools;
QmlConsoleItem::ItemType itemType;
switch (type) {
case QtDebugMsg:
itemType = QtMessageLogHandler::DebugType;
itemType = QmlConsoleItem::DebugType;
break;
case QtWarningMsg:
itemType = QtMessageLogHandler::WarningType;
itemType = QmlConsoleItem::WarningType;
break;
case QtCriticalMsg:
case QtFatalMsg:
itemType = QtMessageLogHandler::ErrorType;
itemType = QmlConsoleItem::ErrorType;
break;
default:
//This case is not possible
return;
}
QtMessageLogItem *item = new QtMessageLogItem(qtMessageLogHandler()->root(),
itemType, message);
item->file = info.file;
item->line = info.line;
qtMessageLogHandler()->appendItem(item);
QmlConsoleManager *consoleManager = QmlConsoleManager::instance();
if (consoleManager) {
QmlConsoleItem *item = new QmlConsoleItem(consoleManager->rootItem(), itemType, message);
item->file = info.file;
item->line = info.line;
consoleManager->printToConsolePane(item);
}
}
void QmlEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
......@@ -1133,37 +1185,25 @@ void QmlEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages
bool QmlEngine::evaluateScriptExpression(const QString &expression)
{
bool didEvaluate = true;
//Check if string is only white spaces
if (!expression.trimmed().isEmpty()) {
//check if it can be evaluated
if (canEvaluateScript(expression)) {
//Evaluate expression based on engine state
//When engine->state() == InferiorStopOk, the expression
//is sent to V8DebugService. In all other cases, the
//expression is evaluated by QDeclarativeEngine.
if (state() != InferiorStopOk) {
QmlInspectorAgent *agent = m_inspectorAdapter.agent();
quint32 queryId
= agent->queryExpressionResult(
m_inspectorAdapter.currentSelectedDebugId(),
expression);
if (queryId) {
queryIds << queryId;
} else {
didEvaluate = false;
qtMessageLogHandler()->
appendItem(
new QtMessageLogItem(
qtMessageLogHandler()->root(),
QtMessageLogHandler::ErrorType,
_("Error evaluating expression.")));
}
} else {
executeDebuggerCommand(expression, QmlLanguage);
}
// Evaluate expression based on engine state
// When engine->state() == InferiorStopOk, the expression is sent to debuggerClient.
if (state() != InferiorStopOk) {
QmlInspectorAgent *agent = m_inspectorAdapter.agent();
quint32 queryId = agent->queryExpressionResult(m_inspectorAdapter.currentSelectedDebugId(),
expression);
if (queryId) {
queryIds << queryId;
} else {
didEvaluate = false;
using namespace QmlJSTools;
QmlConsoleManager *consoleManager = QmlConsoleManager::instance();
if (consoleManager) {
consoleManager->printToConsolePane(QmlConsoleItem::ErrorType,
_("Error evaluating expression."));
}
}
} else {
executeDebuggerCommand(expression, QmlLanguage);
}
return didEvaluate;
}
......@@ -1270,48 +1310,6 @@ bool QmlEngine::canEvaluateScript(const QString &script)
return m_interpreter.canEvaluate();
}
QtMessageLogItem *QmlEngine::constructLogItemTree(
QtMessageLogItem *parent, const QVariant &result, const QString &key)
{
if (!result.isValid())
return 0;
QtMessageLogItem *item = new QtMessageLogItem(parent);
if (result.type() == QVariant::Map) {
if (key.isEmpty())
item->setText(_("Object"));
else
item->setText(key + _(" : Object"));
QMapIterator<QString, QVariant> i(result.toMap());
while (i.hasNext()) {
i.next();
QtMessageLogItem *child = constructLogItemTree(item,
i.value(), i.key());
if (child)
item->insertChild(child);
}
} else if (result.type() == QVariant::List) {
if (key.isEmpty())
item->setText(_("List"));
else
item->setText(QString(_("[%1] : List")).arg(key));
QVariantList resultList = result.toList();
for (int i = 0; i < resultList.count(); i++) {
QtMessageLogItem *child = constructLogItemTree(item, resultList.at(i),
QString::number(i));
if (child)
item->insertChild(child);
}
} else if (result.canConvert(QVariant::String)) {
item->setText(result.toString());
} else {
item->setText(_("Unknown Value"));
}
return item;
}
bool QmlEngine::adjustBreakpointLineAndColumn(
const QString &filePath, quint32 *line, quint32 *column, bool *valid)
{
......
......@@ -53,7 +53,6 @@ namespace Debugger {
namespace Internal {
class QmlAdapter;
class QtMessageLogItem;
class QmlEngine : public DebuggerEngine
{
......@@ -181,9 +180,6 @@ private:
void updateEditor(Core::IEditor *editor, const QTextDocument *document);
bool canEvaluateScript(const QString &script);
QtMessageLogItem *constructLogItemTree(QtMessageLogItem *parent,
const QVariant &result,
const QString &key = QString());
bool adjustBreakpointLineAndColumn(const QString &filePath, quint32 *line,
quint32 *column, bool *valid);
......
......@@ -514,7 +514,7 @@ void QScriptDebuggerClient::messageReceived(const QByteArray &data)
if (iname.startsWith("watch.")) {
watchHandler->insertIncompleteData(data);
} else if (iname == "console") {
d->engine->showMessage(data.value, QtMessageLogOutput);
d->engine->showMessage