本页内容

Qt Serial Port C++ Classes

支持访问串口功能的 C++ 类列表。更多内容...

类

QSerialPort

提供用于访问串口的函数

QSerialPortInfo

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

详细说明

要在您的应用程序中使用QSerialPort ,请添加以下包含语句:

#include <QSerialPort>

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

#include <QSerialPortInfo>

若要通过 cmake 使用该模块,请使用 `find_package() ` 命令在 `Qt6 ` 包中定位所需的模块组件:

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

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

QT += serialport

© 2026 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.