aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-06-23 10:53:06 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-07-18 22:12:05 +0000
commitaec42f9953954d48a11465f56b5e5ee4987f3b44 (patch)
treeada418f684da5a9d3ff2f507527b117580e6f8e8
parent7910d9d27d4f6c20734c05fcc9ae6f5237fd19d6 (diff)
Revert "QQmlAdaptorModel: support dataChanged signals from multi-column models"
No longer needed since TableView will switch to use QQmlTableInstanceModel. This reverts commit a5d2fb468cabff8dc0702c7ddcd9f5b08993b827. Change-Id: I10c6217627a77beebd99cfa5668db05bbbe4ed15 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp11
-rw-r--r--src/qml/util/qqmladaptormodel.cpp5
-rw-r--r--src/qml/util/qqmladaptormodel_p.h1
3 files changed, 2 insertions, 15 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 0d82cca001..7a128d7070 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -1680,15 +1680,8 @@ void QQmlDelegateModel::_q_rowsMoved(
void QQmlDelegateModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles)
{
Q_D(QQmlDelegateModel);
- if (begin.parent() != d->m_adaptorModel.rootIndex)
- return;
-
- int rowCount = end.row() - begin.row() + 1;
-
- for (int col = begin.column(); col <= end.column(); ++col) {
- int startIndex = d->m_adaptorModel.indexAt(begin.row(), col);
- _q_itemsChanged(startIndex, rowCount, roles);
- }
+ if (begin.parent() == d->m_adaptorModel.rootIndex)
+ _q_itemsChanged(begin.row(), end.row() - begin.row() + 1, roles);
}
bool QQmlDelegateModel::isDescendantOf(const QPersistentModelIndex& desc, const QList< QPersistentModelIndex >& parents) const
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index 24d9c14611..578d4f6a74 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -964,11 +964,6 @@ 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);
diff --git a/src/qml/util/qqmladaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h
index b834704163..c4cfc0f466 100644
--- a/src/qml/util/qqmladaptormodel_p.h
+++ b/src/qml/util/qqmladaptormodel_p.h
@@ -123,7 +123,6 @@ public:
int columnCount() const;
int rowAt(int index) const;
int columnAt(int index) const;
- int indexAt(int row, int column) const;
inline bool adaptsAim() const { return qobject_cast<QAbstractItemModel *>(object()); }
inline QAbstractItemModel *aim() { return static_cast<QAbstractItemModel *>(object()); }