summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp')
-rw-r--r--src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp b/src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp
index 4e6995f..a401bd5 100644
--- a/src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp
+++ b/src/remoteobjects/qremoteobjectabstractitemmodeladapter.cpp
@@ -79,6 +79,7 @@ QAbstractItemModelSourceAdapter::QAbstractItemModelSourceAdapter(QAbstractItemMo
connect(m_model, &QAbstractItemModel::columnsInserted, this, &QAbstractItemModelSourceAdapter::sourceColumnsInserted);
connect(m_model, &QAbstractItemModel::rowsRemoved, this, &QAbstractItemModelSourceAdapter::sourceRowsRemoved);
connect(m_model, &QAbstractItemModel::rowsMoved, this, &QAbstractItemModelSourceAdapter::sourceRowsMoved);
+ connect(m_model, &QAbstractItemModel::layoutChanged, this, &QAbstractItemModelSourceAdapter::sourceLayoutChanged);
if (m_selectionModel)
connect(m_selectionModel, &QItemSelectionModel::currentChanged, this, &QAbstractItemModelSourceAdapter::sourceCurrentChanged);
}
@@ -248,6 +249,14 @@ void QAbstractItemModelSourceAdapter::sourceCurrentChanged(const QModelIndex & c
emit currentChanged(currentIndex, previousIndex);
}
+void QAbstractItemModelSourceAdapter::sourceLayoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint)
+{
+ IndexList indexes;
+ for (const QPersistentModelIndex &idx : parents)
+ indexes << toModelIndexList((QModelIndex)idx, m_model);
+ emit layoutChanged(indexes, hint);
+}
+
QVector<IndexValuePair> QAbstractItemModelSourceAdapter::fetchTree(const QModelIndex &parent, size_t &size, const QVector<int> &roles)
{
QVector<IndexValuePair> entries;