QJniArrayBase Class
Die Klasse „QJniArrayBase“ stellt allgemeine, typunabhängige APIs für „ QJniArray “ bereit. Mehr...
| Header: | #include <QJniArrayBase> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Seit: | Qt 6.8 |
| Vererbt an: |
Öffentliche Typen
Öffentliche Funktionen
| bool | isEmpty() const |
| bool | isValid() const |
| T | object() const |
| QJniArrayBase::size_type | size() const |
| operator QJniObject() const |
Statische öffentliche Mitglieder
| auto | fromContainer(Container &&container) |
Geschützte Funktionen
| QJniArrayBase() | |
| QJniArrayBase(const QJniArrayBase &other) | |
| QJniArrayBase(QJniArrayBase &&other) | |
| ~QJniArrayBase() | |
| void | swap(QJniArrayBase &other) |
| QJniArrayBase & | operator=(QJniArrayBase &&other) |
| QJniArrayBase & | operator=(const QJniArrayBase &other) |
Dokumentation zu den Member-Funktionen
[noexcept protected default] QJniArrayBase::QJniArrayBase()
Erstellt standardmäßig eine Instanz von ` QJniArrayBase`.
[explicit noexcept protected default] QJniArrayBase::QJniArrayBase(const QJniArrayBase &other)
Erzeugt eine Instanz von „ QJniArrayBase “ durch Kopieren.
[explicit noexcept protected default] QJniArrayBase::QJniArrayBase(QJniArrayBase &&other)
Erstellt eine Instanz von „ QJniArrayBase “ mithilfe des „Move“-Konstruktors.
[noexcept protected default] QJniArrayBase::~QJniArrayBase()
Löscht die Instanz von „ QJniArrayBase “.
[static] template <typename Container> requires if_compatible_source_container<Container> auto QJniArrayBase::fromContainer(Container &&container)
Erstellt ein Java-Array, das die Daten unter container enthält, und gibt eine Instanz von „ QJniArray “ zurück, die dieses Array umschließt.
Einschränkungen
Nimmt nur dann an der Überladungsauflösung teil, wenn ` Container ` ein Container ist, der Elemente vom Typ ` JNI type ` oder einem äquivalenten C++-Typ speichert und einen Vorwärtsiterator bereitstellt.
Die Spezialisierung des konstruierten ` QJniArray ` hängt vom Werttyp des ` container` ab. Bei einem ` Container<T> ` (wie z. B. ` QList<T>`) ist dies typischerweise ` QJniArray<T>`, mit folgenden Ausnahmen:
| Container | Spezialisierung |
|---|---|
| QByteArray | QJniArray<jbyte> |
| QStringList | QJniArray<jstring> |
| Container::value_type | Spezialisierung |
| QJniObject | QJniArray<jobject> |
Siehe auch ` QJniArray::toContainer()`.
bool QJniArrayBase::isEmpty() const
Gibt „ true “ zurück, wenn das Array die Größe 0 hat; andernfalls wird „ false “ zurückgegeben.
Ein Array vom Typ ` invalid ` ist immer leer.
isValid(), size()
bool QJniArrayBase::isValid() const
Gibt zurück, ob das Objekt ` QJniArray ` ein gültiges `jobject` umschließt. Bei ungültigen ` QJniArray `-Instanzen gibt ` object()` den Wert ` nullptr` zurück. Das Durchlaufen eines ungültigen Objekts ist sicher (`begin()` liefert denselben Wert wie `end()`), und der Aufruf von ` toContainer()` für ein ungültiges Array liefert einen leeren Container zurück.
Siehe auch QJniObject::isValid(), object() und QJniArray::toContainer().
template <typename T = jobject> T QJniArrayBase::object() const
Gibt das vom ` QJniArray ` gehaltene Objekt vom Typ `T` zurück, wobei es sich um einen der folgenden Typen handeln kann: ` JNI Object Types`.
QJniArrayBase::size_type QJniArrayBase::size() const
Gibt die Größe des Arrays zurück.
[noexcept protected] void QJniArrayBase::swap(QJniArrayBase &other)
Tauscht dieses Array-Objekt mit „ other “ aus. Dieser Vorgang ist sehr schnell und schlägt niemals fehl.
QJniArrayBase::operator QJniObject() const
Gibt ein ` QJniObject ` zurück, das dasselbe ` jobject ` umschließt wie diese ` QJniArray `-Instanz.
[noexcept protected default] QJniArrayBase &QJniArrayBase::operator=(QJniArrayBase &&other)
Weist „ other “ dieser „ QJniArrayBase “-Instanz zu.
[noexcept protected default] QJniArrayBase &QJniArrayBase::operator=(const QJniArrayBase &other)
other Weist dieser „ QJniArrayBase “-Instanz den Wert „ “ zu. zu dieser „ “-Instanz.
© 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.