From d1e7cc01969e8fb8cfc20a62a29176f417fc3507 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 29 Aug 2018 21:02:41 +0200 Subject: [PATCH] client: Don't send dataChanged() before actually changing the data The PropertyMapItem didn't set a changed property before sending the signal, so consumers synchronously reacting to dataChanged() would still access the old value. Not sure if this issue is the cause for some of the weird model behavior we tend to see at times... --- src/client/treemodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index f02f7317..f87d3367 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -316,8 +316,9 @@ bool PropertyMapItem::setData(int column, const QVariant &value, int role) if (column >= columnCount() || role != Qt::DisplayRole) return false; + setProperty(_propertyOrder[column].toLatin1(), value); emit dataChanged(column); - return setProperty(_propertyOrder[column].toLatin1(), value); + return true; } -- 2.20.1