class QNdefMessage

The QNdefMessage class provides an NFC NDEF message. More

Synopsis

Methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

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.

__init__()

Constructs a new empty NDEF message.

__init__(records)
Parameters:

records – .list of QNdefRecord

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

__init__(message)
Parameters:

messageQNdefMessage

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

__init__(record)
Parameters:

recordQNdefRecord

Constructs a new NDEF message containing a single record record.

append(arg__1)
Parameters:

arg__1QNdefRecord

append(l)
Parameters:

l – .list of QNdefRecord

at(i)
Parameters:

i – int

Return type:

QNdefRecord

back()
Return type:

QNdefRecord

capacity()
Return type:

int

clear()
constData()
Return type:

QNdefRecord

constFirst()
Return type:

QNdefRecord

constLast()
Return type:

QNdefRecord

count()
Return type:

int

data()
Return type:

QNdefRecord

empty()
Return type:

bool

first()
Return type:

QNdefRecord

first(n)
Parameters:

n – int

Return type:

.list of QNdefRecord

static fromByteArray(message)
Parameters:

messageQByteArray

Return type:

QNdefMessage

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.

static fromList(list)
Parameters:

list – .list of QNdefRecord

Return type:

.list of QNdefRecord

static fromVector(vector)
Parameters:

vector – .list of QNdefRecord

Return type:

.list of QNdefRecord

front()
Return type:

QNdefRecord

insert(arg__1, arg__2)
Parameters:
isEmpty()
Return type:

bool

isSharedWith(other)
Parameters:

other – .list of QNdefRecord

Return type:

bool

last()
Return type:

QNdefRecord

last(n)
Parameters:

n – int

Return type:

.list of QNdefRecord

length()
Return type:

int

static maxSize()
Return type:

int

max_size()
Return type:

int

mid(pos[, len=-1])
Parameters:
  • pos – int

  • len – int

Return type:

.list of QNdefRecord

move(from, to)
Parameters:
  • from – int

  • to – int

__add__(l)
Parameters:

l – .list of QNdefRecord

Return type:

.list of QNdefRecord

__iadd__(l)
Parameters:

l – .list of QNdefRecord

Return type:

.list of QNdefRecord

__lshift__(l)
Parameters:

l – .list of QNdefRecord

Return type:

.list of QNdefRecord

__eq__(other)
Parameters:

otherQNdefMessage

Return type:

bool

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

operator(i)
Parameters:

i – int

Return type:

QNdefRecord

pop_back()
pop_front()
prepend(arg__1)
Parameters:

arg__1QNdefRecord

push_back(arg__1)
Parameters:

arg__1QNdefRecord

push_front(arg__1)
Parameters:

arg__1QNdefRecord

remove(i[, n=1])
Parameters:
  • i – int

  • n – int

removeAll(arg__1)
Parameters:

arg__1QNdefRecord

removeAt(i)
Parameters:

i – int

removeFirst()
removeLast()
removeOne(arg__1)
Parameters:

arg__1QNdefRecord

reserve(size)
Parameters:

size – int

resize(size)
Parameters:

size – int

resizeForOverwrite(size)
Parameters:

size – int

shrink_to_fit()
size()
Return type:

int

sliced(pos)
Parameters:

pos – int

Return type:

.list of QNdefRecord

sliced(pos, n)
Parameters:
  • pos – int

  • n – int

Return type:

.list of QNdefRecord

squeeze()
swap(other)
Parameters:

other – .list of QNdefRecord

swapItemsAt(i, j)
Parameters:
  • i – int

  • j – int

takeAt(i)
Parameters:

i – int

Return type:

QNdefRecord

toByteArray()
Return type:

QByteArray

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.

toList()
Return type:

.list of QNdefRecord

toVector()
Return type:

.list of QNdefRecord

value(i)
Parameters:

i – int

Return type:

QNdefRecord