QNdefMessage Class

The QNdefMessage class provides an NFC NDEF message. More...

Header: #include <QNdefMessage>
qmake: QT += nfc
Since: Qt 5.2
Inherits: QList

This class was introduced in Qt 5.2.

Public Functions

QNdefMessage(const QList<QNdefRecord> &records)
QNdefMessage(const QNdefMessage &message)
QNdefMessage(const QNdefRecord &record)
QNdefMessage()
QByteArray toByteArray() const
bool operator==(const QNdefMessage &other) const
  • 80 public functions inherited from QList

Static Public Members

QNdefMessage fromByteArray(const QByteArray &message)
  • 3 static public members inherited from QList
uint qHash(const QMimeType &key, uint seed)
uint qHash(const QUuid &uuid, uint seed)
uint qHash(const QUrlQuery &key, uint seed)
uint qHash(const QRegularExpression &key, uint seed)
uint qHash(const QLocale &key, uint seed)
uint qHash(const QPersistentModelIndex &index, uint seed)
uint qHash(const QRegExp &key, uint seed)
uint qHash(const QList<T> &key, uint seed)
uint qHash(const QSet<T> &key, uint seed)
uint qHash(const QMultiHash<Key, T> &key, uint seed)
uint qHash(const QHash<Key, T> &key, uint seed)
uint qHash(const QDateTime &key, uint seed)
uint qHash(const QDate &key, uint seed)
uint qHash(const QTime &key, uint seed)
uint qHash(const QVersionNumber &key, uint seed)
bool operator<(const QVersionNumber &lhs, const QVersionNumber &rhs)
bool operator<(QDeadlineTimer d1, QDeadlineTimer d2)
bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2)
bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
bool operator<(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
bool operator<(const QList<T> &lhs, const QList<T> &rhs)
bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs)
bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2)
bool operator<=(const QUuid &lhs, const QUuid &rhs)
bool operator<=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
bool operator<=(const QList<T> &lhs, const QList<T> &rhs)
bool operator>(const QVersionNumber &lhs, const QVersionNumber &rhs)
bool operator>(QDeadlineTimer d1, QDeadlineTimer d2)
bool operator>(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
bool operator>(const QList<T> &lhs, const QList<T> &rhs)
bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs)
bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2)
bool operator>=(const QUuid &lhs, const QUuid &rhs)
bool operator>=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
bool operator>=(const QList<T> &lhs, const QList<T> &rhs)
QDataStream &operator>>(QDataStream &stream, QRectF &rectangle)
QDataStream &operator>>(QDataStream &stream, QRect &rectangle)
QDataStream &operator>>(QDataStream &stream, QSizeF &size)
QDataStream &operator>>(QDataStream &stream, QSize &size)
QDataStream &operator>>(QDataStream &stream, QMarginsF &m)
QDataStream &operator>>(QDataStream &stream, QMargins &m)
QDataStream &operator>>(QDataStream &s, QUuid &id)
QDataStream &operator>>(QDataStream &in, QUrl &url)
QDataStream &operator>>(QDataStream &in, QDateTime &dateTime)
QDataStream &operator>>(QDataStream &in, QTime &time)
QDataStream &operator>>(QDataStream &in, QDate &date)
QDataStream &operator>>(QDataStream &in, QBitArray &ba)
QDataStream &operator>>(QDataStream &in, QList<T> &list)
QDataStream &operator>>(QDataStream &in, QLinkedList<T> &list)
QDataStream &operator>>(QDataStream &in, QRegularExpression &re)
QDataStream &operator>>(QDataStream &in, QRegExp &regExp)
QDataStream &operator>>(QDataStream &in, QVector<T> &vector)
QDataStream &operator>>(QDataStream &in, QHash<Key, T> &hash)
QDataStream &operator>>(QDataStream &stream, QPointF &point)
QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
QDataStream &operator>>(QDataStream &in, QVersionNumber &version)
QDataStream &operator>>(QDataStream &stream, QLine &line)
QDataStream &operator>>(QDataStream &stream, QLineF &line)

Detailed Description

A QNdefMessage is a collection of 0 or more QNdefRecords. QNdefMessage inherits from QList<QNdefRecord> and therefore the standard QList functions can be used to manipulate the NDEF records in the message.

NDEF messages can be parsed from a byte array conforming to the NFC Data Exchange Format technical specification by using the fromByteArray() static function. Conversely QNdefMessages can be converted into a byte array with the toByteArray() function.

Member Function Documentation

QNdefMessage::QNdefMessage(const QList<QNdefRecord> &records)

Constructs a new NDEF message that contains all of the records in records.

QNdefMessage::QNdefMessage(const QNdefMessage &message)

Constructs a new NDEF message that is a copy of message.

QNdefMessage::QNdefMessage(const QNdefRecord &record)

Constructs a new NDEF message containing a single record record.

QNdefMessage::QNdefMessage()

Constructs a new empty NDEF message.

[static] QNdefMessage QNdefMessage::fromByteArray(const QByteArray &message)

Returns an NDEF message parsed from the contents of message.

The message parameter is interpreted as the raw message format defined in the NFC Data Exchange Format technical specification.

If a parse error occurs an empty NDEF message is returned.

QByteArray QNdefMessage::toByteArray() const

Returns the NDEF message as a byte array.

The return value of this function conforms to the format defined in the NFC Data Exchange Format technical specification.

bool QNdefMessage::operator==(const QNdefMessage &other) const

Returns true if this NDEF message is equivalent to other; otherwise returns false.

An empty message (i.e. isEmpty() returns true) is equivalent to a NDEF message containing a single record of type QNdefRecord::Empty.