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) ?
Asked
Active
Viewed 240 times
2
-
[This is no trivial task](https://forum.qt.io/topic/80403/qtscript-deprecated-vs-qjsengine-and-reasons-why-qjsengine-isn-t-up-to-scratch/4). You might want to try to get support from Qt directly. Maybe they would be so kind to supply a porting guide, if there isn't already. – nada Jul 04 '19 at 08:43