Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Moving window blocks Qt SerialPort data reception
QtWS25 Last Chance

Moving window blocks Qt SerialPort data reception

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 739 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mdenion
    wrote on 4 Mar 2022, 08:36 last edited by mdenion 3 Apr 2022, 10:08
    #1

    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?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on 4 Mar 2022, 09:53 last edited by kuzulis 3 Apr 2022, 09:58
      #2

      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 the Windows 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 inside QSerialPort. But nobody ported QSerialPort to this fixed QWinEventNotifier, just reverted to the QWinOverlappedIONotifier (in Qt 6.x) which was removed from Qt at all, and which stored as a copy in QSerialPort repo (which based on Windows IOCP feature and works in a separate thread).

      A best solution is to move the QSerialPort instance to the separate thread, using moveToThread() function. ;)

      PS: Also, AFAIK, there are no QSerialPort maintainers anymore, nobody cares about QSerialPort.

      J D 2 Replies Last reply 4 Mar 2022, 10:13
      3
      • K kuzulis
        4 Mar 2022, 09:53

        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 the Windows 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 inside QSerialPort. But nobody ported QSerialPort to this fixed QWinEventNotifier, just reverted to the QWinOverlappedIONotifier (in Qt 6.x) which was removed from Qt at all, and which stored as a copy in QSerialPort repo (which based on Windows IOCP feature and works in a separate thread).

        A best solution is to move the QSerialPort instance to the separate thread, using moveToThread() function. ;)

        PS: Also, AFAIK, there are no QSerialPort maintainers anymore, nobody cares about QSerialPort.

        J Offline
        J Offline
        J.Hilk
        Moderators
        wrote on 4 Mar 2022, 10:13 last edited by
        #3

        @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.


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        C 1 Reply Last reply 4 Mar 2022, 11:59
        0
        • J J.Hilk
          4 Mar 2022, 10:13

          @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.

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 4 Mar 2022, 11:59 last edited by
          #4

          @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?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          J 1 Reply Last reply 4 Mar 2022, 12:01
          0
          • C Christian Ehrlicher
            4 Mar 2022, 11:59

            @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 Offline
            J Offline
            J.Hilk
            Moderators
            wrote on 4 Mar 2022, 12:01 last edited by
            #5

            @Christian-Ehrlicher spend all that stock market money and hire someone?


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            C 1 Reply Last reply 4 Mar 2022, 12:06
            0
            • J J.Hilk
              4 Mar 2022, 12:01

              @Christian-Ehrlicher spend all that stock market money and hire someone?

              C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 4 Mar 2022, 12:06 last edited by
              #6

              @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 :/

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • K kuzulis
                4 Mar 2022, 09:53

                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 the Windows 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 inside QSerialPort. But nobody ported QSerialPort to this fixed QWinEventNotifier, just reverted to the QWinOverlappedIONotifier (in Qt 6.x) which was removed from Qt at all, and which stored as a copy in QSerialPort repo (which based on Windows IOCP feature and works in a separate thread).

                A best solution is to move the QSerialPort instance to the separate thread, using moveToThread() function. ;)

                PS: Also, AFAIK, there are no QSerialPort maintainers anymore, nobody cares about QSerialPort.

                D Offline
                D Offline
                Dummie1138
                wrote on 11 Apr 2023, 08:36 last edited by
                #7

                @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.

                1 Reply Last reply
                0
                • D Dummie1138 referenced this topic on 10 May 2023, 08:23

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved