aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 98dc106ebe..52b2afe727 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -388,6 +388,7 @@ private slots:
void urlPropertySet();
void urlSearchParamsConstruction();
void urlSearchParamsMethods();
+ void variantConversionMethod();
void gcCrashRegressionTest();
@@ -9533,6 +9534,19 @@ void tst_qqmlecmascript::urlSearchParamsMethods()
QVERIFY(EVALUATE_VALUE("this.usp.toString()", QV4::ScopedValue(scope, scope.engine->newString("a=10&c=foo"))));
}
+void tst_qqmlecmascript::variantConversionMethod()
+{
+ QQmlEngine qmlengine;
+
+ VariantConvertObject obj;
+ qmlengine.rootContext()->setContextProperty("variantObject", &obj);
+
+ QQmlComponent component(&qmlengine, testFileUrl("variantConvert.qml"));
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(o != nullptr);
+ QCOMPARE(obj.funcCalled, QLatin1String("QModelIndex"));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"