diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2010-04-29 14:25:20 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:52 (GMT) |
commit | 0782c5d1ad6d57204a4ed9b17f0ce08734c6e3a9 (patch) | |
tree | bdccf713b157c7c0a6c8e49806a7df12533f061c /src | |
parent | 1e8a1b289a1333b9e6887c4242e576be695e5857 (diff) | |
download | Qt-0782c5d1ad6d57204a4ed9b17f0ce08734c6e3a9.zip Qt-0782c5d1ad6d57204a4ed9b17f0ce08734c6e3a9.tar.gz Qt-0782c5d1ad6d57204a4ed9b17f0ce08734c6e3a9.tar.bz2 |
Fix conversion between QVariant and QScriptValue.
Function converting from QVariant to QScriptValue is smart and tries
to unwrap a value. So QVariant(1234) after conversion will be equal
to QScriptValue(1234). It is ok, but QVariant(QVariant(...)) should be
unpacked only once.
Reviewed-by: Kent Hansen
Task-number: QTBUG-10315
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 160058e..25137eb 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -3071,7 +3071,7 @@ JSC::JSValue QScriptEnginePrivate::create(JSC::ExecState *exec, int type, const break; #endif case QMetaType::QVariant: - result = jscValueFromVariant(exec, *reinterpret_cast<const QVariant*>(ptr)); + result = eng->newVariant(*reinterpret_cast<const QVariant*>(ptr)); break; default: if (type == qMetaTypeId<QScriptValue>()) { |