java.lang.Object
io.qt.core.QScopedArrayPointer<O>
- All Implemented Interfaces:
AutoCloseable
Java wrapper for Qt class QScopedArrayPointer to be used inside a try-with-resource block.
Example:
try(var pointer = QScopedArrayPointer.disposing(new QDialog(), new QColor())){
QDialog dialog = pointer.get(0);
dialog.exec();
}
// dialog is disposed
-
Method Summary
Modifier and TypeMethodDescriptionstatic <O> QScopedArrayPointer<O>
void
close()
O[]
data()
data
(int i) static <O extends QtObjectInterface>
QScopedArrayPointer<O>disposing
(O... data) static <O extends QObject>
QScopedArrayPointer<O>disposingLater
(O... data) O[]
get()
get
(int i) boolean
isNull()
static <O> void
performAndCleanup
(Consumer<O> cleanup, Consumer<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.static <O,
R> R performAndCleanup
(Consumer<O> cleanup, Function<O[], R> action, O... data) Performs an action on resources which will be cleaned up subsequently.static <O> double
performAndCleanup
(Consumer<O> cleanup, ToDoubleFunction<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.static <O> int
performAndCleanup
(Consumer<O> cleanup, ToIntFunction<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.static <O> long
performAndCleanup
(Consumer<O> cleanup, ToLongFunction<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.static <O extends QtObjectInterface>
voidperformAndDispose
(Consumer<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.static <O extends QtObjectInterface,
R>
RperformAndDispose
(Function<O[], R> action, O... data) Performs an action on resources which will be disposes subsequently.static <O extends QtObjectInterface>
doubleperformAndDispose
(ToDoubleFunction<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.static <O extends QtObjectInterface>
intperformAndDispose
(ToIntFunction<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.static <O extends QtObjectInterface>
longperformAndDispose
(ToLongFunction<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.static <O extends QObject>
voidperformAndDisposeLater
(Consumer<O[]> action, O... data) Performs an action on multipleQObject
resources which will be calledQObject.disposeLater()
subsequently.static <O extends QObject,
R>
RperformAndDisposeLater
(Function<O[], R> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.static <O extends QObject>
doubleperformAndDisposeLater
(ToDoubleFunction<O[]> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.static <O extends QObject>
intperformAndDisposeLater
(ToIntFunction<O[]> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.static <O extends QObject>
longperformAndDisposeLater
(ToLongFunction<O[]> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.final void
void
swap
(QScopedArrayPointer<O> other) O[]
take()
take
(int i)
-
Method Details
-
data
-
get
-
data
-
get
-
take
-
take
-
reset
-
isNull
-
swap
-
close
- Specified by:
close
in interfaceAutoCloseable
-
disposing
@SafeVarargs @QtUninvokable public static <O extends QtObjectInterface> QScopedArrayPointer<O> disposing(O... data) -
disposingLater
@SafeVarargs @QtUninvokable public static <O extends QObject> QScopedArrayPointer<O> disposingLater(O... data) -
cleanup
@SafeVarargs @QtUninvokable public static <O> QScopedArrayPointer<O> cleanup(Consumer<O> cleanup, O... data) -
performAndDispose
@SafeVarargs @QtUninvokable public static <O extends QtObjectInterface> void performAndDispose(Consumer<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.- Parameters:
action
- the actiondata
- multiple resources
-
performAndDisposeLater
@SafeVarargs @QtUninvokable public static <O extends QObject> void performAndDisposeLater(Consumer<O[]> action, O... data) Performs an action on multipleQObject
resources which will be calledQObject.disposeLater()
subsequently.- Parameters:
action
- the actiondata
- multiple resources
-
performAndCleanup
@SafeVarargs @QtUninvokable public static <O> void performAndCleanup(Consumer<O> cleanup, Consumer<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.- Parameters:
action
- the actiondata
- multiple resources
-
performAndDispose
@SafeVarargs @QtUninvokable public static <O extends QtObjectInterface,R> R performAndDispose(Function<O[], R> action, O... data) Performs an action on resources which will be disposes subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDisposeLater
@QtUninvokable @SafeVarargs public static <O extends QObject,R> R performAndDisposeLater(Function<O[], R> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndCleanup
@QtUninvokable @SafeVarargs public static <O,R> R performAndCleanup(Consumer<O> cleanup, Function<O[], R> action, O... data) Performs an action on resources which will be cleaned up subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDispose
@QtUninvokable @SafeVarargs public static <O extends QtObjectInterface> int performAndDispose(ToIntFunction<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDisposeLater
@QtUninvokable @SafeVarargs public static <O extends QObject> int performAndDisposeLater(ToIntFunction<O[]> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndCleanup
@QtUninvokable @SafeVarargs public static <O> int performAndCleanup(Consumer<O> cleanup, ToIntFunction<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDispose
@QtUninvokable @SafeVarargs public static <O extends QtObjectInterface> double performAndDispose(ToDoubleFunction<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDisposeLater
@QtUninvokable @SafeVarargs public static <O extends QObject> double performAndDisposeLater(ToDoubleFunction<O[]> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndCleanup
@QtUninvokable @SafeVarargs public static <O> double performAndCleanup(Consumer<O> cleanup, ToDoubleFunction<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDispose
@QtUninvokable @SafeVarargs public static <O extends QtObjectInterface> long performAndDispose(ToLongFunction<O[]> action, O... data) Performs an action on resources which will be disposes subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndDisposeLater
@QtUninvokable @SafeVarargs public static <O extends QObject> long performAndDisposeLater(ToLongFunction<O[]> action, O... data) Performs an action on aQObject
resource which will be calledQObject.disposeLater()
subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-
performAndCleanup
@QtUninvokable @SafeVarargs public static <O> long performAndCleanup(Consumer<O> cleanup, ToLongFunction<O[]> action, O... data) Performs an action on resources which will be cleaned up subsequently.- Parameters:
action
- the actiondata
- multiple resources- Returns:
- result
-