Showing the changes to libraries/script-engine/src/ModelScriptingInterface.cpp (1 of 8 files). Show all
Unified · Split
| @@ -9,6 +9,8 @@ · 8 unmodified lines | |||
| 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| 10 | // | 10 | // |
| 11 | 11 | ||
| 12 | #include <QScriptEngine> | ||
| 13 | #include <QtScript/QScriptValue> | ||
| 12 | #include "ModelScriptingInterface.h" | 14 | #include "ModelScriptingInterface.h" |
| 13 | 15 | ||
| 14 | ModelScriptingInterface::ModelScriptingInterface(QObject* parent) : QObject(parent) { | 16 | ModelScriptingInterface::ModelScriptingInterface(QObject* parent) : QObject(parent) { |
| @@ -23,9 +25,10 @@ MeshProxy::~MeshProxy() { · 8 unmodified lines | |||
| 23 | 25 | ||
| 24 | 26 | ||
| 25 | QScriptValue meshToScriptValue(QScriptEngine* engine, MeshProxy* const &in) { | 27 | QScriptValue meshToScriptValue(QScriptEngine* engine, MeshProxy* const &in) { |
| 26 | QScriptValue obj("something"); | 28 | return engine->newQObject(in, QScriptEngine::QtOwnership, |
| 27 | return obj; | 29 | QScriptEngine::ExcludeDeleteLater | QScriptEngine::ExcludeChildObjects); |
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | void meshFromScriptValue(const QScriptValue& value, MeshProxy* &out) { | 32 | void meshFromScriptValue(const QScriptValue& value, MeshProxy* &out) { |
| 33 | out = qobject_cast<MeshProxy*>(value.toQObject()); | ||
| 31 | } | 34 | } |