java.lang.Object
io.qt.internal.NativeUtility.Object
io.qt.QtObject
io.qt.core.QFunctionPointer
- All Implemented Interfaces:
QtObjectInterface
Java wrapper for Qt function pointer QFunctionPointer
-
Nested Class Summary
Nested classes/interfaces inherited from class io.qt.QtObject
QtObject.QPrivateConstructor
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends QtObjectInterface>
Tcast
(QtObjectInterface function, Class<T> functionalInterface) Converts the given function into given functional interface type.<T extends QtObjectInterface>
TConverts this function pointer into given functional interface type.void
invoke()
<R> R
invoke
(QGenericReturnType<R> returnType, Object... arguments) Invokes the underlying function pointer with given arguments.<R> R
Overloaded function forinvoke(QGenericReturnType.of(returnType), arguments)
.void
Overloaded function forinvoke(void.class, arguments)
.Methods inherited from class io.qt.QtObject
dispose, equals, isDisposed
-
Method Details
-
invoke
@QtDeclaredFinal @QtUninvokable public void invoke(Object... arguments) throws QUnsuccessfulInvocationException Overloaded function forinvoke(void.class, arguments)
.- Parameters:
arguments
-- Throws:
QUnsuccessfulInvocationException
-
invoke
@QtDeclaredFinal @QtUninvokable public <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 <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()
-