I dont know why, but nothing is printed to my QtScript Debugger console, does anybody know why?
QScriptValue Debug_Function(QScriptContext *ctx, QScriptEngine *)
{
for (int i = 0; i < ctx->argumentCount(); ++i)
{
if (i != 0)
QString s
= ctx
->argument
(i
).
toString();
if (ctx->state() == QScriptContext::ExceptionState)
break;
result.append(s);
}
return ctx->engine()->toScriptValue(result);
}
QScriptValue Debug_Function(QScriptContext *ctx, QScriptEngine *)
{
QString result;
for (int i = 0; i < ctx->argumentCount(); ++i)
{
if (i != 0)
result.append(QLatin1String(" "));
QString s = ctx->argument(i).toString();
if (ctx->state() == QScriptContext::ExceptionState)
break;
result.append(s);
}
return ctx->engine()->toScriptValue(result);
}
To copy to clipboard, switch view to plain text mode
QScriptValue dfunc = engine.newFunction(Debug_Function);
engine.globalObject().setProperty("debug", dfunc);
QScriptValue dfunc = engine.newFunction(Debug_Function);
engine.globalObject().setProperty("debug", dfunc);
To copy to clipboard, switch view to plain text mode
Bookmarks