Sur cette page

QBluetoothAddress Class

La classe QBluetoothAddress attribue une adresse au périphérique Bluetooth. Plus d'informations...

En-tête : #include <QBluetoothAddress>
CMake : find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
qmake : QT += bluetooth

Fonctions publiques

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)

Description détaillée

Cette classe contient une adresse Bluetooth indépendamment de la plate-forme et du protocole.

Documentation des fonctions membres

[constexpr noexcept] QBluetoothAddress::QBluetoothAddress()

Construit une adresse Bluetooth nulle.

[explicit] QBluetoothAddress::QBluetoothAddress(const QString &address)

Construit une nouvelle adresse Bluetooth et lui attribue address.

Le format de address peut être XX:XX:XX:XX:XX:XX ou XXXXXXXXXX, où X est un chiffre hexadécimal. La casse n'est pas importante.

[explicit constexpr noexcept] QBluetoothAddress::QBluetoothAddress(quint64 address)

Construit une nouvelle adresse Bluetooth et lui attribue address.

[noexcept] void QBluetoothAddress::clear()

Définit l'adresse Bluetooth à 00:00:00:00:00:00.

[noexcept] bool QBluetoothAddress::isNull() const

Retourne vrai si l'adresse Bluetooth est nulle, sinon retourne faux.

QString QBluetoothAddress::toString() const

Renvoie l'adresse Bluetooth sous la forme d'une chaîne de caractères de la forme XX:XX:XX:XX:XX:XX:XX.

[noexcept] quint64 QBluetoothAddress::toUInt64() const

Renvoie cette adresse Bluetooth sous la forme d'un quint64.

Non-membres apparentés

[noexcept, since 6.6] size_t qHash(const QBluetoothAddress &key, size_t seed = 0)

Renvoie la valeur de hachage de key, en utilisant seed comme base de calcul.

Cette fonction a été introduite dans Qt 6.6.

bool operator!=(const QBluetoothAddress &a, const QBluetoothAddress &b)

Renvoie true si les deux adresses Bluetooth a et b ne sont pas égales, sinon renvoie false.

bool operator<(const QBluetoothAddress &a, const QBluetoothAddress &b)

Retourne vrai si l'adresse Bluetooth a est inférieure à b, sinon retourne faux.

bool operator==(const QBluetoothAddress &a, const QBluetoothAddress &b)

Renvoie true si les deux adresses Bluetooth a et b sont égales, sinon renvoie false.

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