OSDN Git Service

Snippets: Correct top-left/bottom-right when emiting dataChanged
authorLeandro Melo <leandro.melo@nokia.com>
Thu, 2 Dec 2010 16:15:35 +0000 (17:15 +0100)
committerLeandro Melo <leandro.melo@nokia.com>
Wed, 8 Dec 2010 16:22:13 +0000 (17:22 +0100)
src/plugins/texteditor/snippets/snippetssettingspage.cpp

index b9beef0..1e51b61 100644 (file)
@@ -239,7 +239,10 @@ void SnippetsTableModel::replaceSnippet(const Snippet &snippet, const QModelInde
         m_collection->computeReplacementHint(row, snippet);
     if (modelIndex.row() == hint.index()) {
         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 {
         if (row < hint.index())
             // Rows will be moved down.