getJSValue() has been fixed

This commit is contained in:
Arin Alex 2019-01-27 00:09:43 +03:00
parent 0d0ba64bac
commit dd5c1f6ca0
2 changed files with 4 additions and 2 deletions

View File

@ -156,7 +156,8 @@ namespace Const{
template <typename T>
static inline QJSValue getJSValue(QJSEngine &e, T *p)
{
QJSValue res = e.toScriptValue(p);
QJSValue res = e.newQObject(p);
QQmlEngine::setObjectOwnership(p, QQmlEngine::CppOwnership);
return res;
}
#else

View File

@ -156,7 +156,8 @@ namespace Const{
template <typename T>
static inline QJSValue getJSValue(QJSEngine &e, T *p)
{
QJSValue res = e.toScriptValue(p);
QJSValue res = e.newQObject(p);
QQmlEngine::setObjectOwnership(p, QQmlEngine::CppOwnership);
return res;
}
#else