I declare my object in C++
class Action : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name) public: Action(): QObject(0) {} QString name() con
It is possible using QJSValue. For example:
//C++ Q_INVOKABLE void getData(QJSValue value) { if (value.isCallable()) { QJSValueList args; args << QJSValue("Hello, world!"); value.call(args); } } //QML action.getData(function (data){console.log(data)});