本页内容

Qt Bluetooth C++ Classes

支持蓝牙的基本操作,例如扫描设备和连接设备。更多...

命名空间

QBluetooth

与蓝牙相关的类和函数

类

QBluetoothAddress

为蓝牙设备分配地址

QBluetoothDeviceDiscoveryAgent

发现附近的蓝牙设备

QBluetoothDeviceInfo

存储蓝牙设备的相关信息

QBluetoothHostInfo

封装本地 QBluetooth 设备的详细信息

QBluetoothLocalDevice

启用对本地蓝牙设备的访问

QBluetoothServer

使用 RFCOMM 或 L2cap 协议与蓝牙设备通信

QBluetoothServiceDiscoveryAgent

允许您查询蓝牙服务

QBluetoothServiceInfo

支持访问蓝牙服务的属性

QBluetoothServiceInfo::Alternative

存储蓝牙数据元素替代方案的属性

QBluetoothServiceInfo::Sequence

存储蓝牙数据元素序列的属性

QBluetoothSocket

支持连接到正在运行蓝牙服务器的蓝牙设备

QBluetoothUuid

为每个蓝牙服务生成一个 UUID

QLowEnergyAdvertisingData

表示在蓝牙低功耗(BLE)广告期间要广播的数据

QLowEnergyAdvertisingParameters

表示用于蓝牙低功耗广告的参数

QLowEnergyAdvertisingParameters::AddressInfo

QLowEnergyAdvertisingParameters::AddressInfo 定义了白名单的元素

QLowEnergyCharacteristic

存储有关蓝牙低功耗服务特征的信息

QLowEnergyCharacteristicData

用于配置 GATT 服务数据

QLowEnergyConnectionParameters

用于请求或报告蓝牙低功耗连接参数的更新

QLowEnergyController

访问蓝牙低功耗设备

QLowEnergyDescriptor

存储有关蓝牙低功耗描述符的信息

QLowEnergyDescriptorData

用于创建 GATT 服务数据

QLowEnergyService

代表蓝牙低功耗设备上的单个服务

QLowEnergyServiceData

用于配置 GATT 服务数据

详细说明

该 Qt Bluetooth C++ API 使应用程序能够以更灵活的方式扫描设备,并与之建立连接并进行交互。

要在应用程序中使用 C++ 库,请在.pro 文件中添加以下配置选项:

QT += bluetooth

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