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. How to use serial port in qt 6.2?
QtWS25 Last Chance

How to use serial port in qt 6.2?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 967 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.
  • e.ferroE Offline
    e.ferroE Offline
    e.ferro
    wrote on last edited by
    #1

    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
    0
    • Christian EhrlicherC Christian Ehrlicher

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

      B Offline
      B Offline
      bee65
      wrote on last edited by
      #3

      @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.ferroE 1 Reply Last reply
      4
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        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
        0
        • Christian EhrlicherC Christian Ehrlicher

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

          B Offline
          B Offline
          bee65
          wrote on last edited by
          #3

          @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.ferroE 1 Reply Last reply
          4
          • B bee65

            @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.ferroE Offline
            e.ferroE Offline
            e.ferro
            wrote on last edited by
            #4

            @bee65 Yeah solve the problem. Thank you!

            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