En esta página

QProtobufJsonSerializer Class

La clase `QProtobufJsonSerializer` es una interfaz que ofrece funciones básicas para la serialización y deserialización de objetos ` QProtobufMessage ` a JSON. Más información...

Cabecera: #include <QProtobufJsonSerializer>
CMake: find_package(Qt6 REQUIRED COMPONENTS Protobuf)
target_link_libraries(mytarget PRIVATE Qt6::Protobuf)
Desde: Qt 6.7
Heredado de: QAbstractProtobufSerializer

Funciones públicas reimplementadas

virtual QAbstractProtobufSerializer::Error lastError() const override
virtual QString lastErrorString() const override

Descripción detallada

La clase `QProtobufJsonSerializer` registra serializadores y deserializadores para las clases que implementan un mensaje protobuf, heredando de ` QProtobufMessage`. Estas clases se generan automáticamente a partir de un archivo ` .proto `, utilizando la función de CMake `qt_add_protobuf ` o ejecutando directamente `qtprotobufgen `.

Documentación de las funciones miembro

[override virtual] QAbstractProtobufSerializer::Error QProtobufJsonSerializer::lastError() const

Reimplementa: ` QAbstractProtobufSerializer::lastError()` const.

Devuelve el último error de deserialización de la instancia del serializador.

Véase también lastErrorString().

[override virtual] QString QProtobufJsonSerializer::lastErrorString() const

Reimplementa: ` QAbstractProtobufSerializer::lastErrorString()` const.

Devuelve la última cadena de error de deserialización de la instancia del serializador.

Véase también lastError().

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