Don't set missing model item values to default value from JSON object.

This commit is contained in:
2026-03-14 09:29:43 +01:00
parent 5b62f9461b
commit a9a4b39da1
2 changed files with 9 additions and 12 deletions

View File

@ -302,13 +302,6 @@ QMap<int, QVariant> TableModel::onlyChangedValues(const QModelIndex& index,
const QVariant oldValue = index.data(role);
// TODO check if role is a editable role?
if (oldValue != newValue) {
bool emptyValueIsEqualToZero = isEmptyValueEqualToZero(role);
// REFACTOR the next if statement is too complex
if (emptyValueIsEqualToZero && oldValue == QVariant() && newValue == 0) {
qDebug() << "oldValue:" << oldValue << "& newValue:" << newValue
<< "mean the same. Ignoring...";
continue;
}
qDebug() << "oldValue:" << oldValue << "!= newValue:" << newValue;
result.insert(role, newValue);
} else {