java.lang.Object
io.qt.QtObject
io.qt.core.QFunctionPointer
- All Implemented Interfaces:
QtObjectInterface
Java wrapper for Qt callable QFunctionPointer
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends QtObjectInterface>
Tcast
(QtObjectInterface function, Class<T> functionalInterface) Converts the given function into given functional interface type.final <T extends QtObjectInterface>
TConverts this function pointer into given functional interface type.void
invoke()
final <R> R
invoke
(QGenericReturnType<R> returnType, Object... arguments) Invokes the underlying function pointer with given arguments.final <R> R
Overloaded function forinvoke(QGenericReturnType.of(returnType), arguments)
.final void
Overloaded function forinvoke(void.class, arguments)
.Methods inherited from class io.qt.QtObject
dispose, equals, isDisposed
-
Method Details
-
invoke
@QtDeclaredFinal @QtUninvokable public final void invoke(Object... arguments) throws QUnsuccessfulInvocationException Overloaded function forinvoke(void.class, arguments)
.- Parameters:
arguments
-- Throws:
QUnsuccessfulInvocationException
-
invoke
@QtDeclaredFinal @QtUninvokable public final <R> R invoke(Class<R> returnType, Object... arguments) throws QUnsuccessfulInvocationException Overloaded function forinvoke(QGenericReturnType.of(returnType), arguments)
.- Parameters:
returnType
-arguments
-- Throws:
QUnsuccessfulInvocationException
-
invoke
@QtUninvokable public final <R> R invoke(QGenericReturnType<R> returnType, Object... arguments) throws QUnsuccessfulInvocationException Invokes the underlying function pointer with given arguments.
Object types are used as pointers, value types as call-by-value. This also applies for the return value.
Use
QGenericArgument
to specify call-by-reference. E.g.QGenericArgument.value("any string").asConstRef()
forconst QString&
Requires Java Native Access library (JNA) in class path.
- Parameters:
returnType
-arguments
- argument values or wrapped as QGenericArgument- Throws:
QUnsuccessfulInvocationException
-
cast
Converts this function pointer into given functional interface type.- Parameters:
functionalInterface
-- Returns:
- converted function pointer
-
cast
@QtUninvokable public static <T extends QtObjectInterface> T cast(QtObjectInterface function, Class<T> functionalInterface) Converts the given function into given functional interface type.- Parameters:
functionalInterface
-- Returns:
- converted function pointer
-
invoke
public void invoke()
-