mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 18:53:52 +00:00
Notify views of changes of all cells in a row to properly update the row after revert
This commit is contained in:
parent
2ff9dc34a4
commit
96cf2cbd05
2 changed files with 11 additions and 2 deletions
|
@ -319,6 +319,15 @@ void CSMWorld::RevertCommand::redo()
|
|||
}
|
||||
else
|
||||
{
|
||||
// notify view that data has changed, previously only the modified column was
|
||||
// updated in the view unless the user had selected another item or forced a
|
||||
// repaint with other means
|
||||
int count = mModel.columnCount (index.parent ());
|
||||
if (count > 0)
|
||||
{
|
||||
emit mModel.dataChanged(mModel.index (index.row(), 0, index.parent ()),
|
||||
mModel.index (index.row(), count - 1, index.parent ()));
|
||||
}
|
||||
mModel.setData (index, static_cast<int> (RecordBase::State_BaseOnly));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,9 +86,9 @@ 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.
|
||||
// Modifying a value can also change the Modified status of a record unless .
|
||||
int stateColumn = searchColumnIndex(Columns::ColumnId_Modification);
|
||||
if (stateColumn != -1)
|
||||
if (stateColumn != -1 && index.column() != stateColumn)
|
||||
{
|
||||
QModelIndex stateIndex = this->index(index.row(), stateColumn);
|
||||
emit dataChanged(stateIndex, stateIndex);
|
||||
|
|
Loading…
Reference in a new issue