![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
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 26 of file qqmlchangeset_p.h.
QQmlChangeSet::QQmlChangeSet | ( | ) |
Constructs an empty change set.
Definition at line 33 of file qqmlchangeset.cpp.
QQmlChangeSet::QQmlChangeSet | ( | const QQmlChangeSet & | changeSet | ) |
Constructs a copy of a changeSet.
Definition at line 42 of file qqmlchangeset.cpp.
QQmlChangeSet::~QQmlChangeSet | ( | ) |
Destroys a change set.
Definition at line 54 of file qqmlchangeset.cpp.
void QQmlChangeSet::apply | ( | const QQmlChangeSet & | changeSet | ) |
Applies the changes in a changeSet to another.
Definition at line 123 of file qqmlchangeset.cpp.
Applies a list of changes to a change set.
Definition at line 465 of file qqmlchangeset.cpp.
void QQmlChangeSet::change | ( | int | index, |
int | count ) |
Appends a notification that count items were changed at index.
Definition at line 112 of file qqmlchangeset.cpp.
Definition at line 82 of file qqmlchangeset_p.h.
|
inline |
Definition at line 97 of file qqmlchangeset_p.h.
|
inline |
Definition at line 105 of file qqmlchangeset_p.h.
Applies a list of inserts to a change set.
Definition at line 361 of file qqmlchangeset.cpp.
void QQmlChangeSet::insert | ( | int | index, |
int | count ) |
Appends a notification that count items were inserted at index.
Definition at line 75 of file qqmlchangeset.cpp.
Definition at line 81 of file qqmlchangeset_p.h.
|
inline |
Definition at line 95 of file qqmlchangeset_p.h.
Applies a combined list of removes and inserts to a change set.
This is equivalent calling \l remove() followed by \l insert() with the same lists.
Definition at line 453 of file qqmlchangeset.cpp.
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 98 of file qqmlchangeset.cpp.
QQmlChangeSet & QQmlChangeSet::operator= | ( | const QQmlChangeSet & | changeSet | ) |
Assigns the value of a changeSet to another.
Definition at line 62 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 140 of file qqmlchangeset.cpp.
void QQmlChangeSet::remove | ( | int | index, |
int | count ) |
Appends a notification that count items were removed at index.
Definition at line 84 of file qqmlchangeset.cpp.
Definition at line 80 of file qqmlchangeset_p.h.
|
Prints the contents of a change set to the debug stream.
Definition at line 525 of file qqmlchangeset.cpp.
|
Prints a change to the debug stream.
Definition at line 547 of file qqmlchangeset.cpp.