summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Gonzalez <gzmorell@gmail.com>2013-04-27 17:13:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-24 19:26:27 +0200
commit51773f349891c922cb5401637e01336a42edecc4 (patch)
tree7b18e295e1d48b00dcea6a739d584c67e8028fb6
parentee63017850dbcc24ca25ec2b6f6aff1594abf1b3 (diff)
downloadqtserialport-51773f349891c922cb5401637e01336a42edecc4.tar.gz
Catch only the WinEventAct for the event notifier for process completion
This is necessary to filter out events like ThreadChange. The documentation writes "The object is moved to another thread. This is the last event sent to this object in the previous thread.". See the following url for details: http://qt-project.org/doc/qt-5.0/qtcore/qevent.html#Type-enum Change-Id: I091a4c1fe7f64337835e8ee1492c47cc73322fdc Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--src/serialport/qserialport_win.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index c3261a2..e1e9152 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -43,6 +43,8 @@
#include "qserialport_win_p.h"
+#include <QtCore/qcoreevent.h>
+
#ifndef Q_OS_WINCE
#include <QtCore/qelapsedtimer.h>
#include <QtCore/qvector.h>
@@ -116,7 +118,8 @@ public:
protected:
bool event(QEvent *e) Q_DECL_OVERRIDE {
const bool ret = QWinEventNotifier::event(e);
- processCompletionRoutine();
+ if (e->type() == QEvent::WinEventAct)
+ processCompletionRoutine();
return ret;
}