From a5d2fb468cabff8dc0702c7ddcd9f5b08993b827 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 12 Apr 2018 13:02:30 +0200 Subject: QQmlAdaptorModel: support dataChanged signals from multi-column models When receiving a signal that model items have changed, the current implementation assumed that the underlying QAIM only had one column. This patch will check how many columns actually changed, and make sure we call itemsChanged for them all. Change-Id: I05f301dee604f2675ec7e89dfbca28b6f956d483 Reviewed-by: J-P Nurmi --- src/qml/util/qqmladaptormodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qml/util/qqmladaptormodel.cpp') diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp index 1cc347d6bc..f754e0e1a5 100644 --- a/src/qml/util/qqmladaptormodel.cpp +++ b/src/qml/util/qqmladaptormodel.cpp @@ -1034,6 +1034,11 @@ int QQmlAdaptorModel::columnAt(int index) const return count <= 0 ? -1 : index / count; } +int QQmlAdaptorModel::indexAt(int row, int column) const +{ + return row + (column * rowCount()); +} + void QQmlAdaptorModel::objectDestroyed(QObject *) { setModel(QVariant(), nullptr, nullptr); -- cgit v1.2.3