aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmldelegatemodel_p_p.h
diff options
context:
space:
mode:
authorDaniel Vrátil <dan@progdan.cz>2014-04-16 18:33:24 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-12 19:21:29 +0200
commita0aefe111758b2267f1bf5fbb26991cbc6dd804d (patch)
tree93e0559d268de94ef4e76de8bb9aeba357b7df2e /src/qml/types/qqmldelegatemodel_p_p.h
parent261e6aa88ce42c4dfbc14c4c5bc2748202a8d7ab (diff)
Implement proper support for layoutChange in QQmlDelegateModel
Current implementation is treating model layoutChange the same way as modelReset, which causes problems when using ListView on top of a QSortFilterProxyModel. The model emits layoutChanged whenever a data within sorting column change. Treating it as modelReset leads to poor performance on large models and caused UI issues, because the scrolling position is reset every time. This patch implements proper handling for layoutChanged signals by first handling all items moves and then simulating dataChange for all items. This fixes regression from Qt 5.1 introduced by Change I16b859d9 Task-number: QTBUG-37983 Task-number: QTBUG-34391 Change-Id: I6d3873b7b87e7f0e8fc0c1ed5dc80c6f8fdf6c22 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Michael Zanetti <michael.zanetti@canonical.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/qml/types/qqmldelegatemodel_p_p.h')
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 7da089c9b8..d64f641a1b 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -331,6 +331,8 @@ public:
};
QQmlDelegateModelGroup *m_groups[Compositor::MaximumGroupCount];
};
+
+ QList<QPersistentModelIndex> m_storedPersistentIndexes;
};
class QQmlPartsModel : public QQmlInstanceModel, public QQmlDelegateModelGroupEmitter