diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-10 13:40:34 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-10 13:40:34 (GMT) |
commit | 2c4bbeecd084bf4565643d4cd42de3be1aed5681 (patch) | |
tree | dc40f7bba6c74248c9a0359b05b39bce0e6decb2 /src/script/api/qscriptvalue.cpp | |
parent | d1c5585faa066a6693c24600cf8a1c42a285fe3b (diff) | |
parent | 7b15c669c336a1d76e3ac001fadde38a294e3e80 (diff) | |
download | Qt-2c4bbeecd084bf4565643d4cd42de3be1aed5681.zip Qt-2c4bbeecd084bf4565643d4cd42de3be1aed5681.tar.gz Qt-2c4bbeecd084bf4565643d4cd42de3be1aed5681.tar.bz2 |
Merge remote branch 'mainline/4.6' into 4.6
Conflicts:
tools/configure/configureapp.cpp
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 52a1e6d..d6cbb41 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -71,6 +71,7 @@ #include "bridge/qscriptclassobject_p.h" #include "bridge/qscriptvariant_p.h" #include "bridge/qscriptqobject_p.h" +#include "bridge/qscriptdeclarativeclass_p.h" /*! \since 4.3 @@ -1496,6 +1497,8 @@ QVariant QScriptValue::toVariant() const #endif else if (isArray()) return QScriptEnginePrivate::variantListFromArray(*this); + else if (QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(*this)) + return dc->toVariant(QScriptDeclarativeClass::object(*this)); // try to convert to primitive JSC::ExecState *exec = d->engine->currentFrame; JSC::JSValue savedException; @@ -1586,6 +1589,8 @@ QObject *QScriptValue::toQObject() const if (isQObject()) { QScriptObject *object = static_cast<QScriptObject*>(JSC::asObject(d->jscValue)); return static_cast<QScript::QObjectDelegate*>(object->delegate())->value(); + } else if (QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(*this)) { + return dc->toQObject(QScriptDeclarativeClass::object(*this)); } else if (isVariant()) { QVariant var = toVariant(); int type = var.userType(); |