Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved How to use serial port in qt 6.2?

    General and Desktop
    3
    4
    349
    Loading More Posts
    • 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.
    • e.ferro
      e.ferro last edited by

      I'm learning to use Qt. I'm using Qt 6.2 to make an application with Arduino.

      I made the include

      #include <QSerialPort>

      and

      QT += serialport

      But I didn't understand that part.

      find_package(Qt6 COMPONENTS SerialPort REQUIRED)
      target_link_libraries(mytarget PRIVATE Qt6::SerialPort)

      When I try to compile, I get an error that it can't be found.

      QSerialPort not found

      1 Reply Last reply Reply Quote 0
      • B
        bee65 @Christian Ehrlicher last edited by

        @Christian-Ehrlicher QSerialPort was not in 6.0 but it is in 6.2
        https://doc.qt.io/qt-6.2/whatsnew62.html
        If you are installing with the MaintenanceTool, Qt Serial Port is an optional component under "Additional Libraries"

        e.ferro 1 Reply Last reply Reply Quote 4
        • Christian Ehrlicher
          Christian Ehrlicher Lifetime Qt Champion last edited by

          Because Qt6.2 has no QtSerialPort yet - use Qt6.3: https://forum.qt.io/topic/122548/serial-port-for-qt-6

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

          B 1 Reply Last reply Reply Quote 0
          • B
            bee65 @Christian Ehrlicher last edited by

            @Christian-Ehrlicher QSerialPort was not in 6.0 but it is in 6.2
            https://doc.qt.io/qt-6.2/whatsnew62.html
            If you are installing with the MaintenanceTool, Qt Serial Port is an optional component under "Additional Libraries"

            e.ferro 1 Reply Last reply Reply Quote 4
            • e.ferro
              e.ferro @bee65 last edited by

              @bee65 Yeah solve the problem. Thank you!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post