diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-12-28 16:03:44 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-12-29 15:51:56 +0000 |
commit | 3accc1dae76575120e71cadb547e961ecd50bcb0 (patch) | |
tree | 2013ad02edb525ad22dac157e5a931b5cf162be5 /src/qml/jsruntime | |
parent | 1db9405128972d5ba77e33181bee40356f718cea (diff) |
Fix failed assertions coming from the QML list model
QAbstractItemModel has become more strict in sanity checking
the arguments of beginInsertRows and friends with change
00c09e752ff7e482e1308e0e34721dc979204595 in qtbase.
Unfortunately, the QML list model was feeding it out of bound
rows in some cases, leading to failed assertions.
Fix this properly, by calculating the inserted/removed and
changed rows on the fly when syncing the list model from
the worker thread.
Adjust the code in the XML list model as well, so it does
call things in the proper order.
Fix two tests, one for a minimal change in behavior (more
correct now), the other to remove an assertion that is
not valid anymore in debug builds (where assertions in
QtCore will call rowCount()).
Change-Id: Ied85269f78d41b64e06388590be3ed227ac88fdb
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 240fba7905..93d538127b 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -604,6 +604,14 @@ static Q_NEVER_INLINE ReturnedValue getElementFallback(ExecutionEngine *engine, return o->get(name); } +/* load element: + + Managed *m = object.heapObject(); + if (m) + return m->internalClass->getIndexed(m, index); + return getIndexedFallback(object, index); +*/ + ReturnedValue Runtime::method_loadElement(ExecutionEngine *engine, const Value &object, const Value &index) { uint idx = 0; |