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. QSerialPort and thread on Ubuntu

QSerialPort and thread on Ubuntu

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.5k Views 1 Watching
  • 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.
  • N Offline
    N Offline
    nistar
    wrote on last edited by
    #1

    I need a serial port for read camera, and other serial port for write control command.
    Is it double thread?
    Now I can read camera, but can't write command to serial port (com.setTarget).
    And the error: QSocketNotifier: Can only be used with threads started with QThread.

    Code: link text

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2

      Hi. You should use events to exchange data between qthreads.

      Regards.

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      N 2 Replies Last reply
      0
      • mrdebugM mrdebug

        Hi. You should use events to exchange data between qthreads.

        Regards.

        N Offline
        N Offline
        nistar
        wrote on last edited by
        #3

        @mrdebug
        Sorry, I don't understand.
        I have to make a widgets project?
        And use 'connect' to read camera and write command?

        But I still need to open 2 serial port at the same time.
        What is the difference with my problem?

        1 Reply Last reply
        0
        • mrdebugM mrdebug

          Hi. You should use events to exchange data between qthreads.

          Regards.

          N Offline
          N Offline
          nistar
          wrote on last edited by
          #4

          @mrdebug
          O, I do it.
          Only make a application project, and copy the code.

          Thanks

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Unless you do some heavy stuff with your serial port, there's no need for threads, you can open several ports at the same time without any problem.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

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