Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
5.0.2
-
None
-
13afb2b49daec9f5f65dc9a99151c91d685dce13
Description
Exceptions in javascript bindings result in QQmlError objects sent via the QQmlEngine::warnings signal. They only include the line number where the error occurred and the text of the exception. They do not include the QObject where the error occurred. For example:
file:///automount/sun-01/home/mvisser/workspace/pug/imports/Pug/ShotgunDataFromElement.qml:9: TypeError: Cannot read property '-1' of undefined
I'd like to know which QObject triggered this exception.
I think this is a straightforward change:
1. add a QObject *object property to QQmlError (object/setObject) that defaults to 0
2. in QQmlJavaScriptException::exceptionToError call error.setObject(scopeObject())