Auf dieser Seite

QJsonArray::const_iterator Class

class QJsonArray::const_iterator

Die Klasse „ QJsonArray::const_iterator “ stellt einen const-Iterator im STL-Stil für „ QJsonArray “ bereit. Mehr...

QJsonArray::const_iterator – Vergleiche

KategorieVergleichbare Typen
starkQJsonArray::const_iterator
strongQJsonArray::iterator.

Öffentliche Typen

Öffentliche Funktionen

const_iterator()
const_iterator(const QJsonArray::iterator &other)
const_iterator(const QJsonArray::const_iterator &other)
const QJsonValueConstRef operator*() const
QJsonArray::const_iterator operator+(qsizetype j) const
QJsonArray::const_iterator &operator++()
QJsonArray::const_iterator operator++(int)
QJsonArray::const_iterator &operator+=(qsizetype j)
qsizetype operator-(QJsonArray::const_iterator other) const
QJsonArray::const_iterator operator-(qsizetype j) const
QJsonArray::const_iterator &operator--()
QJsonArray::const_iterator operator--(int)
QJsonArray::const_iterator &operator-=(qsizetype j)
const QJsonValueConstRef *operator->() const
QJsonValueConstRef operator[](qsizetype j) const
bool operator!=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
bool operator<(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
bool operator<=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
bool operator==(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
bool operator>(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)
bool operator>=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Ausführliche Beschreibung

QJsonArray::const_iterator ermöglicht es Ihnen, einen ` QJsonArray` zu durchlaufen. Wenn Sie den ` QJsonArray ` während des Durchlaufs ändern möchten, verwenden Sie stattdessen ` QJsonArray::iterator `. Es ist generell empfehlenswert, ` QJsonArray::const_iterator ` auch für einen nicht-konstanten ` QJsonArray ` zu verwenden, es sei denn, Sie müssen den ` QJsonArray ` über den Iterator ändern. Konstante Iteratoren sind etwas schneller und verbessern die Lesbarkeit des Codes.

Der Standardkonstruktor von ` QJsonArray::const_iterator ` erstellt einen nicht initialisierten Iterator. Sie müssen ihn mithilfe einer Funktion wie ` QJsonArray ` (z. B. ` QJsonArray::constBegin()`, ` QJsonArray::constEnd()` oder ` QJsonArray::insert()`) initialisieren, bevor Sie mit der Iteration beginnen können.

Die meisten „ QJsonArray “-Funktionen akzeptieren einen ganzzahligen Index anstelle eines Iterators. Aus diesem Grund sind Iteratoren in Verbindung mit „ QJsonArray “ selten nützlich. Ein Bereich, in dem Iteratoren im STL-Stil durchaus sinnvoll sind, ist als Argumente für „ generic algorithms “.

Für dasselbe Array können mehrere Iteratoren verwendet werden. Beachten Sie jedoch, dass jeder nicht-konstante Funktionsaufruf, der auf dem ` QJsonArray ` ausgeführt wird, alle vorhandenen Iteratoren undefiniert macht.

Siehe auch QJsonArray::iterator.

Dokumentation zu Mitgliedstypen

const_iterator::iterator_category

Ein Synonym für „std::random_access_iterator_tag“, das angibt, dass es sich bei diesem Iterator um einen Iterator mit wahlfreiem Zugriff handelt.

Dokumentation zu den Mitgliedsfunktionen

const_iterator::const_iterator()

Erstellt einen nicht initialisierten Iterator.

Funktionen wie `operator*()` und `operator++()` sollten nicht auf einem nicht initialisierten Iterator aufgerufen werden. Verwenden Sie `operator=()`, um ihm vor der Verwendung einen Wert zuzuweisen.

Siehe auch ` QJsonArray::constBegin()` und ` QJsonArray::constEnd()`.

const_iterator::const_iterator(const QJsonArray::iterator &other)

Erstellt eine Kopie von „ other “.

[constexpr noexcept default] const_iterator::const_iterator(const QJsonArray::const_iterator &other)

Erstellt eine Instanz von „ const_iterator “ durch Kopieren.

const QJsonValueConstRef const_iterator::operator*() const

Gibt das aktuelle Element zurück.

QJsonArray::const_iterator const_iterator::operator+(qsizetype j) const

Gibt einen Iterator für das Element zurück, das sich j Positionen vor diesem Iterator befindet. Ist j negativ, bewegt sich der Iterator rückwärts.

Siehe auch ` operator-()` und ` operator+=()`.

QJsonArray::const_iterator &const_iterator::operator++()

Der Präfixoperator „ ++ “ ( ++it) verschiebt den Iterator zum nächsten Element im Array und gibt einen Iterator auf das neue aktuelle Element zurück.

Der Aufruf dieser Funktion auf ` QJsonArray::end()` führt zu undefinierten Ergebnissen.

Siehe auch operator--().

QJsonArray::const_iterator const_iterator::operator++(int)

Der Postfix- ++ -Operator it++ verschiebt den Iterator zum nächsten Element im Array und gibt einen Iterator auf das zuvor aktuelle Element zurück.

Dies ist eine überladene Funktion.

QJsonArray::const_iterator &const_iterator::operator+=(qsizetype j)

Bewegt den Iterator um j Elemente vorwärts. Ist j negativ, bewegt sich der Iterator rückwärts.

Siehe auch ` operator-=()` und ` operator+()`.

qsizetype const_iterator::operator-(QJsonArray::const_iterator other) const

Gibt die Anzahl der Elemente zwischen dem Element zurück, auf das „ other “ verweist, und dem Element, auf das dieser Iterator verweist.

QJsonArray::const_iterator const_iterator::operator-(qsizetype j) const

Gibt einen Iterator für das Element zurück, das sich j Positionen rückwärts von diesem Iterator befindet. Ist j negativ, bewegt sich der Iterator vorwärts.

Siehe auch operator+() und operator-=().

QJsonArray::const_iterator &const_iterator::operator--()

Der Präfixoperator „ -- “, --it, macht das vorhergehende Element zum aktuellen Element und gibt einen Iterator auf das neue aktuelle Element zurück.

Der Aufruf dieser Funktion mit ` QJsonArray::begin()` führt zu undefinierten Ergebnissen.

Siehe auch ` operator++()`.

QJsonArray::const_iterator const_iterator::operator--(int)

Der Postfix-Operator „ -- “ ( it--) macht das vorangehende Element zum aktuellen Element und gibt einen Iterator auf das zuvor aktuelle Element zurück.

Dies ist eine überladene Funktion.

QJsonArray::const_iterator &const_iterator::operator-=(qsizetype j)

Bewegt den Iterator um j Elemente zurück. Ist j negativ, bewegt sich der Iterator vorwärts.

Siehe auch ` operator+=()` und ` operator-()`.

const QJsonValueConstRef *const_iterator::operator->() const

Gibt einen Zeiger auf das aktuelle Element zurück.

QJsonValueConstRef const_iterator::operator[](qsizetype j) const

Gibt das Element am Offset j aus dem Element zurück, auf das dieser Iterator zeigt (das Element an der Position *this + j).

Diese Funktion wird bereitgestellt, damit sich QJsonArray -Iteratoren wie C++-Zeiger verhalten.

Siehe auch operator+().

Verwandte Nicht-Mitglieder

[noexcept] bool operator!=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Gibt „ true “ zurück, wenn „ lhs “ auf ein anderes Element verweist als der Iterator „ rhs “; andernfalls wird „ false “ zurückgegeben.

Siehe auch operator==().

[noexcept] bool operator<(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Gibt „ true “ zurück, wenn das Element, auf das der Iterator „ lhs “ verweist, kleiner ist als das Element, auf das der Iterator „ rhs “ verweist.

[noexcept] bool operator<=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Gibt „ true “ zurück, wenn das Element, auf das der Iterator „ lhs “ zeigt, kleiner oder gleich dem Element ist, auf das der Iterator „ rhs “ zeigt.

[noexcept] bool operator==(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Gibt „ true “ zurück, wenn „ lhs “ auf dasselbe Element verweist wie der Iterator „ rhs “; andernfalls wird „ false “ zurückgegeben.

Siehe auch operator!=().

[noexcept] bool operator>(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Gibt „ true “ zurück, wenn das Element, auf das der Iterator „ lhs “ verweist, größer ist als das Element, auf das der Iterator „ rhs “ verweist.

[noexcept] bool operator>=(const QJsonArray::const_iterator &lhs, const QJsonArray::const_iterator &rhs)

Gibt „ true “ zurück, wenn das Element, auf das der Iterator „ lhs “ verweist, größer oder gleich dem Element ist, auf das der Iterator „ rhs “ verweist.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.