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

QJSEngine/QQmlEngine: Support calling C++ static member functions, namespaced functions, and/or standalone functions

XMLWordPrintable

      QScriptable allows us to expose C++ classes with static and non-static methods to JavaScript.

      var obj = new Class();
      obj.nonStaticMethod();
      Class.staticMethod();
      

      However, with QQmlEngine, we can only call C++ instance member functions from JavaScript.

      Current related deficiencies:

      • Q_INVOKABLE does not work with static member functions
      • Q_INVOKABLE does not work with Q_NAMESPACE
      • There is no equivalent of QScriptEngine::newFunction (QTBUG-45246 )
      • QQmlEngine does not let us instantiate C++ objects using JavaScript `new` (QTBUG-103461)

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

            qtqmlteam Qt Qml Team User
            skoh-qt Sze Howe Koh
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes