- class QNdefMessage#
The
QNdefMessageclass provides an NFC NDEF message. More…摘要#
方法#
def
__init__()def
append()def
at()def
back()def
capacity()def
clear()def
constData()def
constFirst()定义
constLast()定义
count()定义
data()定义
empty()定义
first()定义
front()定义
insert()定义
isEmpty()定义
last()定义
length()定义
mid()定义
move()定义
__add__()定义
__iadd__()定义
__lshift__()定义
__eq__()定义
operator[]()定义
pop_back()定义
pop_front()定义
prepend()定义
push_back()定义
push_front()定义
remove()定义
removeAll()定义
removeAt()定义
removeLast()定义
removeOne()定义
reserve()定义
resize()定义
size()定义
sliced()定义
squeeze()定义
swap()定义
takeAt()定义
toList()定义
toVector()定义
value()
静态函数#
定义
fromList()定义
fromVector()
注意
此文档可能包含从C++自动翻译到Python的代码片段。我们总是欢迎对代码片段翻译的贡献。如果您发现翻译存在问题,也可以通过在https:/bugreports.qt.io/projects/PYSIDE上创建工单来通知我们。
详细描述#
一个
QNdefMessage是一组 0 个或多个 QNdefRecords 的集合。QNdefMessage从QNdefRecord继承,因此可以使用标准的 QList 函数来操作消息中的 NDEF 记录。可以通过使用
fromByteArray()静态函数从符合 NFC 数据交换格式技术规范的字节数组中解析 NDEF 消息。相反,可以使用toByteArray()函数将 QNdefMessages 转换为字节数组。- __init__(records)#
- 参数:
records – 包含 QNdefRecord 的列表
构建一个新的 NDEF 消息,该消息包含
records中的所有记录。- __init__()
构建一个新的空 NDEF 消息。
- __init__(record)
- 参数:
record –
QNdefRecord
构建一个新的 NDEF 消息,其中包含单个
record。- __init__(message)
- 参数:
message –
QNdefMessage
构建一个新的 NDEF 消息,它是
message的副本。- append(arg__1)#
- 参数:
arg__1 –
QNdefRecord
- append(l)
- 参数:
l – 包含 QNdefRecord 的列表
- at(i)#
- 参数:
i – int
- 返回类型:
- back()#
- 返回类型:
- capacity()#
- 返回类型:
int
- clear()#
- constData()#
- 返回类型:
- constFirst()#
- 返回类型:
- constLast()#
- 返回类型:
- count()#
- 返回类型:
int
- data()#
- 返回类型:
- empty()#
- 返回类型:
bool
- first(n)#
- 参数:
n – int
- 返回类型:
QNdefRecord 列表
- first()
- 返回类型:
- static 从字节节数组中解析(message)#
- 参数:
message –
QByteArray- 返回类型:
从
message的内容解析出一个 NDEF 消息。message参数被解释为 NFC 数据交换格式技术规范中定义的原始消息格式。如果解析出错,将返回一个空的 NDEF 消息。
- static 从列表中创建(list)#
- 参数:
list – QNdefRecord 列表
- 返回类型:
QNdefRecord 列表
- static 从向量中创建(vector)#
- 参数:
vector – QNdefRecord 列表
- 返回类型:
QNdefRecord 列表
- front()#
- 返回类型:
- insert(arg__1, arg__2)#
- 参数:
arg__1 – int
arg__2 – QNdefRecord
- isEmpty()#
- 返回类型:
bool
- 参数:
other – QNdefRecord 列表
- 返回类型:
bool
- last()#
- 返回类型:
- last(n)
- 参数:
n – int
- 返回类型:
QNdefRecord 列表
- length()#
- 返回类型:
int
- mid(pos[, len=-1])#
- 参数:
pos – int
len – int
- 返回类型:
QNdefRecord 列表
- move(from, to)#
- 参数:
from – int
to – int
- __add__(l)#
- 参数:
l – 包含 QNdefRecord 的列表
- 返回类型:
QNdefRecord 列表
- __iadd__(l)#
- 参数:
l – 包含 QNdefRecord 的列表
- 返回类型:
QNdefRecord 列表
- __lshift__(l)#
- 参数:
l – 包含 QNdefRecord 的列表
- 返回类型:
QNdefRecord 列表
- __eq__(other)#
- 参数:
other –
QNdefMessage- 返回类型:
bool
如果此NDEF消息与
other等效,则返回true;否则返回false。空消息(即isEmpty()返回
true)与包含单个类型为Empty的NDEF记录的NDEF消息等效。- operator(i)#
- 参数:
i – int
- 返回类型:
- pop_back()#
- pop_front()#
- prepend(arg__1)#
- 参数:
arg__1 –
QNdefRecord
- push_back(arg__1)#
- 参数:
arg__1 –
QNdefRecord
- push_front(arg__1)#
- 参数:
arg__1 –
QNdefRecord
- remove(i[, n=1])#
- 参数:
i – int
n – int
- removeAll(arg__1)#
- 参数:
arg__1 –
QNdefRecord
- removeAt(i)#
- 参数:
i – int
- removeFirst()#
- removeLast()#
- removeOne(arg__1)#
- 参数:
arg__1 –
QNdefRecord
- reserve(size)#
- 参数:
size – int
- resize(size)#
- 参数:
size – int
- shrink_to_fit()#
- size()#
- 返回类型:
int
- sliced(pos)#
- 参数:
pos – int
- 返回类型:
QNdefRecord 列表
- sliced(pos, n)
- 参数:
pos – int
n – int
- 返回类型:
QNdefRecord 列表
- squeeze()#
- swap(other)#
- 参数:
other – QNdefRecord 列表
- swapItemsAt(i, j)#
- 参数:
i – int
j – int
- takeAt(i)#
- 参数:
i – int
- 返回类型:
- toByteArray()#
- 返回类型:
将NDEF消息作为字节数组返回。
此函数的返回值符合NFC数据交换格式技术规范中定义的格式。
- toList()#
- 返回类型:
QNdefRecord 列表
- toVector()#
- 返回类型:
QNdefRecord 列表
- value(i)#
- 参数:
i – int
- 返回类型: