summaryrefslogtreecommitdiffstats
path: root/src/script/qscriptvalueimpl.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-05 14:48:52 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-05 14:56:53 (GMT)
commit9691523b796c6acc6a837a5f5a34fef16aa74c48 (patch)
tree355174d4b7fa66aeac721caa01d98ca3616768cf /src/script/qscriptvalueimpl.cpp
parentff9497f82d605688453e2f027bab7c719048f0d2 (diff)
downloadQt-9691523b796c6acc6a837a5f5a34fef16aa74c48.zip
Qt-9691523b796c6acc6a837a5f5a34fef16aa74c48.tar.gz
Qt-9691523b796c6acc6a837a5f5a34fef16aa74c48.tar.bz2
have QScriptValue::toVariant() convert Array objects to QVariantLists
Converting the array to its string representation is not very useful. Now round-trip conversion will work as well. Reviewed-by: Ariya Hidayat
Diffstat (limited to 'src/script/qscriptvalueimpl.cpp')
-rw-r--r--src/script/qscriptvalueimpl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/qscriptvalueimpl.cpp b/src/script/qscriptvalueimpl.cpp
index a890839..7c7b711 100644
--- a/src/script/qscriptvalueimpl.cpp
+++ b/src/script/qscriptvalueimpl.cpp
@@ -339,6 +339,8 @@ QVariant QScriptValueImpl::toVariant() const
if (isQObject())
return qVariantFromValue(toQObject());
#endif
+ if (isArray())
+ return QScriptEnginePrivate::variantListFromArray(*this);
QScriptValueImpl v = engine()->toPrimitive(*this);
if (!v.isObject())