QNdefMessage Class
QNdefMessage クラスは、NFC NDEF メッセージを提供します。詳細...
| ヘッダー: | #include <QNdefMessage> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Nfc) target_link_libraries(mytarget PRIVATE Qt6::Nfc) |
| qmake: | QT += nfc |
| 以下のように: | Qt 5.2 |
| 継承元: | QList |
パブリック関数
| QNdefMessage() | |
| QNdefMessage(const QList<QNdefRecord> &records) | |
| QNdefMessage(const QNdefRecord &record) | |
| QNdefMessage(const QNdefMessage &message) | |
| QByteArray | toByteArray() const |
(since 6.2) QNdefMessage & | operator=(QNdefMessage &&other) |
(since 6.2) QNdefMessage & | operator=(const QNdefMessage &other) |
| bool | operator==(const QNdefMessage &other) const |
静的パブリックメンバー
| QNdefMessage | fromByteArray(const QByteArray &message) |
詳細な説明
QNdefMessage は、0個以上の QNdefRecord から構成されるコレクションです。QNdefMessage はQList<QNdefRecord> を継承しているため、標準のQList 関数を使用して、メッセージ内の NDEF レコードを操作することができます。
fromByteArray() 静的関数を使用することで、NFC データ交換フォーマット(NFC Data Exchange Format)の技術仕様に準拠したバイト配列から NDEF メッセージを解析できます。逆に、toByteArray() 関数を使用することで、QNdefMessage をバイト配列に変換することもできます。
メンバ関数のドキュメント
[constexpr noexcept default] QNdefMessage::QNdefMessage()
新しい空のNDEFメッセージを作成します。
QNdefMessage::QNdefMessage(const QList<QNdefRecord> &records)
records 内のすべてのレコードを含む新しい NDEF メッセージを作成します。
[explicit] QNdefMessage::QNdefMessage(const QNdefRecord &record)
単一のレコード「record 」を含む新しいNDEFメッセージを作成します。
[noexcept default] QNdefMessage::QNdefMessage(const QNdefMessage &message)
message のコピーとなる新しい NDEF メッセージを作成します。
[static] QNdefMessage QNdefMessage::fromByteArray(const QByteArray &message)
message の内容から解析された NDEF メッセージを返します。
message パラメータは、NFCデータ交換フォーマット(NFC Data Exchange Format)の技術仕様で定義されている生のメッセージ形式として解釈されます。
解析エラーが発生した場合は、空のNDEFメッセージが返されます。
QByteArray QNdefMessage::toByteArray() const
NDEFメッセージをバイト配列として返します。
この関数の戻り値は、NFCデータ交換フォーマット(NFC Data Exchange Format)の技術仕様で定義されている形式に準拠しています。
[noexcept default, since 6.2] QNdefMessage &QNdefMessage::operator=(QNdefMessage &&other)
QList<QNdefRecord> から代入演算子を移動します。other にあるNDEFレコードのリストを、このNDEFレコードリストに移動します。
操作完了後、other は空になります。
これはオーバーロードされた関数です。
この関数は Qt 6.2 で導入されました。
[noexcept default, since 6.2] QNdefMessage &QNdefMessage::operator=(const QNdefMessage &other)
QList<QNdefRecord> から代入演算子をコピーします。NDEFレコードのリストother を、このNDEFレコードリストに代入します。
操作後、other と*this は同一になります。
これはオーバーロードされた関数です。
この関数は Qt 6.2 で導入されました。
bool QNdefMessage::operator==(const QNdefMessage &other) const
このNDEFメッセージがother と等価である場合はtrue を返し、そうでない場合はfalse を返します。
空のメッセージ(すなわち、isEmpty() はtrue を返す)は、型QNdefRecord::Empty のレコードを 1 つ含む NDEF メッセージと同等である。
© 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.