diff options
Diffstat (limited to 'tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp')
-rw-r--r-- | tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp index 77ab0ecbc0..b47062ee94 100644 --- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp +++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp @@ -128,6 +128,7 @@ private slots: void qobjectTrackerForDynamicModelObjects(); void crash_append_empty_array(); void dynamic_roles_crash_QTBUG_38907(); + void nestedListModelIteration(); }; bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object) @@ -1667,6 +1668,32 @@ void tst_qqmllistmodel::dynamic_roles_crash_QTBUG_38907() QVERIFY(retVal.toBool()); } +void tst_qqmllistmodel::nestedListModelIteration() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + QTest::ignoreMessage(QtMsgType::QtDebugMsg ,R"({"subItems":[{"a":1,"b":0,"c":0},{"a":0,"b":2,"c":0},{"a":0,"b":0,"c":3}]})"); + component.setData( + R"(import QtQuick 2.5 + Item { + visible: true + width: 640 + height: 480 + ListModel { + id : model + } + Component.onCompleted: { + var tempData = { + subItems: [{a: 1}, {b: 2}, {c: 3}] + } + model.insert(0, tempData) + console.log(JSON.stringify(model.get(0))) + } + })", + QUrl()); + QScopedPointer<QObject>(component.create()); +} + QTEST_MAIN(tst_qqmllistmodel) #include "tst_qqmllistmodel.moc" |