diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-04-12 13:02:30 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-04-12 13:23:43 +0000 |
commit | a5d2fb468cabff8dc0702c7ddcd9f5b08993b827 (patch) | |
tree | 6431dc92b0be786dabfc420f9cbbadeb746dfcc9 /src/qml/util/qqmladaptormodel.cpp | |
parent | b17576fe8f805d674e8ce66b22f19fe0cda1a182 (diff) |
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 <jpnurmi@qt.io>
Diffstat (limited to 'src/qml/util/qqmladaptormodel.cpp')
-rw-r--r-- | src/qml/util/qqmladaptormodel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |