From a8ed7673fc970616f457a4dc11c0579ab50081c3 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 29 Mar 2017 10:06:12 +0200 Subject: Emit dataChanged without roles --- common/modelresult.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/modelresult.cpp b/common/modelresult.cpp index 26d4f82..b12216b 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp @@ -69,7 +69,7 @@ ModelResult::ModelResult(const Sink::Query &query, const QList::ModelResult(const Sink::Query &query, const QList changedRoles; if (oldStatus != newStatus) { + SinkTraceCtx(mLogCtx) << "Status changed for entity:" << newStatus << ", id: " << id; mEntityStatus.insert(id, newStatus); changedRoles << StatusRole; } @@ -124,7 +125,9 @@ ModelResult::ModelResult(const Sink::Query &query, const QList::data(const QModelIndex &index, int role) const return childrenFetched(index); } if (role == StatusRole) { - return mEntityStatus.value(index.internalId()); + auto it = mEntityStatus.constFind(index.internalId()); + if (it != mEntityStatus.constEnd()) { + return *it; + } + return {}; } if (role == Qt::DisplayRole && index.isValid()) { if (index.column() < mPropertyColumns.size()) { -- cgit v1.2.3