KLayout 0.29.8 (2024-11-26 926dac96c) [master]

API reference - Class QJsonArray

Notation used in Ruby API documentation

Module: QtCore

Description: Binding of QJsonArray

Sub-classes: Iterator, Const_iterator

Public constructors

new QJsonArraynewConstructor QJsonArray::QJsonArray()
new QJsonArraynew(const QJsonArray other)Constructor QJsonArray::QJsonArray(const QJsonArray &other)

Public methods

[const]bool!=(const QJsonArray other)Method bool QJsonArray::operator!=(const QJsonArray &other)
[const]QJsonArray+(const QJsonValue v)Method QJsonArray QJsonArray::operator+(const QJsonValue &v)
QJsonArray+=(const QJsonValue v)Method QJsonArray &QJsonArray::operator+=(const QJsonValue &v)
QJsonArray<<(const QJsonValue v)Method QJsonArray &QJsonArray::operator<<(const QJsonValue &v)
[const]bool==(const QJsonArray other)Method bool QJsonArray::operator==(const QJsonArray &other)
QJsonValueRef[](int i)Method QJsonValueRef QJsonArray::operator[](int i)
[const]QJsonValue[](int i)Method QJsonValue QJsonArray::operator[](int i)
void_assign(const QJsonArray other)Assigns another object to self
[const]QJsonArray ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidappend(const QJsonValue value)Method void QJsonArray::append(const QJsonValue &value)
QJsonArrayassign(const QJsonArray other)Method QJsonArray &QJsonArray::operator =(const QJsonArray &other)
[const]QJsonValueat(int i)Method QJsonValue QJsonArray::at(int i)
QJsonArray_IteratorbeginMethod QJsonArray::iterator QJsonArray::begin()
[const]QJsonArray_Const_iteratorbeginMethod QJsonArray::const_iterator QJsonArray::begin()
[const]QJsonArray_Const_iteratorconstBeginMethod QJsonArray::const_iterator QJsonArray::constBegin()
[const]QJsonArray_Const_iteratorconstEndMethod QJsonArray::const_iterator QJsonArray::constEnd()
[const]boolcontains(const QJsonValue element)Method bool QJsonArray::contains(const QJsonValue &element)
[const]intcountMethod int QJsonArray::count()
[const]new QJsonArray ptrdupCreates a copy of self
[const]boolemptyMethod bool QJsonArray::empty()
QJsonArray_IteratorendMethod QJsonArray::iterator QJsonArray::end()
[const]QJsonArray_Const_iteratorendMethod QJsonArray::const_iterator QJsonArray::end()
QJsonArray_Iteratorerase(QJsonArray_Iterator it)Method QJsonArray::iterator QJsonArray::erase(QJsonArray::iterator it)
[const]QJsonValuefirstMethod QJsonValue QJsonArray::first()
voidinsert(int i,
const QJsonValue value)
Method void QJsonArray::insert(int i, const QJsonValue &value)
QJsonArray_Iteratorinsert(QJsonArray_Iterator before,
const QJsonValue value)
Method QJsonArray::iterator QJsonArray::insert(QJsonArray::iterator before, const QJsonValue &value)
[const]boolisEmpty?Method bool QJsonArray::isEmpty()
[const]QJsonValuelastMethod QJsonValue QJsonArray::last()
voidpop_backMethod void QJsonArray::pop_back()
voidpop_frontMethod void QJsonArray::pop_front()
voidprepend(const QJsonValue value)Method void QJsonArray::prepend(const QJsonValue &value)
voidpush_back(const QJsonValue t)Method void QJsonArray::push_back(const QJsonValue &t)
voidpush_front(const QJsonValue t)Method void QJsonArray::push_front(const QJsonValue &t)
voidremoveAt(int i)Method void QJsonArray::removeAt(int i)
voidremoveFirstMethod void QJsonArray::removeFirst()
voidremoveLastMethod void QJsonArray::removeLast()
voidreplace(int i,
const QJsonValue value)
Method void QJsonArray::replace(int i, const QJsonValue &value)
[const]intsizeMethod int QJsonArray::size()
voidswap(QJsonArray other)Method void QJsonArray::swap(QJsonArray &other)
QJsonValuetakeAt(int i)Method QJsonValue QJsonArray::takeAt(int i)
[const]variant[]toVariantListMethod QList<QVariant> QJsonArray::toVariantList()

Public static methods and constants

QJsonArrayfromStringList(string[] list)Static method QJsonArray QJsonArray::fromStringList(const QStringList &list)
QJsonArrayfromVariantList(variant[] list)Static method QJsonArray QJsonArray::fromVariantList(const QList<QVariant> &list)

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

!=

Signature: [const] bool != (const QJsonArray other)

Description: Method bool QJsonArray::operator!=(const QJsonArray &other)

+

Signature: [const] QJsonArray + (const QJsonValue v)

Description: Method QJsonArray QJsonArray::operator+(const QJsonValue &v)

+=

Signature: QJsonArray += (const QJsonValue v)

Description: Method QJsonArray &QJsonArray::operator+=(const QJsonValue &v)

<<

Signature: QJsonArray << (const QJsonValue v)

Description: Method QJsonArray &QJsonArray::operator<<(const QJsonValue &v)

