PythonQt.QtCore.QJsonDocument · declarations 001
Back to PythonQt.QtCore.QJsonDocument
BypassValidation
instance-attribute
BypassValidation: Any
Compact
instance-attribute
Compact: Any
DataValidation
instance-attribute
DataValidation: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Indented
instance-attribute
Indented: Any
JsonFormat
instance-attribute
JsonFormat: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Validate
instance-attribute
Validate: Any
array
array() -> Any
X.array() -> PythonQt.QtCore.QJsonArray
Supplemental documentation: Qt 5 reference:
QJsonArray QJsonDocument::array() const
Returns the QJsonArray contained in the document.
Returns an empty array if the document contains an object.
See also isArray(), object(), and setArray().
Upstream PySide2 reference signatures (binding differences may apply):
array(self) -> PySide2.QtCore.QJsonArray
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#array
fromBinaryData
fromBinaryData(data: Any, validation: Any) -> Any
X.fromBinaryData(data, validation) -> PythonQt.QtCore.QJsonDocument
Upstream PySide2 reference signatures (binding differences may apply):
fromBinaryData(data: PySide2.QtCore.QByteArray, validation: PySide2.QtCore.QJsonDocument.DataValidation=...) -> PySide2.QtCore.QJsonDocument
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#fromBinaryData
fromJson
fromJson(json: Any, error: Any) -> Any
X.fromJson(json, error) -> PythonQt.QtCore.QJsonDocument
Supplemental documentation: Qt 5 reference:
[static] QJsonDocument QJsonDocument::fromJson(const QByteArray \&json, QJsonParseError *error \= nullptr)
Parses json as a UTF-8 encoded JSON document, and creates a QJsonDocument from it.
Returns a valid (non-null) QJsonDocument if the parsing succeeds. If it fails, the returned document will be null, and the optional error variable will contain further details about the error.
See also toJson(), QJsonParseError, and isNull().
Upstream PySide2 reference signatures (binding differences may apply):
fromJson(json: PySide2.QtCore.QByteArray, error: typing.Optional[PySide2.QtCore.QJsonParseError]=...) -> PySide2.QtCore.QJsonDocument
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#fromJson
fromRawData
fromRawData(data: str, size: int, validation: Any) -> Any
X.fromRawData(data, size, validation) -> PythonQt.QtCore.QJsonDocument
Upstream PySide2 reference signatures (binding differences may apply):
fromRawData(data: str, size: int, validation: PySide2.QtCore.QJsonDocument.DataValidation=...) -> PySide2.QtCore.QJsonDocument
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#fromRawData
fromVariant
fromVariant(variant: Any) -> Any
X.fromVariant(variant) -> PythonQt.QtCore.QJsonDocument
Supplemental documentation: Qt 5 reference:
[static] QJsonDocument QJsonDocument::fromVariant(const QVariant \&variant)
Creates a QJsonDocument from the QVariant variant.
If the variant contains any other type than a QVariantMap, QVariantHash, QVariantList or QStringList, the returned document is invalid.
See also toVariant().
Upstream PySide2 reference signatures (binding differences may apply):
fromVariant(variant: typing.Any) -> PySide2.QtCore.QJsonDocument
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#fromVariant
isArray
isArray() -> bool
X.isArray() -> bool
Supplemental documentation: Qt 5 reference:
bool QJsonDocument::isArray() const
Returns true if the document contains an array.
See also array() and isObject().
Upstream PySide2 reference signatures (binding differences may apply):
isArray(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#isArray
isEmpty
isEmpty() -> bool
X.isEmpty() -> bool
Supplemental documentation: Qt 5 reference:
bool QJsonDocument::isEmpty() const
Returns true if the document doesn't contain any data.
Upstream PySide2 reference signatures (binding differences may apply):
isEmpty(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#isEmpty
isNull
isNull() -> bool
X.isNull() -> bool
Supplemental documentation: Qt 5 reference:
bool QJsonDocument::isNull() const
returns true if this document is null.
Null documents are documents created through the default constructor.
Documents created from UTF-8 encoded text or the binary format are validated during parsing. If validation fails, the returned document will also be null.
Upstream PySide2 reference signatures (binding differences may apply):
isNull(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#isNull
isObject
isObject() -> bool
X.isObject() -> bool
Supplemental documentation: Qt 5 reference:
bool QJsonDocument::isObject() const
Returns true if the document contains an object.
See also object() and isArray().
Upstream PySide2 reference signatures (binding differences may apply):
isObject(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#isObject
object
object() -> Any
X.object() -> PythonQt.QtCore.QJsonObject
Supplemental documentation: Qt 5 reference:
QJsonObject QJsonDocument::object() const
Returns the QJsonObject contained in the document.
Returns an empty object if the document contains an array.
See also isObject(), array(), and setObject().
Upstream PySide2 reference signatures (binding differences may apply):
object(self) -> typing.Dict[str, PySide2.QtCore.QJsonValue]
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#object
operator_assign
operator_assign(other: Any) -> Any
X.operator_assign(other) -> PythonQt.QtCore.QJsonDocument
rawData
rawData(size: Any) -> int
X.rawData(size) -> int
Upstream PySide2 reference signatures (binding differences may apply):
rawData(self) -> typing.Tuple[str, int]
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#rawData
setArray
setArray(array: Any) -> None
X.setArray(array)
Supplemental documentation: Qt 5 reference:
void QJsonDocument::setArray(const QJsonArray \&array)
Sets array as the main object of this document.
See also setObject() and array().
Upstream PySide2 reference signatures (binding differences may apply):
setArray(self, array: PySide2.QtCore.QJsonArray) -> None
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#setArray
setObject
setObject(object: Any) -> None
X.setObject(object)
Supplemental documentation: Qt 5 reference:
void QJsonDocument::setObject(const QJsonObject \&object)
Sets object as the main object of this document.
See also setArray() and object().
Upstream PySide2 reference signatures (binding differences may apply):
setObject(self, object: typing.Dict[str, PySide2.QtCore.QJsonValue]) -> None
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#setObject
toBinaryData
toBinaryData() -> Any
X.toBinaryData() -> PythonQt.QtCore.QByteArray
Upstream PySide2 reference signatures (binding differences may apply):
toBinaryData(self) -> PySide2.QtCore.QByteArray
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#toBinaryData
toJson
toJson(format: Any) -> Any
X.toJson(format) -> PythonQt.QtCore.QByteArray
Supplemental documentation: Qt 5 reference:
QByteArray QJsonDocument::toJson() const
Converts the QJsonDocument to an indented, UTF-8 encoded JSON document.
See also fromJson().
QByteArray QJsonDocument::toJson(QJsonDocument::JsonFormat format) const
Converts the QJsonDocument to a UTF-8 encoded JSON document in the provided format.
This function was introduced in Qt 5.1.
See also fromJson() and JsonFormat.
Upstream PySide2 reference signatures (binding differences may apply):
toJson(self) -> PySide2.QtCore.QByteArray
toJson(self, format: PySide2.QtCore.QJsonDocument.JsonFormat) -> PySide2.QtCore.QByteArray
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#toJson
toVariant
toVariant() -> Any
X.toVariant() -> object
Supplemental documentation: Qt 5 reference:
QVariant QJsonDocument::toVariant() const
Returns a QVariant representing the Json document.
The returned variant will be a QVariantList if the document is a QJsonArray and a QVariantMap if the document is a QJsonObject.
See also fromVariant() and QJsonValue::toVariant().
Upstream PySide2 reference signatures (binding differences may apply):
toVariant(self) -> typing.Any
Source: https://doc.qt.io/archives/qt-5.15/qjsondocument.html#toVariant