diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 406bcb1da8..579f279e93 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -12,6 +12,7 @@ #include <data/objectwithmethod.h> #include <data/qmlusing.h> #include <data/resettable.h> +#include <data/sequenceToIterable.h> #include <data/takenumber.h> #include <data/weathermoduleurl.h> #include <data/withlength.h> @@ -5086,6 +5087,19 @@ void tst_QmlCppCodegen::sequenceToIterable() QVERIFY(match.hasMatch()); QCOMPARE(match.captured(1), QString::number(i)); } + + QQmlComponent component2(&engine, QUrl(u"qrc:/qt/qml/TestTypes/sequenceToIterable2.qml"_s)); + QVERIFY2(!component2.isError(), component.errorString().toUtf8()); + QScopedPointer<QObject> object2(component2.create()); + QVERIFY(!object2.isNull()); + + QQmlListReference converted(object2.data(), "converted"); + QCOMPARE(converted.count(), 10); + for (int i = 0; i < 10; ++i) { + Entry *e = qobject_cast<Entry *>(converted.at(i)); + QVERIFY(e); + QCOMPARE(e->objectName(), QStringLiteral("Item %1").arg(i)); + } } void tst_QmlCppCodegen::setLookupConversion() |
