QBluetoothAddress Class
QBluetoothAddress 类为蓝牙设备分配地址。更多
Header: | #include <QBluetoothAddress> |
qmake: | QT += bluetooth |
公共函数
QBluetoothAddress() | |
QBluetoothAddress(const QString &address) | |
QBluetoothAddress(quint64 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]
QBluetoothAddress::QBluetoothAddress(const QString &address)
构建一个新的蓝牙地址并为其分配address 。
address 的格式可以是 XX:XX:XX:XX:XX:XX 或 XXXXXXXXXX,其中 X 是十六进制数字。大小写并不重要。
[explicit constexpr noexcept]
QBluetoothAddress::QBluetoothAddress(quint64 address)
构建新的蓝牙地址,并为其分配address 。
[noexcept]
void QBluetoothAddress::clear()
将蓝牙地址设置为 00: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)
返回key 的哈希值,使用seed 作为计算的种子。
此函数在 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
。
© 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.