diff options
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 11 | ||||
-rw-r--r-- | src/qml/util/qqmladaptormodel.cpp | 5 | ||||
-rw-r--r-- | src/qml/util/qqmladaptormodel_p.h | 1 |
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()); } |