diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2021-09-13 14:05:29 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-09-13 14:42:09 +0200 |
| commit | 75f957f87a9341af5d3266166ae9996dbf79da2b (patch) | |
| tree | 62a7181104cc9c17ee8e0a329a0283527226d0c0 /src | |
| parent | 68cd898b8eae183f4b3d64f056c33f33b393907e (diff) | |
QQmlListModel: Don't return from the middle of a loop
We still have to process the other properties there.
Pick-to: 6.2
Change-Id: I043596dc55de885e6b746020633ec8b97d043ff2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmlmodels/qqmllistmodel.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp index 4ae6b011fa..b9f59040a1 100644 --- a/src/qmlmodels/qqmllistmodel.cpp +++ b/src/qmlmodels/qqmllistmodel.cpp @@ -723,14 +723,13 @@ void ListModel::set(int elementIndex, QV4::Object *object, ListModel::SetElement if (maybeUrl.metaType() == QMetaType::fromType<QUrl>()) { const QUrl qurl = maybeUrl.toUrl(); const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Url); - if (r.type == ListLayout::Role::Url) { + if (r.type == ListLayout::Role::Url) e->setUrlPropertyFast(r, qurl); - } - return; + } else { + const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::VariantMap); + if (role.type == ListLayout::Role::VariantMap) + e->setVariantMapFast(role, o); } - const ListLayout::Role &role = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::VariantMap); - if (role.type == ListLayout::Role::VariantMap) - e->setVariantMapFast(role, o); } } else if (propertyValue->isNullOrUndefined()) { if (reason == SetElement::WasJustInserted) { |
