Skip to content

PythonQt.QtCore.QJsonArray

QJsonArray

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

A JSON array is a list of values. The list can be manipulated by inserting and removing QJsonValue's from the array.

A QJsonArray can be converted to and from a QVariantList. You can query the number of entries with size(), insert(), and removeAt() entries from it and iterate over its content using the standard C++ iterator pattern.

QJsonArray 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 array to and from text based JSON through QJsonDocument.

Source: https://doc.qt.io/archives/qt-5.15/qjsonarray.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)
append function (self, value: Any) -> None Inserts value at the end of the array.
at function (self, i: int) -> Any X.at(i) -> PythonQt.QtCore.QJsonValue
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
contains function (self, element: Any) -> bool X.contains(element) -> 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
first function (self) -> Any X.first() -> PythonQt.QtCore.QJsonValue
fromStringList function (self, list: Any) -> Any X.fromStringList(list) -> PythonQt.QtCore.QJsonArray
fromVariantList function (self, list: Any) -> Any X.fromVariantList(list) -> PythonQt.QtCore.QJsonArray
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)
insert function (self, i: int, value: Any) -> None X.insert(i, value)
isEmpty function (self) -> bool X.isEmpty() -> bool
last function (self) -> Any X.last() -> PythonQt.QtCore.QJsonValue
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtCore.QJsonArray
operator_subscript function (self, i: Any) -> Any X.operator_subscript(i) -> PythonQt.QtCore.QJsonValue
pop_back function (self) -> None This function is provided for STL compatibility.
pop_front function (self) -> None This function is provided for STL compatibility.
prepend function (self, value: Any) -> None Inserts value at the beginning of the array.
push_back function (self, t: Any) -> None This function is provided for STL compatibility.
push_front function (self, t: Any) -> None This function is provided for STL compatibility.
removeAt function (self, i: int) -> None Removes the value at index position i. i must be a valid index position in the array (i.e., 0 <= i < size()).
removeFirst function (self) -> None Removes the first item in the array.
removeLast function (self) -> None Removes the last item in the array.
replace function (self, i: int, value: Any) -> None X.replace(i, value)
size function (self) -> int X.size() -> int
takeAt function (self, i: int) -> Any X.takeAt(i) -> PythonQt.QtCore.QJsonValue
toVariantList function (self) -> tuple X.toVariantList() -> tuple