Hi Ken

On Tuesday 25 November 2008 16:30:40 Kent Hansen wrote:
> Hi Gerhard,
>
> Gerhard Gappmeier wrote:
> > Hi
> >
> > at the moment I was implementing my own debugger based on QScriptAgent.
> > But because the next release will contain a full featured debugger I want
> > to give it a try, because this looks very promising.
> >
> > I tried to integrate the qt script debugger into my own application and
> > encountered some problems.
> > I want to embed the widget into my own qmainwindow and don't want to
> > use an extra debug window.
> >
> > 1.) The code widget cannot be displayed until starting to evaluate a
> > script. This makes it difficult to make an IDE like environment.
> > A user wants to edit the code and then starts debugging.
> > => The edit widget must be visible before debugging
> > => it must be possible to set the script directly into the editor
> > => otherwise I would need to implement a second editor, one for editing
> > and and for debugging.
>
> Unfortunately there won't be any IDE integration API for the debugger in
> 4.5, so you'll have to "cheat" in a way like you suggest.
> If you have suggestions or further requirements for such an API we'd
> love to hear it.

No problem:

1.) I would suggest to extend the QScriptEngineDebugger API like this:

/** This methods executes QScriptEngine::evaluate() but stops execution on the 
first line. This method will trigger the evaluationsSuspended signal. Use 
action() to resume evaluation or debug using the debugging toolbar. */
QScriptValue QScriptEngineDebugger::debug(const QString &program, const 
QString &fileName = QString(), int lineNumber = 1);

I think this would be a trivial  change.

2.) Make the TextEdit/ScriptEdit Widget API public so, that we can set the 
script code already before starting debugging.

I don't know how much effort this would be, but the textedit api from 
labs.trolltech.com I was already able to use. This was the base of the
new script tools I guess :-)

>
> > 2.) How can I start debugging at the first line?
> > If I execute QScriptEngine::evaluate() the scripts runs without stopping
> > until there happens an exception.
> > Wenn I press the pause button, then start evaluating it stops at first
> > line. How can I do that programmatically?
> > I tried to call action() with QScriptEngineDebugger::InterruptAction
> > parameter and than execute evaluate(), but this doesn't work.
> >
> > There must be a possibility to say the debugger to stop at the first line
> > and then call evaluate() to start the script engine.
> >
> >
> > I attached a simple example code to demonstrate my usage.
>
> Thanks for providing the code. I was able to reproduce the problem. It
> should be fixed in the next snapshots.
> Thanks again for the feedback.
np
>
> Regards,
> Kent
> _______________________________________________
> Qt4-preview-feedback mailing list
> [email protected]
> http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

-- 
mit freundlichen Grüßen / best regards

Gerhard Gappmeier
ascolab GmbH - automation systems communication laboratory
Tel.: +49 9131 691 123
Fax:  +49 9131 691 128
Web: http://www.ascolab.com
GPG-Key: http://www.ascolab.com/gpg/gg.asc



_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to