Showing the changes to libraries/script-engine/src/qtscript/ScriptObjectQtProxy.cpp (1 of 5 files). Show all
Unified · Split
| @@ -61,7 +61,7 @@ QScriptValue ScriptObjectQtProxy::newQObject(ScriptEngineQtScript* engine, QObje · 60 unmodified lines | |||
| 61 | ScriptEngineQtScript::ObjectWrapperMap::const_iterator lookup = engine->_qobjectWrapperMap.find(object); | 61 | ScriptEngineQtScript::ObjectWrapperMap::const_iterator lookup = engine->_qobjectWrapperMap.find(object); |
| 62 | if (lookup != engine->_qobjectWrapperMap.end()) { | 62 | if (lookup != engine->_qobjectWrapperMap.end()) { |
| 63 | QSharedPointer<ScriptObjectQtProxy> proxy = lookup.value().lock(); | 63 | QSharedPointer<ScriptObjectQtProxy> proxy = lookup.value().lock(); |
| 64 | if (proxy) return static_cast<QScriptEngine*>(engine)->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy)));; | 64 | if (proxy) return qengine->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy)));; |
| 65 | } | 65 | } |
| 66 | } | 66 | } |
| 67 | 67 | ||
| @@ -88,7 +88,7 @@ QScriptValue ScriptObjectQtProxy::newQObject(ScriptEngineQtScript* engine, QObje · 20 unmodified lines | |||
| 88 | ScriptEngineQtScript::ObjectWrapperMap::const_iterator lookup = engine->_qobjectWrapperMap.find(object); | 88 | ScriptEngineQtScript::ObjectWrapperMap::const_iterator lookup = engine->_qobjectWrapperMap.find(object); |
| 89 | if (lookup != engine->_qobjectWrapperMap.end()) { | 89 | if (lookup != engine->_qobjectWrapperMap.end()) { |
| 90 | QSharedPointer<ScriptObjectQtProxy> proxy = lookup.value().lock(); | 90 | QSharedPointer<ScriptObjectQtProxy> proxy = lookup.value().lock(); |
| 91 | if (proxy) return static_cast<QScriptEngine*>(engine)->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy)));; | 91 | if (proxy) return qengine->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy)));; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | // register the wrapper with the engine and make sure it cleans itself up | 94 | // register the wrapper with the engine and make sure it cleans itself up |
| @@ -104,7 +104,7 @@ QScriptValue ScriptObjectQtProxy::newQObject(ScriptEngineQtScript* engine, QObje · 9 unmodified lines | |||
| 104 | }); | 104 | }); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | return static_cast<QScriptEngine*>(engine)->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy))); | 107 | return qengine->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy))); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | ScriptObjectQtProxy* ScriptObjectQtProxy::unwrapProxy(const QScriptValue& val) { | 110 | ScriptObjectQtProxy* ScriptObjectQtProxy::unwrapProxy(const QScriptValue& val) { |
| @@ -385,7 +385,7 @@ QScriptValue ScriptVariantQtProxy::newVariant(ScriptEngineQtScript* engine, cons · 274 unmodified lines | |||
| 385 | return qengine->newVariant(variant); | 385 | return qengine->newVariant(variant); |
| 386 | } | 386 | } |
| 387 | auto proxy = QSharedPointer<ScriptVariantQtProxy>::create(engine, variant, proto, protoProxy); | 387 | auto proxy = QSharedPointer<ScriptVariantQtProxy>::create(engine, variant, proto, protoProxy); |
| 388 | return static_cast<QScriptEngine*>(engine)->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy))); | 388 | return qengine->newObject(proxy.get(), qengine->newVariant(QVariant::fromValue(proxy))); |
| 389 | } | 389 | } |
| 390 | 390 | ||
| 391 | ScriptVariantQtProxy* ScriptVariantQtProxy::unwrapProxy(const QScriptValue& val) { | 391 | ScriptVariantQtProxy* ScriptVariantQtProxy::unwrapProxy(const QScriptValue& val) { |