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

QtScript/V8: Port relevant parts of QML/QObject binding to QtScript/QObject binding

    Details

    • Type: Task
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Qt Script
    • Labels:
      None
    • Technical Risk:
      Normal

      Description

      The QObject bindings in src/declarative/qml/qdeclarativeobjectscriptclass.cpp are doing a lot of the same stuff as the QObject bindings in QtScript. But QtScript does extra stuff that QML doesn't need (dynamic properties, child objects).

      QtScript's bindings should support the behavior that QML needs.

      Effectively, this means being able to replace calls like
      enginePriv->objectClass->newQObject(o)
      with
      qtScriptEngine->newQObject(o)

      With V8, we can implement a binding for the "static" parts of the QObject (meta-object properties, methods) using accessors only. It's important to try to avoid interceptors, since then we have to manage the caching on our side (and v8::String is not as good for associate mapping as JSC::Identifier).

      The only dynamic part of the qdeclarativeobjectscriptclass binding is the "evalContext" part. But it seems this is only used as a fallback in case the normal QObject property lookup fails.

      What would be good to have is a way to have interceptors as fallback on the same object; right now, the behavior in V8 is that the interceptor will always take precedence over per-property accessors.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                kenthans Kent Hansen (Inactive)
                Reporter:
                kenthans Kent Hansen (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes