このページでは

QBluetoothAddress Class

QBluetoothAddress クラスは、Bluetooth デバイスにアドレスを割り当てます。詳細...

ヘッダー: #include <QBluetoothAddress>
CMake: find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
qmake: QT += bluetooth

パブリック関数

QBluetoothAddress()
QBluetoothAddress(const QString &address)
QBluetoothAddress(quint64 address)
QBluetoothAddress(QBluetoothAddress &&)
void clear()
bool isNull() const
QString toString() const
quint64 toUInt64() const
QBluetoothAddress &operator=(QBluetoothAddress &&)
(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)

詳細な説明

このクラスは、プラットフォームおよびプロトコルに依存しない形式で Bluetooth アドレスを保持します。

メンバ関数のドキュメント

[constexpr noexcept] QBluetoothAddress::QBluetoothAddress()

NULLのBluetoothアドレスを作成します。

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

新しいBluetoothアドレスを作成し、address を割り当てます。

address の形式は、XX:XX:XX:XX:XX:XX または XXXXXXXXXXXX のいずれかです。ここで、X は 16 進数の桁を表します。大文字と小文字は区別されません。

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

新しいBluetoothアドレスを作成し、そのアドレスにaddress を割り当てます。

[constexpr noexcept default] QBluetoothAddress::QBluetoothAddress(QBluetoothAddress &&)

QBluetoothAddress のインスタンスをMoveコンストラクタで生成します。

[noexcept] void QBluetoothAddress::clear()

Bluetoothアドレスを「00:00:00:00:00:00」に設定します。

[noexcept] bool QBluetoothAddress::isNull() const

Bluetoothアドレスがnullの場合、trueを返します。それ以外の場合はfalseを返します。

QString QBluetoothAddress::toString() const

Bluetoothアドレスを「XX:XX:XX:XX:XX:XX」という形式の文字列として返します。

[noexcept] quint64 QBluetoothAddress::toUInt64() const

このBluetoothアドレスをquint64として返します。

[noexcept default] QBluetoothAddress &QBluetoothAddress::operator=(QBluetoothAddress &&)

other をこのQBluetoothAddress インスタンスに割り当てます。

関連する非メンバー

[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)

2つのBluetoothアドレス `a ` と `b ` が等しくない場合は `true ` を返し、等しい場合は `false` を返します。

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

Bluetoothアドレス `a ` が `b` より小さい場合は true を返し、そうでない場合は false を返します。

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

2つのBluetoothアドレス「a 」と「b 」が等しい場合はtrue を返し、そうでない場合は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.