summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2021-07-19 12:46:49 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-20 11:41:48 +0000
commit9e69d0697420409d671bcaf41efa443688b9b5d6 (patch)
tree9d38716172dea2b063b7e4007eeda5db88681f48
parent83c46bbaa86a0dfb26ada19d1cd24b1424d07556 (diff)
Peak/VectorCAN: Fix reading incoming frames on Windows
Overriding QWinEventNotifier::event seems unusual, so let's use the documented way and connect to the activated signal. As this was broken after 5.15 and 6.2 is the first Qt 6 release, no changelog is needed. Fixes: QTBUG-95040 Change-Id: I294aa398a2ccd99012db855ed74935a944b2e6d2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 117e99dffd800780e3f29f5d88c1cb171739ad50) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/canbus/peakcan/peakcanbackend.cpp10
-rw-r--r--src/plugins/canbus/vectorcan/vectorcanbackend.cpp10
2 files changed, 4 insertions, 16 deletions
diff --git a/src/plugins/canbus/peakcan/peakcanbackend.cpp b/src/plugins/canbus/peakcan/peakcanbackend.cpp
index 45d8023..22bcf36 100644
--- a/src/plugins/canbus/peakcan/peakcanbackend.cpp
+++ b/src/plugins/canbus/peakcan/peakcanbackend.cpp
@@ -239,16 +239,10 @@ public:
, dptr(d)
{
setHandle(dptr->readHandle);
- }
-protected:
- bool event(QEvent *e) override
- {
- if (e->type() == QEvent::WinEventAct) {
+ connect(this, &QWinEventNotifier::activated, this, [this]() {
dptr->startRead();
- return true;
- }
- return QWinEventNotifier::event(e);
+ });
}
private:
diff --git a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp
index f2ee0af..f4b9817 100644
--- a/src/plugins/canbus/vectorcan/vectorcanbackend.cpp
+++ b/src/plugins/canbus/vectorcan/vectorcanbackend.cpp
@@ -112,16 +112,10 @@ public:
, dptr(d)
{
setHandle(dptr->readHandle);
- }
-protected:
- bool event(QEvent *e) override
- {
- if (e->type() == QEvent::WinEventAct) {
+ connect(this, &QWinEventNotifier::activated, this, [this]() {
dptr->startRead();
- return true;
- }
- return QWinEventNotifier::event(e);
+ });
}
private: