34 MoveKey(
int moveId,
int offset) : moveId(moveId), offset(offset) {}
50 struct Change: ChangeData
58 Change(
int index,
int count,
int moveId = -1,
int offset = 0) {
61 this->moveId = moveId;
62 this->offset = offset;
65 bool isMove()
const {
return moveId >= 0; }
67 MoveKey moveKey(
int index)
const {
68 return MoveKey(moveId, index - Change::index + offset); }
70 int start()
const {
return index; }
71 int end()
const {
return index + count; }
75 QQmlChangeSet(
const QQmlChangeSet &changeSet);
78 QQmlChangeSet &operator =(
const QQmlChangeSet &changeSet);
80 const QVector<Change> &removes()
const {
return m_removes; }
81 const QVector<Change> &inserts()
const {
return m_inserts; }
82 const QVector<Change> &changes()
const {
return m_changes; }
84 void insert(
int index,
int count);
85 void remove(
int index,
int count);
86 void move(
int from,
int to,
int count,
int moveId);
87 void change(
int index,
int count);
89 void insert(
const QVector<Change> &inserts);
90 void remove(
const QVector<Change> &removes, QVector<Change> *inserts =
nullptr);
91 void move(
const QVector<Change> &removes,
const QVector<Change> &inserts);
92 void change(
const QVector<Change> &changes);
93 void apply(
const QQmlChangeSet &changeSet);
95 bool isEmpty()
const {
return m_removes.empty() && m_inserts.empty() && m_changes.isEmpty(); }
105 int difference()
const {
return m_difference; }
108 void remove(QVector<Change> *removes, QVector<Change> *inserts);
109 void change(QVector<Change> *changes);
111 QVector<Change> m_removes;
112 QVector<Change> m_inserts;
113 QVector<Change> m_changes;