With deprecation of QScriptEngine, how do we port the QScriptClass-related code?

295 Views Asked by At

QScriptEngine is deprecated and porting related code involves using either QJSEngine or the derived class QQmlEngine. These classes work with QObject-derived classes only. In the QScriptEngine world, non QObject-derived classes could be made available as instantiable JavaScript objects using a wrapper class derived from QScriptClass. But QScriptClass takes a QScriptEngine at construction time, so there is incompatibility between the QScriptEngine world and the QJSEngine world. How can I code a wrapper around a non-QObject-derived class (or struct, for example) ?

0

There are 0 best solutions below