Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8_cast.cpp (1 of 9 files). Show all
Unified · Split
| @@ -750,6 +750,7 @@ V8ScriptValue ScriptEngineV8::castVariantToValue(const QVariant& val) { · 749 unmodified lines | |||
| 750 | case QMetaType::QObjectStar: { | 750 | case QMetaType::QObjectStar: { |
| 751 | QObject* obj = val.value<QObject*>(); | 751 | QObject* obj = val.value<QObject*>(); |
| 752 | if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate)); | 752 | if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate)); |
| 753 | //V8TODO: what should be the ownership in this case? | ||
| 753 | return ScriptObjectV8Proxy::newQObject(this, obj); | 754 | return ScriptObjectV8Proxy::newQObject(this, obj); |
| 754 | } | 755 | } |
| 755 | case QMetaType::QDateTime: | 756 | case QMetaType::QDateTime: |
| @@ -768,9 +769,10 @@ V8ScriptValue ScriptEngineV8::castVariantToValue(const QVariant& val) { · 12 unmodified lines | |||
| 768 | if (QMetaType::typeFlags(valTypeId) & (QMetaType::PointerToQObject | QMetaType::TrackingPointerToQObject)) { | 769 | if (QMetaType::typeFlags(valTypeId) & (QMetaType::PointerToQObject | QMetaType::TrackingPointerToQObject)) { |
| 769 | QObject* obj = val.value<QObject*>(); | 770 | QObject* obj = val.value<QObject*>(); |
| 770 | if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate)); | 771 | if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate)); |
| 772 | //V8TODO: what should be the ownership in this case? | ||
| 771 | return ScriptObjectV8Proxy::newQObject(this, obj); | 773 | return ScriptObjectV8Proxy::newQObject(this, obj); |
| 772 | } | 774 | } |
| 773 | // have we set a prototype'd variant? | 775 | // have we set a prototyped variant? |
| 774 | { | 776 | { |
| 775 | _customTypeProtect.lockForRead(); | 777 | _customTypeProtect.lockForRead(); |
| 776 | CustomPrototypeMap::const_iterator lookup = _customPrototypes.find(valTypeId); | 778 | CustomPrototypeMap::const_iterator lookup = _customPrototypes.find(valTypeId); |