On Fri, Jun 24, 2022, at 12:50, Ulf Hermann wrote:
>> Right, normally when evaluating a script, any error can be caught and 
>> reported however you wish, but this does not work when the script execution 
>> is trigger through a signal connection. In this case, when using QJSEngine, 
>> errors are always printed to the standard out, whereas the QQmlEngine allows 
>> reporting these through its "warnings" signal.
> Well, I would like to see a bug report with a minimal reproducer for 
> this. How do you produce a signal connection in pure JS?

You just expose a QObject-derived class instance to JS which has a signal, and 
then in JS you can do:

    someObject.someSignal.connect(() => {});


But if you trigger a runtime error, like:

    someObject.someSignal.connect(() => {

And then emit "someSignal" from C++, then the connected JS function gets 
executed, but without any way of catching and reporting the resulting error, 
unless you use QQmlEngine and connect to the "warnings" signal.

Interest mailing list

Reply via email to