Hi, I'd like to expose an API within a QJSEngine JavaScript environment for an asynchronous callback.
Thus I want to expose a method "regCallback": foo.regCallback(function() { alert("Hello"); }) and allow C++ to call that function at some later point. The function is exposed as a QJSValue, thus I'd expect a class Foo to look something like this: class Foo: public QObject { public: Q_INVOKABLE void regCallback(QJSValue someFunction) { m_f = someFunction; } void doCallback() { m_f.call(); } private: QJSValue m_f; }; However this doesn't work; regCallback never gets called. Is there some other way to achieve this API? Gav. _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest