Document QJniObject::construct

Added for 6.4. Not extremely useful as long as the macros that allow
the declaration of new class and type strings also being documented.

Pick-to: 6.4
Change-Id: I9ee466fdd0aaccec1e627ceb313b5a5c17e3f3fa
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Volker Hilsheimer 2022-06-19 12:23:47 +02:00
parent e0a729dfd2
commit 145bfe6054

View File

@ -761,6 +761,21 @@ QJniObject::QJniObject(jobject object)
env->DeleteLocalRef(cls);
}
/*!
\fn template<typename Class, typename ...Args> static inline QJniObject construct(Args &&...args)
\since 6.4
Constructs an instance of the Java class that is the equivalent of \c Class and
returns a QJniObject containing the JNI object. The arguments in \a args are
passed to the Java constructor.
\code
QJniObject javaString = QJniObject::construct<jstring>();
\endcode
This function is only available if all \a args are known \l {JNI Types}.
*/
/*!
\brief Get a JNI object from a jobject variant and do the necessary
exception clearing and delete the local reference before returning.