Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30930

Add QObject pointer to QQmlError for containing scope of errors

    XMLWordPrintable

Details

    • 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())

      Attachments

        For Gerrit Dashboard: QTBUG-30930
        # Subject Branch Project Status CR V

        Activity

          People

            mjmvisser Mark Visser
            mjmvisser Mark Visser
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes