diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-05-27 14:14:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-29 09:25:44 +0200 |
commit | 0306626a4deb8c36b219ba08a68248d3a454b697 (patch) | |
tree | c51fe9b5c7d8b89fdf1b105dc01f318a4da34b05 /src/qml/types/qqmllistmodel_p.h | |
parent | b5cab0515bf316d60ec6dca25b699872d4daeb45 (diff) |
Fix emission of QQmlListModel::rowsAboutToBeXxx() signals
Call beginInsertRows(), beginMoveRows() and beginRemoveRows() before
the change to ensure that rowsAboutToBeInserted(), rowsAboutToBeMoved()
and rowsAboutToBeRemoved() get emitted before the change as appropriate.
NOTE: This patch solves the problem for the most common use case, when
ListModel is used without WorkerScript. QQmlListModelWorkerAgent needs
similar changes in order to fix the signals when ListModel is used with
WorkerScript (QTBUG-39321).
Task-number: QTBUG-39279
Change-Id: Idec5167d70b242f6f7d8b7cff008e130afc62505
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/qml/types/qqmllistmodel_p.h')
-rw-r--r-- | src/qml/types/qqmllistmodel_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/types/qqmllistmodel_p.h b/src/qml/types/qqmllistmodel_p.h index 54ed18865f..3d84e14698 100644 --- a/src/qml/types/qqmllistmodel_p.h +++ b/src/qml/types/qqmllistmodel_p.h @@ -144,8 +144,11 @@ private: static QQmlListModel *createWithOwner(QQmlListModel *newOwner); void emitItemsChanged(int index, int count, const QVector<int> &roles); + void emitItemsAboutToBeRemoved(int index, int count); void emitItemsRemoved(int index, int count); + void emitItemsAboutToBeInserted(int index, int count); void emitItemsInserted(int index, int count); + void emitItemsAboutToBeMoved(int from, int to, int n); void emitItemsMoved(int from, int to, int n); }; |