Don't set missing model item values to default value from JSON object.
This commit is contained in:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user