Moving window blocks Qt SerialPort data reception
-
I am currently developing a Qt application (version 5.15.2) on Windows that has a window and a serial port module.
My problem is that when I grab the window or move it, the reception of the QSerialPort module (with the readyRead() signal) is not called. The reception only starts again when I stop acting on the window.
It seems that this is a known problem: https://bugreports.qt.io/browse/QTBUG-34946
However, I am currently in version 5.15.2. Where do you think the problem can come from and what could be the solution?
-
There was a bug in the Qt event loop dispatcher on Windows. AFAIK, This behaviour same and with
QTimer
,QLocalSoket
,QProcess
... At least up to Qt 6.x.In Qt6 the
QSerialPort
reverted to use theWindows IOCP
feature (as before in previous Qt versions up to 5.12 or something like that).AFAIK, there are was submitted a fixes into Qt (or from 5.15, or from 6.x) to fix the Qt event dispatcher e.g. for the
QWinEventNotifier
, which can be used insideQSerialPort
. But nobody portedQSerialPort
to this fixedQWinEventNotifier
, just reverted to theQWinOverlappedIONotifier
(in Qt 6.x) which was removed from Qt at all, and which stored as a copy inQSerialPort
repo (which based onWindows IOCP
feature and works in a separate thread).A best solution is to move the
QSerialPort
instance to the separate thread, usingmoveToThread()
function. ;)PS: Also, AFAIK, there are no
QSerialPort
maintainers anymore, nobody cares aboutQSerialPort
. -
There was a bug in the Qt event loop dispatcher on Windows. AFAIK, This behaviour same and with
QTimer
,QLocalSoket
,QProcess
... At least up to Qt 6.x.In Qt6 the
QSerialPort
reverted to use theWindows IOCP
feature (as before in previous Qt versions up to 5.12 or something like that).AFAIK, there are was submitted a fixes into Qt (or from 5.15, or from 6.x) to fix the Qt event dispatcher e.g. for the
QWinEventNotifier
, which can be used insideQSerialPort
. But nobody portedQSerialPort
to this fixedQWinEventNotifier
, just reverted to theQWinOverlappedIONotifier
(in Qt 6.x) which was removed from Qt at all, and which stored as a copy inQSerialPort
repo (which based onWindows IOCP
feature and works in a separate thread).A best solution is to move the
QSerialPort
instance to the separate thread, usingmoveToThread()
function. ;)PS: Also, AFAIK, there are no
QSerialPort
maintainers anymore, nobody cares aboutQSerialPort
.@kuzulis said in Moving window blocks Qt SerialPort data reception:
PS: Also, AFAIK, there are no QSerialPort maintainers anymore, nobody cares about QSerialPort
Thats frightening! I and therefor the company I work for heavily rely on QSerialPort!
I hope there are no plans to drop it all together. -
@kuzulis said in Moving window blocks Qt SerialPort data reception:
PS: Also, AFAIK, there are no QSerialPort maintainers anymore, nobody cares about QSerialPort
Thats frightening! I and therefor the company I work for heavily rely on QSerialPort!
I hope there are no plans to drop it all together.@J-Hilk said in Moving window blocks Qt SerialPort data reception:
Thats frightening!
It was run by open source devs so what do you expect when TQtC treats open source as third-party citizens?
-
@J-Hilk said in Moving window blocks Qt SerialPort data reception:
Thats frightening!
It was run by open source devs so what do you expect when TQtC treats open source as third-party citizens?
@Christian-Ehrlicher spend all that stock market money and hire someone?
-
@Christian-Ehrlicher spend all that stock market money and hire someone?
@J-Hilk said in Moving window blocks Qt SerialPort data reception:
spend all that stock market money and hire someone?
Not until it really does not work anymore. As you can see with QtWidgets - they were ignored for a long time and it got worse and worse. Now it was worse enough and QtWidget got a Co-Maintainer.
So I would guess there will be a new maintainer for QtSerialPort in three or four years :/ -
There was a bug in the Qt event loop dispatcher on Windows. AFAIK, This behaviour same and with
QTimer
,QLocalSoket
,QProcess
... At least up to Qt 6.x.In Qt6 the
QSerialPort
reverted to use theWindows IOCP
feature (as before in previous Qt versions up to 5.12 or something like that).AFAIK, there are was submitted a fixes into Qt (or from 5.15, or from 6.x) to fix the Qt event dispatcher e.g. for the
QWinEventNotifier
, which can be used insideQSerialPort
. But nobody portedQSerialPort
to this fixedQWinEventNotifier
, just reverted to theQWinOverlappedIONotifier
(in Qt 6.x) which was removed from Qt at all, and which stored as a copy inQSerialPort
repo (which based onWindows IOCP
feature and works in a separate thread).A best solution is to move the
QSerialPort
instance to the separate thread, usingmoveToThread()
function. ;)PS: Also, AFAIK, there are no
QSerialPort
maintainers anymore, nobody cares aboutQSerialPort
.@kuzulis Hi. My apologies for reviving an old thread, but what did mean when you said this?
A best solution is to move the QSerialPort instance to the separate thread, using moveToThread() function. ;)
When you said separate thread, what do you mean? Is this to create a new thread specifically for the QSerialPort?
To mods: I will repost this into a new question if any mods ask me to.
-
D Dummie1138 referenced this topic on