QNdefNfcSmartPosterRecord Class
La clase QNdefNfcSmartPosterRecord proporciona un RTD-SmartPoster NFC. Más información...
| Encabezado: | #include <QNdefNfcSmartPosterRecord> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Nfc) target_link_libraries(mytarget PRIVATE Qt6::Nfc) |
| qmake: | QT += nfc |
| Desde: | Qt 5.2 |
| Heredado de: | QNdefRecord |
Tipos públicos
| enum | Action { UnspecifiedAction, DoAction, SaveAction, EditAction } |
Funciones públicas
| QNdefNfcSmartPosterRecord() | |
| QNdefNfcSmartPosterRecord(const QNdefRecord &other) | |
| QNdefNfcSmartPosterRecord(const QNdefNfcSmartPosterRecord &other) | |
| ~QNdefNfcSmartPosterRecord() | |
| QNdefNfcSmartPosterRecord::Action | action() const |
| void | addIcon(const QNdefNfcIconRecord &icon) |
| void | addIcon(const QByteArray &type, const QByteArray &data) |
| bool | addTitle(const QNdefNfcTextRecord &text) |
| bool | addTitle(const QString &text, const QString &locale, QNdefNfcTextRecord::Encoding encoding) |
| bool | hasAction() const |
| bool | hasIcon(const QByteArray &mimetype = QByteArray()) const |
| bool | hasSize() const |
| bool | hasTitle(const QString &locale = QString()) const |
| bool | hasTypeInfo() const |
| QByteArray | icon(const QByteArray &mimetype = QByteArray()) const |
| qsizetype | iconCount() const |
| QNdefNfcIconRecord | iconRecord(qsizetype index) const |
| QList<QNdefNfcIconRecord> | iconRecords() const |
| bool | removeIcon(const QByteArray &type) |
| bool | removeIcon(const QNdefNfcIconRecord &icon) |
| bool | removeTitle(const QNdefNfcTextRecord &text) |
| bool | removeTitle(const QString &locale) |
| void | setAction(QNdefNfcSmartPosterRecord::Action act) |
| void | setIcons(const QList<QNdefNfcIconRecord> &icons) |
| void | setSize(quint32 size) |
| void | setTitles(const QList<QNdefNfcTextRecord> &titles) |
| void | setTypeInfo(const QString &type) |
| void | setUri(const QNdefNfcUriRecord &url) |
| void | setUri(const QUrl &url) |
| quint32 | size() const |
| QString | title(const QString &locale = QString()) const |
| qsizetype | titleCount() const |
| QNdefNfcTextRecord | titleRecord(qsizetype index) const |
| QList<QNdefNfcTextRecord> | titleRecords() const |
| QString | typeInfo() const |
| QUrl | uri() const |
| QNdefNfcUriRecord | uriRecord() const |
| QNdefNfcSmartPosterRecord & | operator=(const QNdefNfcSmartPosterRecord &other) |
Documentación sobre los tipos de miembros
enum QNdefNfcSmartPosterRecord::Action
Esta enumeración describe el procedimiento que debe seguir un dispositivo con respecto al contenido.
| Constante | Valor | Descripción |
|---|---|---|
QNdefNfcSmartPosterRecord::UnspecifiedAction | -1 | La acción no está definida. |
QNdefNfcSmartPosterRecord::DoAction | 0 | Realizar la acción (enviar el SMS, abrir el navegador, realizar la llamada telefónica). |
QNdefNfcSmartPosterRecord::SaveAction | 1 | Guardar para más tarde (guardar el SMS en la bandeja de entrada, añadir el URI a los marcadores, guardar el número de teléfono en los contactos). |
QNdefNfcSmartPosterRecord::EditAction | 2 | Abrir para editar (abrir un SMS en el editor de SMS, abrir el URI en un editor de URI, abrir el número de teléfono para editarlo). |
Documentación de la función miembro
QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord()
Crea un nuevo póster inteligente vacío.
QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord(const QNdefRecord &other)
Crea un nuevo póster inteligente que es una copia de other.
QNdefNfcSmartPosterRecord::QNdefNfcSmartPosterRecord(const QNdefNfcSmartPosterRecord &other)
Crea un nuevo póster inteligente que es una copia de other.
[noexcept] QNdefNfcSmartPosterRecord::~QNdefNfcSmartPosterRecord()
Destruye el cartel inteligente.
QNdefNfcSmartPosterRecord::Action QNdefNfcSmartPosterRecord::action() const
Devuelve la acción del registro de acciones, si está disponible. De lo contrario, se devuelve UnspecifiedAction.
Véase también setAction().
void QNdefNfcSmartPosterRecord::addIcon(const QNdefNfcIconRecord &icon)
Añade un registro de icono icon al póster inteligente. Si el póster inteligente ya contiene un registro de icono del mismo tipo, se sustituye el registro de icono existente.
void QNdefNfcSmartPosterRecord::addIcon(const QByteArray &type, const QByteArray &data)
Añade un registro de icono con el tipo « type » y los datos « data » al póster inteligente. Si el póster inteligente ya contiene un registro de icono con el mismo tipo, se sustituye el registro de icono existente.
bool QNdefNfcSmartPosterRecord::addTitle(const QNdefNfcTextRecord &text)
Intenta añadir un registro de título text al póster inteligente. Si el póster inteligente aún no contiene un registro de título con la misma configuración regional que el registro de título text, se añade dicho registro y la función devuelve true. En caso contrario, se devuelve false.
bool QNdefNfcSmartPosterRecord::addTitle(const QString &text, const QString &locale, QNdefNfcTextRecord::Encoding encoding)
Intenta añadir un nuevo registro de título con el título « text », la configuración regional « locale » y la codificación « encoding ». Si el «smart poster» aún no contiene un registro de título con la configuración regional « locale », se añade dicho registro y la función devuelve « true ». En caso contrario, se devuelve « false ».
bool QNdefNfcSmartPosterRecord::hasAction() const
Devuelve « true » si el «smart poster» contiene un registro de acción; en caso contrario, devuelve « false ».
bool QNdefNfcSmartPosterRecord::hasIcon(const QByteArray &mimetype = QByteArray()) const
Devuelve « true » si el «smart poster» contiene un registro de icono del tipo « mimetype ». Si « mimetype » está vacío, se devuelve « true » si el «smart poster» contiene al menos un registro de icono. En todos los demás casos, se devuelve « false ».
bool QNdefNfcSmartPosterRecord::hasSize() const
Devuelve « true » si el cartel inteligente contiene un registro de tamaño; en caso contrario, devuelve « false ».
bool QNdefNfcSmartPosterRecord::hasTitle(const QString &locale = QString()) const
Devuelve « true » si el «smart poster» contiene un registro de título que utilice la configuración regional « locale ». Si « locale » está vacío, se devuelve « true » si el «smart poster» contiene al menos un registro de título. En todos los demás casos, se devuelve « false ».
bool QNdefNfcSmartPosterRecord::hasTypeInfo() const
Devuelve « true » si el «smart poster» contiene un registro de tipo; en caso contrario, devuelve « false ».
QByteArray QNdefNfcSmartPosterRecord::icon(const QByteArray &mimetype = QByteArray()) const
Devuelve los datos del registro de icono asociado si el «smart poster» contiene un registro de icono con el tipo MIME mimetype. Si se omite mimetype o está vacío, se devuelven los datos del primer registro de icono. En todos los demás casos, se devuelve una matriz vacía.
Advertencia: Se recomienda a los desarrolladoresde aplicaciones que validen los datos devueltos antes de procesarlos. Consulte « Qt NFC: Consideraciones de seguridad» para obtener orientación.
qsizetype QNdefNfcSmartPosterRecord::iconCount() const
Devuelve el número de registros de iconos que contiene el «smart poster».
QNdefNfcIconRecord QNdefNfcSmartPosterRecord::iconRecord(qsizetype index) const
Devuelve el registro del icono correspondiente al índice index dentro del «smart poster», donde index es un valor comprendido entre 0 y iconCount() - 1. Los valores fuera de este rango devuelven un registro vacío.
QList<QNdefNfcIconRecord> QNdefNfcSmartPosterRecord::iconRecords() const
Devuelve una copia de todos los registros de iconos que hay dentro del «smart poster».
bool QNdefNfcSmartPosterRecord::removeIcon(const QByteArray &type)
Intenta eliminar del «smart poster» el registro de icono con el tipo « type ». Elimina el registro y devuelve « true » si el «smart poster» contiene un registro que coincida; en caso contrario, devuelve « false ».
bool QNdefNfcSmartPosterRecord::removeIcon(const QNdefNfcIconRecord &icon)
Intenta eliminar el registro del icono « icon » del cartel inteligente. Elimina el registro y devuelve « true » si el cartel inteligente contiene un registro coincidente; en caso contrario, devuelve « false ».
bool QNdefNfcSmartPosterRecord::removeTitle(const QNdefNfcTextRecord &text)
Intenta eliminar el registro de título « text » del «smart poster». Elimina el registro y devuelve « true » si el «smart poster» contiene un registro que coincida; en caso contrario, devuelve « false ».
bool QNdefNfcSmartPosterRecord::removeTitle(const QString &locale)
Intenta eliminar del «smart poster» un registro de título con la configuración regional locale. Elimina el registro y devuelve true si el «smart poster» contiene un registro que coincida; en caso contrario, devuelve false.
void QNdefNfcSmartPosterRecord::setAction(QNdefNfcSmartPosterRecord::Action act)
Establece el registro de acciones en act
Véase también action().
void QNdefNfcSmartPosterRecord::setIcons(const QList<QNdefNfcIconRecord> &icons)
Añade la lista de registros de iconos icons al póster inteligente. Se sobrescribirán los registros existentes.
Véase también hasIcon() y icon().
void QNdefNfcSmartPosterRecord::setSize(quint32 size)
Establece el registro « size ». El valor contiene el tamaño, en bytes, del objeto al que hace referencia el URI.
Véase también size() y hasSize().
void QNdefNfcSmartPosterRecord::setTitles(const QList<QNdefNfcTextRecord> &titles)
Añade la lista de registros de títulos titles al «smart poster». Se sobrescribirán los registros existentes.
void QNdefNfcSmartPosterRecord::setTypeInfo(const QString &type)
Establece el registro de tipo en « type ». En type se describe el tipo del objeto al que hace referencia la función uri().
Véase también typeInfo().
void QNdefNfcSmartPosterRecord::setUri(const QNdefNfcUriRecord &url)
Establece el registro URI en url
Véase también uri().
void QNdefNfcSmartPosterRecord::setUri(const QUrl &url)
Crea un registro URI y establece su contenido dentro del «smart poster» para url
quint32 QNdefNfcSmartPosterRecord::size() const
Devuelve el tamaño del registro de tamaño, si está disponible; en caso contrario, devuelve 0.
El valor es opcional y contiene el tamaño en bytes del objeto al que hace referencia el URI. El dispositivo puede utilizarlo para determinar si puede albergar el objeto.
Véase también setSize().
QString QNdefNfcSmartPosterRecord::title(const QString &locale = QString()) const
Devuelve el texto del título del registro asociado a la configuración regional locale, si está disponible. Si locale está vacío, se devuelve el texto del título del primer registro disponible. En todos los demás casos, se devuelve una cadena vacía.
qsizetype QNdefNfcSmartPosterRecord::titleCount() const
Devuelve el número de registros de títulos que contiene el «smart poster».
QNdefNfcTextRecord QNdefNfcSmartPosterRecord::titleRecord(qsizetype index) const
Devuelve el registro de título correspondiente al índice index dentro del «smart poster», donde index es un valor comprendido entre 0 y titleCount() - 1. Los valores fuera de este rango devuelven un registro vacío.
QList<QNdefNfcTextRecord> QNdefNfcSmartPosterRecord::titleRecords() const
Devuelve una copia de todos los registros de títulos que contiene el «smart poster».
QString QNdefNfcSmartPosterRecord::typeInfo() const
Devuelve el tipo MIME que describe el tipo de los objetos a los que se puede acceder mediante uri().
Si se desconoce el tipo, el objeto ` QString ` devuelto estará vacío.
Véanse también setTypeInfo() y hasTypeInfo().
QUrl QNdefNfcSmartPosterRecord::uri() const
Devuelve el URI del registro de URI del cartel inteligente, si está definido. De lo contrario, se devuelve un URI vacío.
Advertencia: Se recomienda a los desarrolladoresde aplicaciones que validen el URI devuelto antes de actuar en consecuencia. Consulte « Qt NFC: Consideraciones de seguridad» para obtener orientación.
Véase también setUri().
QNdefNfcUriRecord QNdefNfcSmartPosterRecord::uriRecord() const
Devuelve el registro URI del póster inteligente, si está definido. De lo contrario, se devuelve un URI vacío.
QNdefNfcSmartPosterRecord &QNdefNfcSmartPosterRecord::operator=(const QNdefNfcSmartPosterRecord &other)
Asigna el registro del póster inteligente « other » a este registro y devuelve una referencia a este registro.
© 2026 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.