aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index f95db6136d..478f236ee2 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -363,6 +363,8 @@ private slots:
void propertyObserverOnReadonly();
+ void variantListConversion();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -6353,6 +6355,23 @@ void tst_qqmllanguage::propertyObserverOnReadonly()
QCOMPARE(o->property("height").toDouble(), 54.2);
}
+void tst_qqmllanguage::variantListConversion()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("variantListConversion.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+
+ Foo *foo = qobject_cast<Foo *>(o.data());
+ QVERIFY(foo);
+ const QVariantList list = foo->getList();
+ QCOMPARE(list.length(), 2);
+ const Large l0 = qvariant_cast<Large>(list.at(0));
+ QCOMPARE(l0.a, 12ull);
+ const Large l1 = qvariant_cast<Large>(list.at(1));
+ QCOMPARE(l1.a, 13ull);
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"