OSDN Git Service

Snippets: Do not update content on window deactivation
authorLeandro Melo <leandro.melo@nokia.com>
Mon, 22 Nov 2010 14:09:27 +0000 (15:09 +0100)
committerLeandro Melo <leandro.melo@nokia.com>
Wed, 8 Dec 2010 16:22:10 +0000 (17:22 +0100)
src/plugins/texteditor/snippets/snippeteditor.cpp

index 08a208d..96e979a 100644 (file)
@@ -34,6 +34,7 @@
 #include <texteditor/normalindenter.h>
 
 #include <QtGui/QTextDocument>
+#include <QtGui/QFocusEvent>
 
 using namespace TextEditor;
 
@@ -68,8 +69,7 @@ void SnippetEditor::setSyntaxHighlighter(TextEditor::SyntaxHighlighter *highligh
 
 void SnippetEditor::focusOutEvent(QFocusEvent *event)
 {
-    Q_UNUSED(event);
-    if (document()->isModified())
+    if (event->reason() != Qt::ActiveWindowFocusReason && document()->isModified())
         emit snippetContentChanged();
 }