Qt Serial Port C++ Classes

可访问串行端口的 C++ 类列表。更多

QSerialPort

提供访问串行端口的函数

QSerialPortInfo

提供有关现有串行端口的信息

详细说明

要在应用程序中使用QSerialPort ,请添加以下 include 语句:

#include <QSerialPort>

对于QSerialPortInfo ,请使用以下 include 语句:

#include <QSerialPortInfo>

要在 cmake 中使用该模块,请使用find_package() 命令在Qt6 包中找到所需的模块组件:

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

要在 qmake 中使用该模块,请在项目的 .pro 文件中添加该模块作为QT 变量的值:

QT += serialport

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.