diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-11-21 10:29:12 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-11-24 09:20:11 +0000 |
| commit | 5d0bd461db7e67ea4233ab07aa0a879b99ea09d1 (patch) | |
| tree | 43cc7e89458ec3a52d5ddc8e3d37a62a7ff6a973 /src/qml/jsruntime/qv4engine.cpp | |
| parent | 8e5e37aa15eab744bea1f6052a125be9b53366f3 (diff) | |
QtQml: Fill in the const iterator functions in the empty sequence
Without these you may get an infinite sequence when trying to iterate
using const iterators.
Pick-to: 6.10 6.8
Task-number: QTBUG-142097
Change-Id: Iae93063b240ebe9426804197533ed7efd8e007bc
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index a3cd7e64cd..2478dcb137 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -167,6 +167,17 @@ static QtMetaContainerPrivate::QMetaSequenceInterface emptySequenceInterface() iface.destroyIteratorFn = [](const void *) {}; iface.copyIteratorFn = [](void *, const void *) {}; iface.diffIteratorFn = [](const void *, const void *) { return qsizetype(0); }; + + iface.createConstIteratorFn = [](const void *, QMetaSequenceInterface::Position) -> void * { + return nullptr; + }; + iface.advanceConstIteratorFn = [](void *, qsizetype) {}; + iface.compareConstIteratorFn = [](const void *, const void *) { + return true; /*all iterators are nullptr*/ + }; + iface.destroyConstIteratorFn = [](const void *) {}; + iface.copyConstIteratorFn = [](void *, const void *) {}; + iface.diffConstIteratorFn = [](const void *, const void *) { return qsizetype(0); }; return iface; } |
