QBluetoothAddress 类
QBluetoothAddress 类用于为蓝牙设备分配地址。更多信息...
| 头文件 | #include <QBluetoothAddress> | 
| qmake | QT += bluetooth | 
公共函数
| QBluetoothAddress() | |
| QBluetoothAddress(quint64 address) | |
| QBluetoothAddress(const QString &address) | |
| void | clear() | 
| bool | isNull() const | 
| QString | toString() const | 
| quint64 | toUInt64() const | 
相关非成员
| (since 6.6)size_t | qHash(const QBluetoothAddress &key, size_t seed = 0) | 
| bool | operator!=(const QBluetoothAddress &a, const QBluetoothAddress &b) | 
| bool | operator<(const QBluetoothAddress &a, const QBluetoothAddress &b) | 
| bool | operator==(const QBluetoothAddress &a, const QBluetoothAddress &b) | 
成员函数文档
[constexpr noexcept] QBluetoothAddress::QBluetoothAddress()
构建一个空蓝牙地址。
[explicit constexpr noexcept] QBluetoothAddress::QBluetoothAddress(quint64 address)
构建一个新的蓝牙地址并将其分配给地址。
[explicit] QBluetoothAddress::QBluetoothAddress(const QString &address)
构建一个新的蓝牙地址并将其分配给地址。
地址的格式可以是XX:XX:XX:XX:XX:XX或XXXXXXXXXX,其中X是十六进制数字。大小写不重要。
[noexcept] void QBluetoothAddress::clear()
将蓝牙地址设置为00:00:00:00:00:00。
[noexcept] bool QBluetoothAddress::isNull() const
如果蓝牙地址为空,则返回true,否则返回false。
QString QBluetoothAddress::toString() const
以"XX:XX:XX:XX:XX:XX"的形式返回蓝牙地址的字符串。
[noexcept] quint64 QBluetoothAddress::toUInt64() const
将此蓝牙地址作为quint64返回。
相关非成员
[noexcept, since 6.6] size_t qHash(const QBluetoothAddress &key, size_t seed = 0)
使用seed计算哈希值,返回key的哈希值。
此函数自Qt 6.6引入。
bool operator!=(const QBluetoothAddress &a, const QBluetoothAddress &b)
如果两个蓝牙地址a和b不相等,则返回true,否则返回false。
bool operator<(const QBluetoothAddress &a, const QBluetoothAddress &b)
如果蓝牙地址a小于b,则返回true,否则返回false。
bool operator==(const QBluetoothAddress &a, const QBluetoothAddress &b)
如果两个蓝牙地址a和b相等,则返回true,否则返回false。
© 2024 The Qt Company Ltd. 本文档中包含的贡献的文档版权属于其各自的拥有者。本文档的提供受自由软件基金会发布的GNU自由文档许可证版本1.3条款限制。Qt及其相关标志是The Qt Company Ltd.在芬兰和/或其他国家的商标。所有其他商标属于其各自的所有者。