QNdefNfcSmartPosterRecord#
The QNdefNfcSmartPosterRecord
class provides an NFC RTD-SmartPoster. More…
Synopsis#
Functions#
def
action
()def
addIcon
(type, data)def
addIcon
(icon)def
addTitle
(text)def
addTitle
(text, locale, encoding)def
hasAction
()def
hasIcon
([mimetype=QByteArray()])def
hasSize
()def
hasTitle
([locale=””])def
hasTypeInfo
()def
icon
([mimetype=QByteArray()])def
iconCount
()def
iconRecord
(index)def
iconRecords
()def
removeIcon
(type)def
removeIcon
(icon)def
removeTitle
(text)def
removeTitle
(locale)def
setAction
(act)def
setIcons
(icons)def
setSize
(size)def
setTitles
(titles)def
setTypeInfo
(type)def
setUri
(url)def
setUri
(url)def
size
()def
title
([locale=””])def
titleCount
()def
titleRecord
(index)def
titleRecords
()def
typeInfo
()def
uri
()def
uriRecord
()
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#
RTD-SmartPoster encapsulates a Smart Poster.
- class PySide6.QtNfc.QNdefNfcSmartPosterRecord#
PySide6.QtNfc.QNdefNfcSmartPosterRecord(other)
PySide6.QtNfc.QNdefNfcSmartPosterRecord(other)
- Parameters:
Constructs a new empty smart poster.
Constructs a new smart poster that is a copy of other
.
Constructs a new smart poster that is a copy of other
.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.Action#
This enum describes the course of action that a device should take with the content.
Constant
Description
QNdefNfcSmartPosterRecord.UnspecifiedAction
The action is not defined.
QNdefNfcSmartPosterRecord.DoAction
Do the action (send the SMS, launch the browser, make the telephone call).
QNdefNfcSmartPosterRecord.SaveAction
Save for later (store the SMS in INBOX, put the URI in a bookmark, save the telephone number in contacts).
QNdefNfcSmartPosterRecord.EditAction
Open for editing (open an SMS in the SMS editor, open the URI in a URI editor, open the telephone number for editing).
Returns the action from the action record if available. Otherwise UnspecifiedAction
is returned.
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.addIcon(type, data)#
- Parameters:
type –
PySide6.QtCore.QByteArray
data –
PySide6.QtCore.QByteArray
Adds an icon record with type type
and data data
to the smart poster. If the smart poster already contains an icon record with the same type then the existing icon record is replaced.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.addIcon(icon)
- Parameters:
Adds an icon record icon
to the smart poster. If the smart poster already contains an icon record with the same type then the existing icon record is replaced.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.addTitle(text)#
- Parameters:
- Return type:
bool
Attempts to add a title record text
to the smart poster. If the smart poster does not already contain a title record with the same locale as title record text
, then the title record is added and the function returns true
. Otherwise false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.addTitle(text, locale, encoding)
- Parameters:
text – str
locale – str
encoding –
Encoding
- Return type:
bool
Attempts to add a new title record with title text
, locale locale
and encoding encoding
. If the smart poster does not already contain a title record with locale locale
, then the title record is added and the function returns true
. Otherwise false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.hasAction()#
- Return type:
bool
Returns true
if the smart poster contains an action record, otherwise returns false
.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.hasIcon([mimetype=QByteArray()])#
- Parameters:
mimetype –
PySide6.QtCore.QByteArray
- Return type:
bool
Returns true
if the smart poster contains an icon record using the type mimetype
. If mimetype
is empty, then true
is returned if the smart poster contains at least one icon record. In all other cases, false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.hasSize()#
- Return type:
bool
Returns true
if the smart poster contains a size record, otherwise returns false
.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.hasTitle([locale=""])#
- Parameters:
locale – str
- Return type:
bool
Returns true
if the smart poster contains a title record using the locale locale
. If locale
is empty, then true
is returned if the smart poster contains at least one title record. In all other cases, false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.hasTypeInfo()#
- Return type:
bool
Returns true
if the smart poster contains a type record, otherwise returns false
.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.icon([mimetype=QByteArray()])#
- Parameters:
mimetype –
PySide6.QtCore.QByteArray
- Return type:
Returns the associated icon record data if the smart poster contains an icon record with MIME type mimetype
. If mimetype
is omitted or empty then the first icon’s record data is returned. In all other cases, an empty array is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.iconCount()#
- Return type:
qsizetype
Returns the number of icon records contained inside the smart poster.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.iconRecord(index)#
- Parameters:
index –
qsizetype
- Return type:
Returns the icon record corresponding to the index index
inside the smart poster, where index
is a value between 0 and iconCount()
- 1. Values outside of this range return an empty record.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.iconRecords()#
- Return type:
Returns a copy of all icon records inside the smart poster.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.removeIcon(type)#
- Parameters:
type –
PySide6.QtCore.QByteArray
- Return type:
bool
Attempts to remove the icon record with the type type
from the smart poster. Removes the record and returns true
if the smart poster contains a matching record, otherwise false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.removeIcon(icon)
- Parameters:
- Return type:
bool
Attempts to remove the icon record icon
from the smart poster. Removes the record and returns true
if the smart poster contains a matching record, otherwise false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.removeTitle(text)#
- Parameters:
- Return type:
bool
Attempts to remove the title record text
from the smart poster. Removes the record and returns true
if the smart poster contains a matching record, otherwise false
is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.removeTitle(locale)
- Parameters:
locale – str
- Return type:
bool
Attempts to remove a title record with the locale locale
from the smart poster. Removes the record and returns true
if the smart poster contains a matching record, otherwise false
is returned.
Sets the action record to act
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.setIcons(icons)#
- Parameters:
icons –
Adds the icon record list icons
to the smart poster. Any existing records are overwritten.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.setSize(size)#
- Parameters:
size – int
Sets the record size
. The value contains the size in bytes of the object that the URI refers to.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.setTitles(titles)#
- Parameters:
titles –
Adds the title record list titles
to the smart poster. Any existing records are overwritten.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.setTypeInfo(type)#
- Parameters:
type – str
Sets the type record to type
. type
describes the type of the object referenced by uri()
.
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.setUri(url)#
- Parameters:
Sets the URI record to url
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.setUri(url)
- Parameters:
url –
PySide6.QtCore.QUrl
Constructs a URI record and sets its content inside the smart poster to url
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.size()#
- Return type:
int
Returns the size from the size record if available; otherwise returns 0.
The value is optional and contains the size in bytes of the object that the URI refers to. It may be used by the device to determine whether it can accommodate the object.
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.title([locale=""])#
- Parameters:
locale – str
- Return type:
str
Returns the title record text associated with locale locale
if available. If locale
is empty then the title text of the first available record is returned. In all other cases an empty string is returned.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.titleCount()#
- Return type:
qsizetype
Returns the number of title records contained inside the smart poster.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.titleRecord(index)#
- Parameters:
index –
qsizetype
- Return type:
Returns the title record corresponding to the index index
inside the smart poster, where index
is a value between 0 and titleCount()
- 1. Values outside of this range return an empty record.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.titleRecords()#
- Return type:
Returns a copy of all title records inside the smart poster.
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.typeInfo()#
- Return type:
str
Returns the MIME type that describes the type of the objects that can be reached via uri()
.
If the type is not known, the returned QString
is empty.
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.uri()#
- Return type:
Returns the URI from the smart poster’s URI record if set. Otherwise an empty URI is returned.
See also
- PySide6.QtNfc.QNdefNfcSmartPosterRecord.uriRecord()#
- Return type:
Returns the smart poster’s URI record if set. Otherwise an empty URI is returned.