summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2016-09-30 10:37:28 +0200
committerRobin Burchell <robin.burchell@viroteck.net>2016-09-30 09:24:05 +0000
commit0d8a2831779ccb15984e2fe80be04e9856668434 (patch)
tree579c6d3fd062a65bafa7471c1927ab9c10e2808f /src
parentc9ffed92a0dee0ae00a9632177ea42f85ea8a48c (diff)
qv4jsonobject: Make use of QVariant::toString in stringification
This covers a whole host of missing cases, notably QUrl stored in a QV4::Value. Task-number: QTBUG-50592 Change-Id: I8afd772046c7bfbbcf916a7e90a57be5257b9df8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index 2e5283c639..fa3eeba745 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -38,6 +38,7 @@
#include <qv4objectiterator_p.h>
#include <qv4scopedvalue_p.h>
#include <qv4runtime_p.h>
+#include <qv4variantobject_p.h>
#include "qv4string_p.h"
#include <qstack.h>
@@ -726,6 +727,10 @@ QString Stringify::Str(const QString &key, const Value &v)
return std::isfinite(d) ? value->toQString() : QStringLiteral("null");
}
+ if (const QV4::VariantObject *v = value->as<QV4::VariantObject>()) {
+ return v->d()->data.toString();
+ }
+
o = value->asReturnedValue();
if (o) {
if (!o->as<FunctionObject>()) {