Commit f6146632 authored by Leandro Melo's avatar Leandro Melo
Browse files

Snippets: Correct top-left/bottom-right when emiting dataChanged

parent 1175705b
...@@ -239,7 +239,10 @@ void SnippetsTableModel::replaceSnippet(const Snippet &snippet, const QModelInde ...@@ -239,7 +239,10 @@ void SnippetsTableModel::replaceSnippet(const Snippet &snippet, const QModelInde
m_collection->computeReplacementHint(row, snippet); m_collection->computeReplacementHint(row, snippet);
if (modelIndex.row() == hint.index()) { if (modelIndex.row() == hint.index()) {
m_collection->replaceSnippet(row, snippet, hint); m_collection->replaceSnippet(row, snippet, hint);
emit dataChanged(modelIndex, modelIndex); if (modelIndex.column() == 0)
emit dataChanged(modelIndex, modelIndex.sibling(row, 1));
else
emit dataChanged(modelIndex.sibling(row, 0), modelIndex);
} else { } else {
if (row < hint.index()) if (row < hint.index())
// Rows will be moved down. // Rows will be moved down.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment