このページでは

QJniArrayBase Class

QJniArrayBase クラスは、QJniArray に対して、型に依存しない共通の API を提供します。詳細...

ヘッダー: #include <QJniArrayBase>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
以下のように: Qt 6.8
継承元:

QJniArray

パブリック型

パブリック関数

bool isEmpty() const
bool isValid() const
T object() const
QJniArrayBase::size_type size() const
operator QJniObject() const

静的パブリックメンバー

auto fromContainer(Container &&container)

プロテクトされた関数

QJniArrayBase()
QJniArrayBase(const QJniArrayBase &other)
QJniArrayBase(QJniArrayBase &&other)
~QJniArrayBase()
void swap(QJniArrayBase &other)
QJniArrayBase &operator=(QJniArrayBase &&other)
QJniArrayBase &operator=(const QJniArrayBase &other)

詳細な説明

メンバ型のドキュメント

[alias] QJniArrayBase::size_type

32 ビットの整数。

メンバ関数のドキュメント

[noexcept protected default] QJniArrayBase::QJniArrayBase()

QJniArrayBase のインスタンスをデフォルトコンストラクタで生成します。

[explicit noexcept protected default] QJniArrayBase::QJniArrayBase(const QJniArrayBase &other)

QJniArrayBase のインスタンスをコピーして生成します。

[explicit noexcept protected default] QJniArrayBase::QJniArrayBase(QJniArrayBase &&other)

QJniArrayBase のインスタンスをMoveコンストラクタで生成します。

[noexcept protected default] QJniArrayBase::~QJniArrayBase()

QJniArrayBase のインスタンスを破棄します。

[static] template <typename Container> requires if_compatible_source_container<Container> auto QJniArrayBase::fromContainer(Container &&container)

container 内のデータを格納するJava配列を作成し、それをラップするQJniArray インスタンスを返します。

制約

Container が、JNI type または同等の C++ 型の要素を格納し、フォワード・イテレータを提供するコンテナである場合にのみ、オーバーロード解決の対象となります。

構築されるQJniArray の特殊化は、container の値型に依存します。Container<T> (例:QList<T> )の場合、通常はQJniArray<T> となりますが、以下の例外があります:

コンテナ特殊化
QByteArrayQJniArray<jbyte>
QStringListQJniArray<jstring>
コンテナ::value_type特殊化
QJniObjectQJniArray<jobject>

QJniArray::toContainer()も参照してください 。

bool QJniArrayBase::isEmpty() const

配列のサイズが 0 の場合は `true ` を返し、それ以外の場合は `false` を返します。

invalid の配列は常に空です。

isValid(),size()

bool QJniArrayBase::isValid() const

QJniArray オブジェクトが有効な`jobject`をラップしているかどうかを返します。無効なQJniArray インスタンスの場合、object()はnullptr を返します。無効なオブジェクトを反復処理しても安全です(begin()はend()と同じ値を返します)。また、無効な配列に対してtoContainer()を呼び出すと、空のコンテナが返されます。

QJniObject::isValid()、object()、およびQJniArray::toContainer()も参照してください 。

template <typename T = jobject> T QJniArrayBase::object() const

QJniArray が保持するオブジェクトを型Tとして返します。この型は、JNI Object Types のいずれかになります。

QJniArrayBase::size_type QJniArrayBase::size() const

配列のサイズを返します。

[noexcept protected] void QJniArrayBase::swap(QJniArrayBase &other)

この配列オブジェクトをother と入れ替えます。この操作は非常に高速で、失敗することはありません。

QJniArrayBase::operator QJniObject() const

このQJniArray インスタンスと同じjobject をラップする、QJniObject を返します。

[noexcept protected default] QJniArrayBase &QJniArrayBase::operator=(QJniArrayBase &&other)

other をこのQJniArrayBase インスタンスに割り当てます。

[noexcept protected default] QJniArrayBase &QJniArrayBase::operator=(const QJniArrayBase &other)

other をこのQJniArrayBase インスタンスにコピーして割り当てます。

© 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.