Reverted change that broke AnimationObjec scripting interface

This commit is contained in:
ksuprynowicz 2023-03-04 00:41:31 +01:00
parent 3be4fdc33d
commit 4e91765a3f

View file

@ -755,9 +755,8 @@ V8ScriptValue ScriptEngineV8::castVariantToValue(const QVariant& val) {
} }
default: default:
// check to see if this is a pointer to a QObject-derived object // check to see if this is a pointer to a QObject-derived object
// V8TODO: I added WeakPointerToQObject and SharedPointerToQObject here, but maybe they need different object ownership? // V8TODO: WeakPointerToQObject and SharedPointerToQObject were causing trouble here because some values are handled by custom prototypes instead
if (QMetaType::typeFlags(valTypeId) & (QMetaType::PointerToQObject | QMetaType::TrackingPointerToQObject if (QMetaType::typeFlags(valTypeId) & (QMetaType::PointerToQObject | QMetaType::TrackingPointerToQObject)) {
| QMetaType::WeakPointerToQObject | QMetaType::SharedPointerToQObject)) {
QObject* obj = val.value<QObject*>(); QObject* obj = val.value<QObject*>();
if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate)); if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate));
return ScriptObjectV8Proxy::newQObject(this, obj); return ScriptObjectV8Proxy::newQObject(this, obj);