Skip to content

PythonQt.Qt.QJsonDocument

QJsonDocument

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

QJsonDocument is a class that wraps a complete JSON document and can read and write this document both from a UTF-8 encoded text based representation as well as Qt's own binary format.

A JSON document can be converted from its text-based representation to a QJsonDocument using QJsonDocument::fromJson(). toJson() converts it back to text. The parser is very fast and efficient and converts the JSON to the binary representation used by Qt.

Validity of the parsed document can be queried with isNull()

A document can be queried as to whether it contains an array or an object using isArray() and isObject(). The array or object contained in the document can be retrieved using array() or object() and then read or manipulated.

A document can also be created from a stored binary representation using fromBinaryData() or fromRawData().

Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
BypassValidation attribute Any (shared captured text)
Compact attribute Any (shared captured text)
DataValidation attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
Indented attribute Any (shared captured text)
JsonFormat attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
Validate attribute Any (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
array function (self) -> Any X.array() -> PythonQt.QtCore.QJsonArray (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
fromBinaryData function (self, data: Any, validation: Any) -> Any X.fromBinaryData(data, validation) -> PythonQt.QtCore.QJsonDocument (shared captured text)
fromJson function (self, json: Any, error: Any) -> Any X.fromJson(json, error) -> PythonQt.QtCore.QJsonDocument (shared captured text)
fromRawData function (self, data: str, size: int, validation: Any) -> Any X.fromRawData(data, size, validation) -> PythonQt.QtCore.QJsonDocument (shared captured text)
fromVariant function (self, variant: Any) -> Any X.fromVariant(variant) -> PythonQt.QtCore.QJsonDocument (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isArray function (self) -> bool X.isArray() -> bool (shared captured text)
isEmpty function (self) -> bool X.isEmpty() -> bool (shared captured text)
isNull function (self) -> bool X.isNull() -> bool (shared captured text)
isObject function (self) -> bool X.isObject() -> bool (shared captured text)
object function (self) -> Any X.object() -> PythonQt.QtCore.QJsonObject (shared captured text)
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtCore.QJsonDocument (shared captured text)
rawData function (self, size: Any) -> int X.rawData(size) -> int (shared captured text)
setArray function (self, array: Any) -> None Sets array as the main object of this document. (shared captured text)
setObject function (self, object: Any) -> None Sets object as the main object of this document. (shared captured text)
toBinaryData function (self) -> Any X.toBinaryData() -> PythonQt.QtCore.QByteArray (shared captured text)
toJson function (self, format: Any) -> Any X.toJson(format) -> PythonQt.QtCore.QByteArray (shared captured text)
toVariant function (self) -> Any X.toVariant() -> object (shared captured text)