aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/util
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-04-30 20:29:39 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:09 +0200
commit2338bb1faac05c87575495d324be6b8c5066479a (patch)
tree46c92157ec0865e2dfbd7c48c53b0b7c7a73bf9c /src/qml/util
parentfb4edc2359b3761f0f01afac33b8441bbbda22ab (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/qml/util')
-rw-r--r--src/qml/util/qqmladaptormodel.cpp26
-rw-r--r--src/qml/util/qqmlchangeset.cpp112
-rw-r--r--src/qml/util/qqmlchangeset_p.h35
-rw-r--r--src/qml/util/qqmllistcompositor.cpp44
-rw-r--r--src/qml/util/qqmllistcompositor_p.h10
5 files changed, 83 insertions, 144 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index c1c8bfa81d..6b48b3d38a 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -70,7 +70,7 @@ static QV4::ReturnedValue get_index(QV4::CallContext *ctx)
if (!o)
return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- return QV4::Encode(o->item->index);
+ return QV4::Encode(o->d()->item->index);
}
template <typename T, typename M> static void setModelDataType(QMetaObjectBuilder *builder, M *metaType)
@@ -202,10 +202,10 @@ public:
if (!o)
return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- const QQmlAdaptorModel *const model = static_cast<QQmlDMCachedModelData *>(o->item)->type->model;
- if (o->item->index >= 0 && *model) {
+ const QQmlAdaptorModel *const model = static_cast<QQmlDMCachedModelData *>(o->d()->item)->type->model;
+ if (o->d()->item->index >= 0 && *model) {
const QAbstractItemModel * const aim = model->aim();
- return QV4::Encode(aim->hasChildren(aim->index(o->item->index, 0, model->rootIndex)));
+ return QV4::Encode(aim->hasChildren(aim->index(o->d()->item->index, 0, model->rootIndex)));
} else {
return QV4::Encode(false);
}
@@ -347,8 +347,8 @@ QV4::ReturnedValue QQmlDMCachedModelData::get_property(QV4::CallContext *ctx, ui
if (!o)
return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- QQmlDMCachedModelData *modelData = static_cast<QQmlDMCachedModelData *>(o->item);
- if (o->item->index == -1) {
+ QQmlDMCachedModelData *modelData = static_cast<QQmlDMCachedModelData *>(o->d()->item);
+ if (o->d()->item->index == -1) {
if (!modelData->cachedData.isEmpty()) {
return ctx->engine->v8Engine->fromVariant(
modelData->cachedData.at(modelData->type->hasModelData ? 0 : propertyId));
@@ -369,16 +369,16 @@ QV4::ReturnedValue QQmlDMCachedModelData::set_property(QV4::CallContext *ctx, ui
if (!ctx->callData->argc)
return ctx->throwTypeError();
- if (o->item->index == -1) {
- QQmlDMCachedModelData *modelData = static_cast<QQmlDMCachedModelData *>(o->item);
+ if (o->d()->item->index == -1) {
+ QQmlDMCachedModelData *modelData = static_cast<QQmlDMCachedModelData *>(o->d()->item);
if (!modelData->cachedData.isEmpty()) {
if (modelData->cachedData.count() > 1) {
modelData->cachedData[propertyId] = ctx->engine->v8Engine->toVariant(ctx->callData->args[0], QVariant::Invalid);
- QMetaObject::activate(o->item, o->item->metaObject(), propertyId, 0);
+ QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), propertyId, 0);
} else if (modelData->cachedData.count() == 1) {
modelData->cachedData[0] = ctx->engine->v8Engine->toVariant(ctx->callData->args[0], QVariant::Invalid);
- QMetaObject::activate(o->item, o->item->metaObject(), 0, 0);
- QMetaObject::activate(o->item, o->item->metaObject(), 1, 0);
+ QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), 0, 0);
+ QMetaObject::activate(o->d()->item, o->d()->item->metaObject(), 1, 0);
}
}
}
@@ -589,7 +589,7 @@ public:
if (!o)
return ctx->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- return ctx->engine->v8Engine->fromVariant(static_cast<QQmlDMListAccessorData *>(o->item)->cachedData);
+ return ctx->engine->v8Engine->fromVariant(static_cast<QQmlDMListAccessorData *>(o->d()->item)->cachedData);
}
static QV4::ReturnedValue set_modelData(QV4::CallContext *ctx)
@@ -601,7 +601,7 @@ public:
if (!ctx->callData->argc)
return ctx->throwTypeError();
- static_cast<QQmlDMListAccessorData *>(o->item)->setModelData(ctx->engine->v8Engine->toVariant(ctx->callData->args[0], QVariant::Invalid));
+ static_cast<QQmlDMListAccessorData *>(o->d()->item)->setModelData(ctx->engine->v8Engine->toVariant(ctx->callData->args[0], QVariant::Invalid));
return QV4::Encode::undefined();
}
diff --git a/src/qml/util/qqmlchangeset.cpp b/src/qml/util/qqmlchangeset.cpp
index 831cb063a5..4e5e619d39 100644
--- a/src/qml/util/qqmlchangeset.cpp
+++ b/src/qml/util/qqmlchangeset.cpp
@@ -111,7 +111,7 @@ QQmlChangeSet &QQmlChangeSet::operator =(const QQmlChangeSet &changeSet)
void QQmlChangeSet::insert(int index, int count)
{
- insert(QVector<Insert>() << Insert(index, count));
+ insert(QVector<Change>() << Change(index, count));
}
/*!
@@ -120,8 +120,8 @@ void QQmlChangeSet::insert(int index, int count)
void QQmlChangeSet::remove(int index, int count)
{
- QVector<Remove> removes;
- removes.append(Remove(index, count));
+ QVector<Change> removes;
+ removes.append(Change(index, count));
remove(&removes, 0);
}
@@ -134,10 +134,10 @@ void QQmlChangeSet::remove(int index, int count)
void QQmlChangeSet::move(int from, int to, int count, int moveId)
{
- QVector<Remove> removes;
- removes.append(Remove(from, count, moveId));
- QVector<Insert> inserts;
- inserts.append(Insert(to, count, moveId));
+ QVector<Change> removes;
+ removes.append(Change(from, count, moveId));
+ QVector<Change> inserts;
+ inserts.append(Change(to, count, moveId));
remove(&removes, &inserts);
insert(inserts);
}
@@ -159,8 +159,8 @@ void QQmlChangeSet::change(int index, int count)
void QQmlChangeSet::apply(const QQmlChangeSet &changeSet)
{
- QVector<Remove> r = changeSet.m_removes;
- QVector<Insert> i = changeSet.m_inserts;
+ QVector<Change> r = changeSet.m_removes;
+ QVector<Change> i = changeSet.m_inserts;
QVector<Change> c = changeSet.m_changes;
remove(&r, &i);
insert(i);
@@ -174,19 +174,19 @@ void QQmlChangeSet::apply(const QQmlChangeSet &changeSet)
corresponding intersection in the optional \a inserts list.
*/
-void QQmlChangeSet::remove(const QVector<Remove> &removes, QVector<Insert> *inserts)
+void QQmlChangeSet::remove(const QVector<Change> &removes, QVector<Change> *inserts)
{
- QVector<Remove> r = removes;
+ QVector<Change> r = removes;
remove(&r, inserts);
}
-void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
+void QQmlChangeSet::remove(QVector<Change> *removes, QVector<Change> *inserts)
{
int removeCount = 0;
int insertCount = 0;
- QVector<Insert>::iterator insert = m_inserts.begin();
+ QVector<Change>::iterator insert = m_inserts.begin();
QVector<Change>::iterator change = m_changes.begin();
- QVector<Remove>::iterator rit = removes->begin();
+ QVector<Change>::iterator rit = removes->begin();
for (; rit != removes->end(); ++rit) {
int index = rit->index + removeCount;
int count = rit->count;
@@ -223,7 +223,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
// a new delta for that portion and subtract the size of that delta from the current
// one.
if (offset < 0 && rit->moveId != -1) {
- rit = removes->insert(rit, Remove(
+ rit = removes->insert(rit, Change(
rit->index, -offset, rit->moveId, rit->offset));
++rit;
rit->count -= -offset;
@@ -233,7 +233,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
removeCount += -offset;
offset = 0;
} else if (offset > 0 && insert->moveId != -1) {
- insert = m_inserts.insert(insert, Insert(
+ insert = m_inserts.insert(insert, Change(
insert->index - removeCount, offset, insert->moveId, insert->offset));
++insert;
insert->index += offset;
@@ -246,7 +246,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
// If the current remove has a move id, find any inserts with the same move id and
// replace the corresponding sections with the insert removed from the change set.
if (rit->moveId != -1 && difference > 0 && inserts) {
- for (QVector<Insert>::iterator iit = inserts->begin(); iit != inserts->end(); ++iit) {
+ for (QVector<Change>::iterator iit = inserts->begin(); iit != inserts->end(); ++iit) {
if (iit->moveId != rit->moveId
|| rit->offset > iit->offset + iit->count
|| iit->offset > rit->offset + difference) {
@@ -256,7 +256,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
// a new insert for the portion prior to the replacement insert.
const int overlapOffset = rit->offset - iit->offset;
if (overlapOffset > 0) {
- iit = inserts->insert(iit, Insert(
+ iit = inserts->insert(iit, Change(
iit->index, overlapOffset, iit->moveId, iit->offset));
++iit;
iit->index += overlapOffset;
@@ -275,7 +275,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
const int count
= qMin(iit->offset + iit->count, rit->offset + difference)
- qMax(iit->offset, rit->offset);
- iit = inserts->insert(iit, Insert(
+ iit = inserts->insert(iit, Change(
iit->index,
count,
insert->moveId,
@@ -316,12 +316,12 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
insert->index -= removeCount;
removeCount = 0;
- QVector<Remove>::iterator remove = m_removes.begin();
+ QVector<Change>::iterator remove = m_removes.begin();
for (rit = removes->begin(); rit != removes->end(); ++rit) {
if (rit->count == 0)
continue;
// Accumulate consecutive removes into a single delta before attempting to apply.
- for (QVector<Remove>::iterator next = rit + 1; next != removes->end()
+ for (QVector<Change>::iterator next = rit + 1; next != removes->end()
&& next->index == rit->index
&& next->moveId == -1
&& rit->moveId == -1; ++next) {
@@ -336,7 +336,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
while (remove != m_removes.end() && index + rit->count >= remove->index) {
int count = 0;
const int offset = remove->index - index;
- QVector<Remove>::iterator rend = remove;
+ QVector<Change>::iterator rend = remove;
for (; rend != m_removes.end()
&& rit->moveId == -1
&& rend->moveId == -1
@@ -366,7 +366,7 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
// Insert a remove for the portion of the unmergable current remove prior to the
// point of intersection.
if (offset > 0) {
- remove = m_removes.insert(remove, Remove(
+ remove = m_removes.insert(remove, Change(
rit->index, offset, rit->moveId, rit->offset));
++remove;
rit->count -= offset;
@@ -395,19 +395,19 @@ void QQmlChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
Applies a list of \a inserts to a change set.
*/
-void QQmlChangeSet::insert(const QVector<Insert> &inserts)
+void QQmlChangeSet::insert(const QVector<Change> &inserts)
{
int insertCount = 0;
- QVector<Insert>::iterator insert = m_inserts.begin();
+ QVector<Change>::iterator insert = m_inserts.begin();
QVector<Change>::iterator change = m_changes.begin();
- for (QVector<Insert>::const_iterator iit = inserts.begin(); iit != inserts.end(); ++iit) {
+ for (QVector<Change>::const_iterator iit = inserts.begin(); iit != inserts.end(); ++iit) {
if (iit->count == 0)
continue;
int index = iit->index - insertCount;
- Insert current = *iit;
+ Change current = *iit;
// Accumulate consecutive inserts into a single delta before attempting to insert.
- for (QVector<Insert>::const_iterator next = iit + 1; next != inserts.end()
+ for (QVector<Change>::const_iterator next = iit + 1; next != inserts.end()
&& next->index == iit->index + iit->count
&& next->moveId == -1
&& iit->moveId == -1; ++next) {
@@ -459,7 +459,7 @@ void QQmlChangeSet::insert(const QVector<Insert> &inserts)
// If either insert has a moveId then split the existing insert and insert the
// current one in the middle.
if (offset > 0) {
- insert = m_inserts.insert(insert, Insert(
+ insert = m_inserts.insert(insert, Change(
insert->index + insertCount, offset, insert->moveId, insert->offset));
++insert;
insert->index += offset;
@@ -487,10 +487,10 @@ void QQmlChangeSet::insert(const QVector<Insert> &inserts)
calling \l remove() followed by \l insert() with the same lists.
*/
-void QQmlChangeSet::move(const QVector<Remove> &removes, const QVector<Insert> &inserts)
+void QQmlChangeSet::move(const QVector<Change> &removes, const QVector<Change> &inserts)
{
- QVector<Remove> r = removes;
- QVector<Insert> i = inserts;
+ QVector<Change> r = removes;
+ QVector<Change> i = inserts;
remove(&r, &i);
insert(i);
}
@@ -507,7 +507,7 @@ void QQmlChangeSet::change(const QVector<Change> &changes)
void QQmlChangeSet::change(QVector<Change> *changes)
{
- QVector<Insert>::iterator insert = m_inserts.begin();
+ QVector<Change>::iterator insert = m_inserts.begin();
QVector<Change>::iterator change = m_changes.begin();
for (QVector<Change>::iterator cit = changes->begin(); cit != changes->end(); ++cit) {
for (; insert != m_inserts.end() && insert->end() < cit->index; ++insert) {}
@@ -560,55 +560,13 @@ void QQmlChangeSet::change(QVector<Change> *changes)
QDebug operator <<(QDebug debug, const QQmlChangeSet &set)
{
debug.nospace() << "QQmlChangeSet(";
- foreach (const QQmlChangeSet::Remove &remove, set.removes()) debug << remove;
- foreach (const QQmlChangeSet::Insert &insert, set.inserts()) debug << insert;
+ foreach (const QQmlChangeSet::Change &remove, set.removes()) debug << remove;
+ foreach (const QQmlChangeSet::Change &insert, set.inserts()) debug << insert;
foreach (const QQmlChangeSet::Change &change, set.changes()) debug << change;
return debug.nospace() << ')';
}
/*!
- Prints a \a remove to the \a debug stream.
-*/
-
-QDebug operator <<(QDebug debug, const QQmlChangeSet::Remove &remove)
-{
- if (remove.moveId == -1) {
- return (debug.nospace()
- << "Remove(" << remove.index
- << ',' << remove.count
- << ')').space();
- } else {
- return (debug.nospace()
- << "Remove(" << remove.index
- << ',' << remove.count
- << ',' << remove.moveId
- << ',' << remove.offset
- << ')').space();
- }
-}
-
-/*!
- Prints an \a insert to the \a debug stream.
-*/
-
-QDebug operator <<(QDebug debug, const QQmlChangeSet::Insert &insert)
-{
- if (insert.moveId == -1) {
- return (debug.nospace()
- << "Insert(" << insert.index
- << ',' << insert.count
- << ')').space();
- } else {
- return (debug.nospace()
- << "Insert(" << insert.index
- << ',' << insert.count
- << ',' << insert.moveId
- << ',' << insert.offset
- << ')').space();
- }
-}
-
-/*!
Prints a \a change to the \a debug stream.
*/
diff --git a/src/qml/util/qqmlchangeset_p.h b/src/qml/util/qqmlchangeset_p.h
index acafbd4eec..e79bc4a832 100644
--- a/src/qml/util/qqmlchangeset_p.h
+++ b/src/qml/util/qqmlchangeset_p.h
@@ -90,29 +90,14 @@ public:
int end() const { return index + count; }
};
-
- struct Insert : public Change
- {
- Insert() {}
- Insert(int index, int count, int moveId = -1, int offset = 0)
- : Change(index, count, moveId, offset) {}
- };
-
- struct Remove : public Change
- {
- Remove() {}
- Remove(int index, int count, int moveId = -1, int offset = 0)
- : Change(index, count, moveId, offset) {}
- };
-
QQmlChangeSet();
QQmlChangeSet(const QQmlChangeSet &changeSet);
~QQmlChangeSet();
QQmlChangeSet &operator =(const QQmlChangeSet &changeSet);
- const QVector<Remove> &removes() const { return m_removes; }
- const QVector<Insert> &inserts() const { return m_inserts; }
+ const QVector<Change> &removes() const { return m_removes; }
+ const QVector<Change> &inserts() const { return m_inserts; }
const QVector<Change> &changes() const { return m_changes; }
void insert(int index, int count);
@@ -120,9 +105,9 @@ public:
void move(int from, int to, int count, int moveId);
void change(int index, int count);
- void insert(const QVector<Insert> &inserts);
- void remove(const QVector<Remove> &removes, QVector<Insert> *inserts = 0);
- void move(const QVector<Remove> &removes, const QVector<Insert> &inserts);
+ void insert(const QVector<Change> &inserts);
+ void remove(const QVector<Change> &removes, QVector<Change> *inserts = 0);
+ void move(const QVector<Change> &removes, const QVector<Change> &inserts);
void change(const QVector<Change> &changes);
void apply(const QQmlChangeSet &changeSet);
@@ -139,26 +124,22 @@ public:
int difference() const { return m_difference; }
private:
- void remove(QVector<Remove> *removes, QVector<Insert> *inserts);
+ void remove(QVector<Change> *removes, QVector<Change> *inserts);
void change(QVector<Change> *changes);
- QVector<Remove> m_removes;
- QVector<Insert> m_inserts;
+ QVector<Change> m_removes;
+ QVector<Change> m_inserts;
QVector<Change> m_changes;
int m_difference;
};
Q_DECLARE_TYPEINFO(QQmlChangeSet::Change, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQmlChangeSet::Remove, Q_PRIMITIVE_TYPE);
-Q_DECLARE_TYPEINFO(QQmlChangeSet::Insert, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QQmlChangeSet::MoveKey, Q_PRIMITIVE_TYPE);
inline uint qHash(const QQmlChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); }
inline bool operator ==(const QQmlChangeSet::MoveKey &l, const QQmlChangeSet::MoveKey &r) {
return l.moveId == r.moveId && l.offset == r.offset; }
-Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet::Remove &remove);
-Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet::Insert &insert);
Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet::Change &change);
Q_QML_PRIVATE_EXPORT QDebug operator <<(QDebug debug, const QQmlChangeSet &change);
diff --git a/src/qml/util/qqmllistcompositor.cpp b/src/qml/util/qqmllistcompositor.cpp
index 830a24e752..64528dafd2 100644
--- a/src/qml/util/qqmllistcompositor.cpp
+++ b/src/qml/util/qqmllistcompositor.cpp
@@ -951,7 +951,7 @@ void QQmlListCompositor::clear()
void QQmlListCompositor::listItemsInserted(
QVector<Insert> *translatedInsertions,
void *list,
- const QVector<QQmlChangeSet::Insert> &insertions,
+ const QVector<QQmlChangeSet::Change> &insertions,
const QVector<MovedFlags> *movedFlags)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << insertions)
@@ -966,7 +966,7 @@ void QQmlListCompositor::listItemsInserted(
it.incrementIndexes(it->count);
continue;
}
- foreach (const QQmlChangeSet::Insert &insertion, insertions) {
+ foreach (const QQmlChangeSet::Change &insertion, insertions) {
int offset = insertion.index - it->index;
if ((offset > 0 && offset < it->count)
|| (offset == 0 && it->prepend())
@@ -1064,8 +1064,8 @@ void QQmlListCompositor::listItemsInserted(
QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count)
Q_ASSERT(count > 0);
- QVector<QQmlChangeSet::Insert> insertions;
- insertions.append(QQmlChangeSet::Insert(index, count));
+ QVector<QQmlChangeSet::Change> insertions;
+ insertions.append(QQmlChangeSet::Change(index, count));
listItemsInserted(translatedInsertions, list, insertions);
}
@@ -1073,8 +1073,8 @@ void QQmlListCompositor::listItemsInserted(
void QQmlListCompositor::listItemsRemoved(
QVector<Remove> *translatedRemovals,
void *list,
- QVector<QQmlChangeSet::Remove> *removals,
- QVector<QQmlChangeSet::Insert> *insertions,
+ QVector<QQmlChangeSet::Change> *removals,
+ QVector<QQmlChangeSet::Change> *insertions,
QVector<MovedFlags> *movedFlags)
{
QT_QML_TRACE_LISTCOMPOSITOR(<< list << *removals)
@@ -1086,7 +1086,7 @@ void QQmlListCompositor::listItemsRemoved(
continue;
}
bool removed = false;
- for (QVector<QQmlChangeSet::Remove>::iterator removal = removals->begin();
+ for (QVector<QQmlChangeSet::Change>::iterator removal = removals->begin();
!removed && removal != removals->end();
++removal) {
int relativeIndex = removal->index - it->index;
@@ -1104,7 +1104,7 @@ void QQmlListCompositor::listItemsRemoved(
}
if (removal->isMove()) {
// If the removal was part of a move find the corresponding insert.
- QVector<QQmlChangeSet::Insert>::iterator insertion = insertions->begin();
+ QVector<QQmlChangeSet::Change>::iterator insertion = insertions->begin();
for (; insertion != insertions->end() && insertion->moveId != removal->moveId;
++insertion) {}
Q_ASSERT(insertion != insertions->end());
@@ -1114,11 +1114,11 @@ void QQmlListCompositor::listItemsRemoved(
// If the remove started before the current range, split it and the
// corresponding insert so we're only working with intersecting part.
int splitMoveId = ++m_moveId;
- removal = removals->insert(removal, QQmlChangeSet::Remove(
+ removal = removals->insert(removal, QQmlChangeSet::Change(
removal->index, -relativeIndex, splitMoveId));
++removal;
removal->count -= -relativeIndex;
- insertion = insertions->insert(insertion, QQmlChangeSet::Insert(
+ insertion = insertions->insert(insertion, QQmlChangeSet::Change(
insertion->index, -relativeIndex, splitMoveId));
++insertion;
insertion->index += -relativeIndex;
@@ -1135,10 +1135,10 @@ void QQmlListCompositor::listItemsRemoved(
if (removeCount < removal->count) {
// If the remove doesn't encompass all of the current range,
// split it and the corresponding insert.
- removal = removals->insert(removal, QQmlChangeSet::Remove(
+ removal = removals->insert(removal, QQmlChangeSet::Change(
removal->index, removeCount, translatedRemoval.moveId));
++removal;
- insertion = insertions->insert(insertion, QQmlChangeSet::Insert(
+ insertion = insertions->insert(insertion, QQmlChangeSet::Change(
insertion->index, removeCount, translatedRemoval.moveId));
++insertion;
@@ -1253,8 +1253,8 @@ void QQmlListCompositor::listItemsRemoved(
QT_QML_TRACE_LISTCOMPOSITOR(<< list << index << count)
Q_ASSERT(count >= 0);
- QVector<QQmlChangeSet::Remove> removals;
- removals.append(QQmlChangeSet::Remove(index, count));
+ QVector<QQmlChangeSet::Change> removals;
+ removals.append(QQmlChangeSet::Change(index, count));
listItemsRemoved(translatedRemovals, list, &removals, 0, 0);
}
@@ -1280,11 +1280,11 @@ void QQmlListCompositor::listItemsMoved(
QT_QML_TRACE_LISTCOMPOSITOR(<< list << from << to << count)
Q_ASSERT(count >= 0);
- QVector<QQmlChangeSet::Remove> removals;
- QVector<QQmlChangeSet::Insert> insertions;
+ QVector<QQmlChangeSet::Change> removals;
+ QVector<QQmlChangeSet::Change> insertions;
QVector<MovedFlags> movedFlags;
- removals.append(QQmlChangeSet::Remove(from, count, 0));
- insertions.append(QQmlChangeSet::Insert(to, count, 0));
+ removals.append(QQmlChangeSet::Change(from, count, 0));
+ insertions.append(QQmlChangeSet::Change(to, count, 0));
listItemsRemoved(translatedRemovals, list, &removals, &insertions, &movedFlags);
listItemsInserted(translatedInsertions, list, insertions, &movedFlags);
@@ -1342,16 +1342,16 @@ void QQmlListCompositor::listItemsChanged(
void QQmlListCompositor::transition(
Group from,
Group to,
- QVector<QQmlChangeSet::Remove> *removes,
- QVector<QQmlChangeSet::Insert> *inserts)
+ QVector<QQmlChangeSet::Change> *removes,
+ QVector<QQmlChangeSet::Change> *inserts)
{
int removeCount = 0;
for (iterator it(m_ranges.next, 0, Default, m_groupCount); *it != &m_ranges; *it = it->next) {
if (it == from && it != to) {
- removes->append(QQmlChangeSet::Remove(it.index[from]- removeCount, it->count));
+ removes->append(QQmlChangeSet::Change(it.index[from]- removeCount, it->count));
removeCount += it->count;
} else if (it != from && it == to) {
- inserts->append(QQmlChangeSet::Insert(it.index[to], it->count));
+ inserts->append(QQmlChangeSet::Change(it.index[to], it->count));
}
it.incrementIndexes(it->count);
}
diff --git a/src/qml/util/qqmllistcompositor_p.h b/src/qml/util/qqmllistcompositor_p.h
index 5d87051582..c26b62a38c 100644
--- a/src/qml/util/qqmllistcompositor_p.h
+++ b/src/qml/util/qqmllistcompositor_p.h
@@ -263,8 +263,8 @@ public:
void transition(
Group from,
Group to,
- QVector<QQmlChangeSet::Remove> *removes,
- QVector<QQmlChangeSet::Insert> *inserts);
+ QVector<QQmlChangeSet::Change> *removes,
+ QVector<QQmlChangeSet::Change> *inserts);
private:
Range m_ranges;
@@ -290,13 +290,13 @@ private:
void listItemsRemoved(
QVector<Remove> *translatedRemovals,
void *list,
- QVector<QQmlChangeSet::Remove> *removals,
- QVector<QQmlChangeSet::Insert> *insertions = 0,
+ QVector<QQmlChangeSet::Change> *removals,
+ QVector<QQmlChangeSet::Change> *insertions = 0,
QVector<MovedFlags> *movedFlags = 0);
void listItemsInserted(
QVector<Insert> *translatedInsertions,
void *list,
- const QVector<QQmlChangeSet::Insert> &insertions,
+ const QVector<QQmlChangeSet::Change> &insertions,
const QVector<MovedFlags> *movedFlags = 0);
void listItemsChanged(
QVector<Change> *translatedChanges,