Skip to content

PythonQt.QtCore.QJsonObject

QJsonObject

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

A JSON object is a list of key value pairs, where the keys are unique strings and the values are represented by a QJsonValue.

A QJsonObject can be converted to and from a QVariantMap. You can query the number of (key, value) pairs with size(), insert(), and remove() entries from it and iterate over its content using the standard C++ iterator pattern.

QJsonObject is an implicitly shared class, and shares the data with the document it has been created from as long as it is not being modified.

You can convert the object to and from text based JSON through QJsonDocument.

Source: https://doc.qt.io/archives/qt-5.15/qjsonobject.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
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
contains function (self, key: Any) -> bool X.contains(key) -> bool
count function (self) -> int X.count() -> int
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
empty function (self) -> bool X.empty() -> bool
fromVariantHash function (self, map: Any) -> Any X.fromVariantHash(map) -> PythonQt.QtCore.QJsonObject
fromVariantMap function (self, map: Any) -> Any X.fromVariantMap(map) -> PythonQt.QtCore.QJsonObject
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)
isEmpty function (self) -> bool X.isEmpty() -> bool
keys function (self) -> tuple X.keys() -> tuple
length function (self) -> int X.length() -> int
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtCore.QJsonObject
operator_subscript function (self, key: Any) -> Any X.operator_subscript(key) -> PythonQt.QtCore.QJsonValue
remove function (self, key: Any) -> Any Removes key from the object.
size function (self) -> int X.size() -> int
take function (self, key: Any) -> Any X.take(key) -> PythonQt.QtCore.QJsonValue
toVariantHash function (self) -> dict X.toVariantHash() -> dict
toVariantMap function (self) -> dict X.toVariantMap() -> dict
value function (self, key: Any) -> Any X.value(key) -> PythonQt.QtCore.QJsonValue