Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
Description
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)
Attachments
Issue Links
- relates to
-
QTBUG-45246 add QJSEngine::newFunction
- Open
-
QTBUG-103461 QJSEngine/QQmlEngine: Support instantiating C++ classes in JavaScript using `new`
- Reported