From 0306626a4deb8c36b219ba08a68248d3a454b697 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 27 May 2014 14:14:52 +0200 Subject: 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 --- src/qml/types/qqmllistmodel_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/qml/types/qqmllistmodel_p.h') 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 &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); }; -- cgit v1.2.3