![]() |
Qt 6.x
The Qt SDK
|
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set. More...
#include <qqmlchangeset_p.h>
Classes | |
struct | Change |
struct | ChangeData |
struct | MoveKey |
Public Member Functions | |
QQmlChangeSet () | |
Constructs an empty change set. | |
QQmlChangeSet (const QQmlChangeSet &changeSet) | |
Constructs a copy of a changeSet. | |
~QQmlChangeSet () | |
Destroys a change set. | |
QQmlChangeSet & | operator= (const QQmlChangeSet &changeSet) |
Assigns the value of a changeSet to another. | |
const QVector< Change > & | removes () const |
const QVector< Change > & | inserts () const |
const QVector< Change > & | changes () const |
void | insert (int index, int count) |
Appends a notification that count items were inserted at index. | |
void | remove (int index, int count) |
Appends a notification that count items were removed at index. | |
void | move (int from, int to, int count, int moveId) |
Appends a notification that count items were moved from one index to another. | |
void | change (int index, int count) |
Appends a notification that count items were changed at index. | |
void | insert (const QVector< Change > &inserts) |
Applies a list of inserts to a change set. | |
void | remove (const QVector< Change > &removes, QVector< Change > *inserts=nullptr) |
Applies a list of removes to a change set. | |
void | move (const QVector< Change > &removes, const QVector< Change > &inserts) |
Applies a combined list of removes and inserts to a change set. | |
void | change (const QVector< Change > &changes) |
Applies a list of changes to a change set. | |
void | apply (const QQmlChangeSet &changeSet) |
Applies the changes in a changeSet to another. | |
bool | isEmpty () const |
void | clear () |
int | difference () const |
Related Symbols | |
(Note that these are not member symbols.) | |
QDebug | operator<< (QDebug debug, const QQmlChangeSet &set) |
QDebug | operator<< (QDebug debug, const QQmlChangeSet::Change &change) |
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
QQmlChangeSet can be used to record a series of notifications about items in an indexed list being inserted, removed, moved, and changed. Notifications in the set are re-ordered so that all notifications of a single type are grouped together and sorted in order of ascending index, with remove notifications preceding all others, followed by insert notification, and then change notifications.
Moves in a change set are represented by a remove notification paired with an insert notification by way of a shared unique moveId. Re-ordering may result in one or both of the paired notifications being divided, when this happens the offset member of the notification will indicate the relative offset of the divided notification from the beginning of the original.
Definition at line 24 of file qqmlchangeset_p.h.
QQmlChangeSet::QQmlChangeSet | ( | ) |
Constructs an empty change set.
Definition at line 32 of file qqmlchangeset.cpp.
QQmlChangeSet::QQmlChangeSet | ( | const QQmlChangeSet & | changeSet | ) |
Constructs a copy of a changeSet.
Definition at line 41 of file qqmlchangeset.cpp.
QQmlChangeSet::~QQmlChangeSet | ( | ) |
Destroys a change set.
Definition at line 53 of file qqmlchangeset.cpp.
void QQmlChangeSet::apply | ( | const QQmlChangeSet & | changeSet | ) |
Applies the changes in a changeSet to another.
Definition at line 122 of file qqmlchangeset.cpp.
References change(), i, insert(), and remove().
Referenced by QQuickItemViewChangeSet::applyBufferedChanges(), and QQuickItemViewChangeSet::applyChanges().
Applies a list of changes to a change set.
Definition at line 464 of file qqmlchangeset.cpp.
References change(), and changes().
void QQmlChangeSet::change | ( | int | index, |
int | count | ||
) |
Appends a notification that count items were changed at index.
Definition at line 111 of file qqmlchangeset.cpp.
References change(), and changes().
Referenced by apply(), change(), change(), insert(), QQmlDelegateModelPrivate::itemsChanged(), and QQmlObjectModelPrivate::replace().
Definition at line 78 of file qqmlchangeset_p.h.
Referenced by QQuickItemViewPrivate::applyModelChanges(), change(), and change().
|
inline |
Definition at line 93 of file qqmlchangeset_p.h.
Referenced by QQmlDelegateModelGroupPrivate::emitModelUpdated(), and QQuickItemViewChangeSet::reset().
|
inline |
Definition at line 101 of file qqmlchangeset_p.h.
Referenced by QQmlInstantiatorPrivate::_q_modelUpdated(), QQmlDelegateModelGroupPrivate::emitChanges(), QQmlDelegateModelPrivate::emitModelUpdated(), QQmlPartsModel::emitModelUpdated(), QQmlDelegateModelPrivate::updateFilterGroup(), QQmlPartsModel::updateFilterGroup(), and QQmlPartsModel::updateFilterGroup().
Applies a list of inserts to a change set.
Definition at line 360 of file qqmlchangeset.cpp.
References change(), QQmlChangeSet::ChangeData::count, insert(), inserts(), and next.
void QQmlChangeSet::insert | ( | int | index, |
int | count | ||
) |
Appends a notification that count items were inserted at index.
Definition at line 74 of file qqmlchangeset.cpp.
References insert().
Referenced by apply(), QQmlDelegateModelPrivate::delegateChanged(), insert(), insert(), QQmlObjectModelPrivate::insert(), QQmlDelegateModelPrivate::itemsInserted(), move(), and move().
Definition at line 77 of file qqmlchangeset_p.h.
Referenced by MutableModelIterator::MutableModelIterator(), QQmlInstantiatorPrivate::_q_modelUpdated(), QQuickItemViewChangeSet::applyChanges(), QQuickItemViewPrivate::applyModelChanges(), QQmlDelegateModelGroupPrivate::emitChanges(), insert(), move(), move(), and remove().
|
inline |
Definition at line 91 of file qqmlchangeset_p.h.
Referenced by QQmlDelegateModelGroupPrivate::emitChanges(), QQuickItemViewChangeSet::hasPendingChanges(), QQmlPartsModel::updateFilterGroup(), and QQmlPartsModel::updateFilterGroup().
void QQmlChangeSet::move | ( | int | from, |
int | to, | ||
int | count, | ||
int | moveId | ||
) |
Appends a notification that count items were moved from one index to another.
The moveId must be unique across the lifetime of the change set and any related change sets.
Definition at line 97 of file qqmlchangeset.cpp.
References insert(), inserts(), remove(), and removes().
Referenced by QQmlDelegateModelPrivate::itemsMoved(), QQmlObjectModelPrivate::move(), QQmlDelegateModelPrivate::updateFilterGroup(), and QQmlPartsModel::updateFilterGroup().
QQmlChangeSet & QQmlChangeSet::operator= | ( | const QQmlChangeSet & | changeSet | ) |
Assigns the value of a changeSet to another.
Definition at line 61 of file qqmlchangeset.cpp.
void QQmlChangeSet::remove | ( | const QVector< Change > & | removes, |
QVector< Change > * | inserts = nullptr |
||
) |
Applies a list of removes to a change set.
If a remove contains a moveId then any intersecting insert in the set will replace the corresponding intersection in the optional inserts list.
Definition at line 139 of file qqmlchangeset.cpp.
References inserts(), remove(), and removes().
void QQmlChangeSet::remove | ( | int | index, |
int | count | ||
) |
Appends a notification that count items were removed at index.
Definition at line 83 of file qqmlchangeset.cpp.
References remove(), and removes().
Referenced by apply(), QQmlDelegateModelPrivate::delegateChanged(), QQmlDelegateModelPrivate::itemsRemoved(), move(), move(), remove(), remove(), and QQmlObjectModelPrivate::remove().
Definition at line 76 of file qqmlchangeset_p.h.
Referenced by MutableModelIterator::MutableModelIterator(), QQmlInstantiatorPrivate::_q_modelUpdated(), QQuickItemViewChangeSet::applyChanges(), QQuickItemViewPrivate::applyModelChanges(), QQmlDelegateModelGroupPrivate::emitChanges(), move(), move(), remove(), and remove().
|
related |
|
related |
Prints a change to the debug stream.
Definition at line 546 of file qqmlchangeset.cpp.
References QQmlChangeSet::ChangeData::count, debug, and QQmlChangeSet::ChangeData::index.