From f51b26355da415c41ba39b76e833a04448a14ce7 Mon Sep 17 00:00:00 2001 From: VRonin Date: Thu, 4 Nov 2021 09:39:32 +0000 Subject: [PATCH] Fixed Qt6-only bug when no data is set in the proxy --- src/rolemaskproxymodel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rolemaskproxymodel.cpp b/src/rolemaskproxymodel.cpp index 8db3ee7..eb16ad4 100644 --- a/src/rolemaskproxymodel.cpp +++ b/src/rolemaskproxymodel.cpp @@ -778,7 +778,10 @@ void RoleMaskProxyModel::multiData(const QModelIndex &index, QModelRoleDataSpan Q_D(const RoleMaskProxyModel); const QModelIndex sourceIndex = mapToSource(index); sourceModel()->multiData(sourceIndex, roleDataSpan); + const FlaggedRolesContainer emptyData; const FlaggedRolesContainer *idxData = d->dataForIndex(sourceIndex); + if (!idxData) + idxData = &emptyData; for (QModelRoleData &roleData : roleDataSpan) { int role = roleData.role(); if (d->m_mergeDisplayEdit && role == Qt::EditRole)