diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index ffd18f09a7..b322f870fa 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -288,6 +288,7 @@ private slots: void voidFunction(); void writeBack(); void writeVariantMap(); + void writeAndReturnTempArray(); }; static QByteArray arg1() @@ -5838,6 +5839,20 @@ void tst_QmlCppCodegen::writeVariantMap() } +void tst_QmlCppCodegen::writeAndReturnTempArray() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/Categorizer.qml"_s)); + + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + + const QVariant nnn = object->property("nnn"); + QCOMPARE(nnn.metaType(), QMetaType::fromType<QList<double>>()); + QCOMPARE(nnn.value<QList<double>>(), QList<double>{10}); +} + QTEST_MAIN(tst_QmlCppCodegen) #include "tst_qmlcppcodegen.moc" |
