diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index 8ca19f7e96..bdbc5e0c45 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -77,7 +77,11 @@ bool CSMWorld::IdTable::setData (const QModelIndex &index, const QVariant &value { mIdCollection->setData (index.row(), index.column(), value); - emit dataChanged (index, index); + // Modifying a value can also change the Modified status of a record. + // To track this, we inform about the change of a whole row. + QModelIndex rowStart = this->index(index.row(), 0); + QModelIndex rowEnd = this->index(index.row(), columnCount(index.parent()) - 1); + emit dataChanged(rowStart, rowEnd); return true; } diff --git a/apps/opencs/model/world/idtree.cpp b/apps/opencs/model/world/idtree.cpp index 5a7d10c6ec..0b027cdab6 100644 --- a/apps/opencs/model/world/idtree.cpp +++ b/apps/opencs/model/world/idtree.cpp @@ -96,7 +96,13 @@ bool CSMWorld::IdTree::setData (const QModelIndex &index, const QVariant &value, mNestedCollection->setNestedData(parentAddress.first, parentAddress.second, value, index.row(), index.column()); - emit dataChanged (index, index); + emit dataChanged(index, index); + + // Modifying a value can also change the Modified status of a record (located in the parent row). + // To track this, we inform about the change of a whole parent row. + QModelIndex parentRowStart = this->index(index.parent().row(), 0); + QModelIndex parentRowEnd = this->index(index.parent().row(), columnCount(index.parent()) - 1); + emit dataChanged(parentRowStart, parentRowEnd); return true; }