From 0d8a2831779ccb15984e2fe80be04e9856668434 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 30 Sep 2016 10:37:28 +0200 Subject: 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 --- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp') diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index d65cec843c..1d335f1f6a 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -333,6 +333,7 @@ private slots: void qtbug_52340(); void qtbug_54589(); void qtbug_54687(); + void stringify_qtbug_50592(); private: // static void propertyVarWeakRefCallback(v8::Persistent object, void* parameter); @@ -8045,6 +8046,15 @@ void tst_qqmlecmascript::qtbug_54687() engine.evaluate("12\n----12"); } +void tst_qqmlecmascript::stringify_qtbug_50592() +{ + QQmlComponent component(&engine, testFileUrl("stringify_qtbug_50592.qml")); + + QScopedPointer obj(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->property("source").toString(), QString::fromLatin1("http://example.org/some_nonexistant_image.png")); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" -- cgit v1.2.3