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 레코드를 조작할 수 있습니다.
NDEF 메시지는 fromByteArray() 정적 함수를 사용하여 NFC 데이터 교환 형식 기술 사양을 준수하는 바이트 배열에서 구문 분석할 수 있습니다. 반대로 QNdefMessages는 toByteArray() 함수를 사용하여 바이트 배열로 변환할 수 있습니다.
멤버 함수 문서
[constexpr noexcept]
QNdefMessage::QNdefMessage()
새 빈 NDEF 메시지를 작성합니다.
QNdefMessage::QNdefMessage(const QList<QNdefRecord> &records)
records 에 있는 모든 레코드가 포함된 새 NDEF 메시지를 작성합니다.
[explicit]
QNdefMessage::QNdefMessage(const QNdefRecord &record)
단일 레코드가 포함된 새 NDEF 메시지를 작성합니다 record.
[noexcept]
QNdefMessage::QNdefMessage(const QNdefMessage &message)
message 의 복사본인 새 NDEF 메시지를 작성합니다.
[static]
QNdefMessage QNdefMessage::fromByteArray(const QByteArray &message)
message 의 내용에서 파싱된 NDEF 메시지를 반환합니다.
message 매개변수는 NFC 데이터 교환 형식 기술 사양에 정의된 원시 메시지 형식으로 해석됩니다.
구문 분석 오류가 발생하면 빈 NDEF 메시지가 반환됩니다.
QByteArray QNdefMessage::toByteArray() const
NDEF 메시지를 바이트 배열로 반환합니다.
이 함수의 반환 값은 NFC 데이터 교환 형식 기술 사양에 정의된 형식을 준수합니다.
[noexcept, since 6.2]
QNdefMessage &QNdefMessage::operator=(QNdefMessage &&other)
과부하가 걸린 함수입니다.
QList<QNdefRecord>에서 할당 연산자를 이동합니다. other NDEF 레코드 목록을 이 NDEF 레코드 목록으로 이동합니다.
연산이 끝나면 other 은 비어 있습니다.
이 함수는 Qt 6.2에 도입되었습니다.
[noexcept, since 6.2]
QNdefMessage &QNdefMessage::operator=(const QNdefMessage &other)
과부하가 걸린 함수입니다.
QList<QNdefRecord>에서 할당 연산자를 복사합니다. other NDEF 레코드 목록을 이 NDEF 레코드 목록에 할당합니다.
연산 후 other 와 *this
은 동일합니다.
이 함수는 Qt 6.2에 도입되었습니다.
bool QNdefMessage::operator==(const QNdefMessage &other) const
이 NDEF 메시지가 other 과 같으면 true
을 반환하고, 그렇지 않으면 false
을 반환합니다.
빈 메시지(예: isEmpty()는 true
을 반환함)는 QNdefRecord::Empty 유형의 단일 레코드가 포함된 NDEF 메시지와 동일합니다.
© 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.