diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-04-30 20:29:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:09 +0200 |
commit | 2338bb1faac05c87575495d324be6b8c5066479a (patch) | |
tree | 46c92157ec0865e2dfbd7c48c53b0b7c7a73bf9c /src/quick/items/qquickitemview.cpp | |
parent | fb4edc2359b3761f0f01afac33b8441bbbda22ab (diff) |
Fix QQmlDelegateModelChangeArray
The class had a vtable, clashing with assumptions about Managed
objects. The derived classes where actually only cosmetic sugar
on top of the basic change class. Clean this up and unify the
functionality in the base class.
In addition adjust the class to the new data layout.
Change-Id: I8677f6c71465381f7ebdf82eb6025fda6d137ec3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/qquickitemview.cpp')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 94abbd0954..ef696dae96 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -176,7 +176,7 @@ void QQuickItemViewChangeSet::applyChanges(const QQmlChangeSet &changeSet) int moveId = -1; int moveOffset = 0; - foreach (const QQmlChangeSet::Remove &r, changeSet.removes()) { + foreach (const QQmlChangeSet::Change &r, changeSet.removes()) { itemCount -= r.count; if (moveId == -1 && newCurrentIndex >= r.index + r.count) { newCurrentIndex -= r.count; @@ -195,7 +195,7 @@ void QQuickItemViewChangeSet::applyChanges(const QQmlChangeSet &changeSet) currentChanged = true; } } - foreach (const QQmlChangeSet::Insert &i, changeSet.inserts()) { + foreach (const QQmlChangeSet::Change &i, changeSet.inserts()) { if (moveId == -1) { if (itemCount && newCurrentIndex >= i.index) { newCurrentIndex += i.count; @@ -1038,7 +1038,7 @@ void QQuickItemViewPrivate::applyPendingChanges() layout(); } -int QQuickItemViewPrivate::findMoveKeyIndex(QQmlChangeSet::MoveKey key, const QVector<QQmlChangeSet::Remove> &changes) const +int QQuickItemViewPrivate::findMoveKeyIndex(QQmlChangeSet::MoveKey key, const QVector<QQmlChangeSet::Change> &changes) const { for (int i=0; i<changes.count(); i++) { for (int j=changes[i].index; j<changes[i].index + changes[i].count; j++) { @@ -1943,8 +1943,8 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult totalInsertionResult->visiblePos = prevViewPos; totalRemovalResult->visiblePos = prevViewPos; - const QVector<QQmlChangeSet::Remove> &removals = currentChanges.pendingChanges.removes(); - const QVector<QQmlChangeSet::Insert> &insertions = currentChanges.pendingChanges.inserts(); + const QVector<QQmlChangeSet::Change> &removals = currentChanges.pendingChanges.removes(); + const QVector<QQmlChangeSet::Change> &insertions = currentChanges.pendingChanges.inserts(); ChangeResult insertionResult(prevViewPos); ChangeResult removalResult(prevViewPos); @@ -1964,7 +1964,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult } } if (runDelayedRemoveTransition) { - QQmlChangeSet::Remove removal; + QQmlChangeSet::Change removal; for (QList<FxViewItem*>::Iterator it = visibleItems.begin(); it != visibleItems.end();) { FxViewItem *item = *it; if (item->index == -1 && !item->attached->delayRemove()) { @@ -2061,7 +2061,7 @@ bool QQuickItemViewPrivate::applyModelChanges(ChangeResult *totalInsertionResult return visibleAffected; } -bool QQuickItemViewPrivate::applyRemovalChange(const QQmlChangeSet::Remove &removal, ChangeResult *removeResult, int *removedCount) +bool QQuickItemViewPrivate::applyRemovalChange(const QQmlChangeSet::Change &removal, ChangeResult *removeResult, int *removedCount) { Q_Q(QQuickItemView); bool visibleAffected = false; @@ -2111,7 +2111,7 @@ bool QQuickItemViewPrivate::applyRemovalChange(const QQmlChangeSet::Remove &remo return visibleAffected; } -void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQmlChangeSet::Remove &removal, ChangeResult *removeResult) +void QQuickItemViewPrivate::removeItem(FxViewItem *item, const QQmlChangeSet::Change &removal, ChangeResult *removeResult) { if (removeResult->visiblePos.isValid()) { if (item->position() < removeResult->visiblePos) |