==

Signature: [const] bool == (const QJsonArray other)

Description: Method bool QJsonArray::operator==(const QJsonArray &other)

[]

(1) Signature: QJsonValueRef [] (int i)

Description: Method QJsonValueRef QJsonArray::operator[](int i)

(2) Signature: [const] QJsonValue [] (int i)

Description: Method QJsonValue QJsonArray::operator[](int i)

_assign

Signature: void _assign (const QJsonArray other)

Description: Assigns another object to self

_const_cast

Signature: [const] QJsonArray ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

append

Signature: void append (const QJsonValue value)

Description: Method void QJsonArray::append(const QJsonValue &value)

assign

Signature: QJsonArray assign (const QJsonArray other)

Description: Method QJsonArray &QJsonArray::operator =(const QJsonArray &other)

at

Signature: [const] QJsonValue at (int i)

Description: Method QJsonValue QJsonArray::at(int i)

begin

(1) Signature: QJsonArray_Iterator begin

Description: Method QJsonArray::iterator QJsonArray::begin()

(2) Signature: [const] QJsonArray_Const_iterator begin

Description: Method QJsonArray::const_iterator QJsonArray::begin()

constBegin

Signature: [const] QJsonArray_Const_iterator constBegin

Description: Method QJsonArray::const_iterator QJsonArray::constBegin()

constEnd

Signature: [const] QJsonArray_Const_iterator constEnd

Description: Method QJsonArray::const_iterator QJsonArray::constEnd()

contains

Signature: [const] bool contains (const QJsonValue element)

Description: Method bool QJsonArray::contains(const QJsonValue &element)

count

Signature: [const] int count

Description: Method int QJsonArray::count()

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup

Signature: [const] new QJsonArray ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

empty

Signature: [const] bool empty

Description: Method bool QJsonArray::empty()

end

(1) Signature: QJsonArray_Iterator end

Description: Method QJsonArray::iterator QJsonArray::end()

(2) Signature: [const] QJsonArray_Const_iterator end

Description: Method QJsonArray::const_iterator QJsonArray::end()

erase

Signature: QJsonArray_Iterator erase (QJsonArray_Iterator it)

Description: Method QJsonArray::iterator QJsonArray::erase(QJsonArray::iterator it)

first

Signature: [const] QJsonValue first

Description: Method QJsonValue QJsonArray::first()

fromStringList

Signature: [static] QJsonArray fromStringList (string[] list)

Description: Static method QJsonArray QJsonArray::fromStringList(const QStringList &list)

This method is static and can be called without an instance.

fromVariantList

Signature: [static] QJsonArray fromVariantList (variant[] list)

Description: Static method QJsonArray QJsonArray::fromVariantList(const QList<QVariant> &list)

This method is static and can be called without an instance.

insert

(1) Signature: void insert (int i, const QJsonValue value)

Description: Method void QJsonArray::insert(int i, const QJsonValue &value)

(2) Signature: QJsonArray_Iterator insert (QJsonArray_Iterator before, const QJsonValue value)

Description: Method QJsonArray::iterator QJsonArray::insert(QJsonArray::iterator before, const QJsonValue &value)

isEmpty?

Signature: [const] bool isEmpty?

Description: Method bool QJsonArray::isEmpty()

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

last

Signature: [const] QJsonValue last

Description: Method QJsonValue QJsonArray::last()

new

(1) Signature: [static] new QJsonArray new

Description: Constructor QJsonArray::QJsonArray()

This method creates an object of class QJsonArray.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QJsonArray new (const QJsonArray other)

Description: Constructor QJsonArray::QJsonArray(const QJsonArray &other)

This method creates an object of class QJsonArray.

Python specific notes:
This method is the default initializer of the object.

pop_back

Signature: void pop_back

Description: Method void QJsonArray::pop_back()

pop_front

Signature: void pop_front

Description: Method void QJsonArray::pop_front()

prepend

Signature: void prepend (const QJsonValue value)

Description: Method void QJsonArray::prepend(const QJsonValue &value)

push_back

Signature: void push_back (const QJsonValue t)

Description: Method void QJsonArray::push_back(const QJsonValue &t)

push_front

Signature: void push_front (const QJsonValue t)

Description: Method void QJsonArray::push_front(const QJsonValue &t)

removeAt

Signature: void removeAt (int i)

Description: Method void QJsonArray::removeAt(int i)

removeFirst

Signature: void removeFirst

Description: Method void QJsonArray::removeFirst()

removeLast

Signature: void removeLast

Description: Method void QJsonArray::removeLast()

replace

Signature: void replace (int i, const QJsonValue value)

Description: Method void QJsonArray::replace(int i, const QJsonValue &value)

size

Signature: [const] int size

Description: Method int QJsonArray::size()

Python specific notes:
This method is also available as 'len(object)'.

swap

Signature: void swap (QJsonArray other)

Description: Method void QJsonArray::swap(QJsonArray &other)

takeAt

Signature: QJsonValue takeAt (int i)

Description: Method QJsonValue QJsonArray::takeAt(int i)

toVariantList

Signature: [const] variant[] toVariantList

Description: Method QList<QVariant> QJsonArray::toVariantList()