0

I am using the QScriptEngine and QScriptEngineDebugger and I was reading the documentation of the QScriptEngine and I saw the following:

void QScriptEngineDebugger::attachTo ( QScriptEngine * engine ) Attaches to the given engine. The debugger will install a custom agent (using QScriptEngine::setAgent()) to monitor the engine. While the debugger is attached, you should not change the agent; however, if you do have to perform additional monitoring, you must set a proxy agent that forwards all events to the debugger’s agent.”

So what I would like to do is actually monitor the execution of my Script using the Debugger but I would like more information.

Is there any example available for this topic? I couldn’t find any example of the so call “proxy agent” and I don’t know how to start/set it.

Thanks in advance any kind of help is welcome :O

Qnoobish
  • 148
  • 11
  • There's also an option to automatically start the debugger if your script throws an error. – Jay Jun 11 '13 at 13:59

1 Answers1

0

Use debugger.standardWindow()->show() to show the debugger's GUI:

QScriptEngine engine;
QScriptEngineDebugger debugger;
debugger.attachTo(&engine);
debugger.standardWindow()->show();
engine.evaluate(QScriptProgram("a = 0; \nb = 0; \nc = a + d;"));
Pavel Strakhov
  • 39,123
  • 5
  • 88
  • 127
  • Hello thanks for your response. I can succesfully attach a Debugger to my ScriptEngine, the thing is when I try to debug a script and get to a function defined inside an imported extension I only get the line number and not the script text being evaluated. So that's why I am focusing on the Custom QScriptAgent set by the QScriptDebugger to get the script text that is omitted. – Qnoobish Jun 18 '13 at 18:02