The QJniArrayBase class provides common, type-independent APIs for QJniArray. More...
| Header: | #include <QJniArrayBase> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core)target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Since: | Qt 6.8 |
| Inherited By: |
| bool | isEmpty() const |
| bool | isValid() const |
| T | object() const |
| QJniArrayBase::size_type | size() const |
| QJniObject | operator QJniObject() const |
| auto | fromContainer(Container &&container) |
| void | swap(QJniArrayBase &other) |
[alias] QJniArrayBase::size_typeA 32 bit integer.
[static] template <typename Container, QJniArrayBase::if_compatible_source_container<Container> = true> auto QJniArrayBase::fromContainer(Container &&container)Creates a Java array holding the data in container, and returns a QJniArray instance that wraps it.
This function only participates in overload resolution if Container is a container that stores elements of a JNI type or equivalent C++ type, and
provides a forward iterator.
The specialization of the constructed QJniArray depends on the value type of the container. For a Container<T> (such as e.g.
QList<T>) it will typically be QJniArray<T>, with the following exceptions:
| Container | Specialization |
|---|---|
| QByteArray | QJniArray<jbyte> |
| QStringList | QJniArray<jstring> |
| Container::value_type | Specialization |
| QJniObject | QJniArray<jobject> |
See also QJniArray::toContainer().
Returns true if the array has size 0; otherwise returns false.
An invalid array is always empty.
isValid(), size()
Returns whether the QJniArray object wraps a valid `jobject`. For invalid QJniArray instances, object() returns
nullptr. Iterating over an invalid object is safe (begin() will return the same as end()), and calling toContainer() on an invalid array will return an
empty container.
See also QJniObject::isValid(), object(), and QJniArray::toContainer().
Returns the object held by the QJniArray as type T, which can be one of the JNI Object Types.
Returns the size of the array.
[noexcept protected] void QJniArrayBase::swap(QJniArrayBase
&other)Swaps this array object with other. This operation is very fast and never fails.
Returns a QJniObject wrapping the same jobject as this QJniArray instance.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: