JNI: add swap to QJniArray

It's a value type and should implement swap.

Change-Id: I811377843b6ede1d6d750a701ae7a6b12434f4e6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0789dd8723b03d255ff203c717c5e12b6945015e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2024-07-10 16:30:35 +02:00 committed by Qt Cherry-pick Bot
parent 92b1923e31
commit 2a677940a0
2 changed files with 8 additions and 0 deletions

View File

@ -237,6 +237,8 @@ protected:
template <typename List>
static auto makeObjectArray(List &&list);
void swap(QJniArrayBase &other) noexcept { m_object.swap(other.m_object); }
private:
QJniObject m_object;
};

View File

@ -58,6 +58,12 @@
\return a QJniObject wrapping the same \c{jobject} as this QJniArray instance.
*/
/*!
\fn void QJniArrayBase::swap(QJniArrayBase &other)
Swaps this array object with \a other. This function is very fast and never fails.
*/
/*!
\fn template <typename T> T QJniArrayBase::object() const