Comment 4 for bug 730180

Revision history for this message
Sibi Antony (sibi-antony) wrote :

Patch for script pause functionality.

Some of the options considered were :

1. Use a QScriptEngineDebugger and issue intercept
2. Use QScriptEngineAgent and wait and processEvents() until resumed.
3. A hybrid signal-slot, with a signal emitted during pause , which is caught by a JS slot.
 The JS slot will wait until a resume signal is received.

The first method is a bit of overkill, and will need tweaks for linker/include options.
The agent based method requires explicit calling of processEvents() (The QScriptEngineDebugger does the same thing - uses QScriptEngineAgent, but is transparent )
The JS slot to wait - I don't think the slots are really meant to block, generally they're only seen used with getters/setters.

The patch uses the second approach. It ensures pause-on-next-statement, but please keep in mind that there are situations wherein the pause is not obvious. For eg: if the previous statement had continuous operations like fading, zooming to an object etc. it will continue for the configured duration.