diff options
author | Petri Virkkunen <[email protected]> | 2025-05-08 12:06:51 +0300 |
---|---|---|
committer | Petri Virkkunen <[email protected]> | 2025-06-10 18:09:25 +0300 |
commit | 2c6be851ae4b9e6f8c5fcbc24a306dad3c6fc865 (patch) | |
tree | 2401de0b0d4d36d63e6dc2431c14c0dc7f33d509 /examples/vulkan/hellovulkancubes/main.cpp | |
parent | 8d5db24c14d5c7ea8a2abf55e4fd88472dd9ca8b (diff) |
This commit introduces support for generating Java code for
multi-argument QML signals.
Pre-existing code remains unchanged, and the new code is only executed
when the number of params in a signal is above 1.
Multi-arg signals are handled with a new generated interface type,
named after the signal, which has a default method that takes an
Object[] array and calls the user-implemented signal method with the
arguments cast to the desired types.
For example, a QML signal with the following signature:
signal manyTypeArgSignal(intValue: int, boolValue: bool,
doubleValue: double, stringValue: string)
Is generated into this Java code:
@FunctionalInterface
public interface manyTypeArgSignalListener {
default void onSignalEmitted(Object[] args) {
onSignalEmitted((Integer) args[0], (Boolean) args[1], (Double) args[2], (String) args[3]);
}
void onManyTypeArgSignal(Integer intValue, Boolean boolValue, Double doubleValue, String stringValue);
}
public int connectManyTypeArgSignalListener(manyTypeArgSignalListener signalListener) {
return connectSignalListener("manyTypeArgSignal", new Class[]{ Integer.class, Boolean.class, Double.class, String.class }, signalListener);
}
Task-number: QTBUG-124489
Change-Id: I94e3e88e807017bcbeba16cf0e34263e28e5885f
Reviewed-by: Assam Boudjelthia <[email protected]>
Diffstat (limited to 'examples/vulkan/hellovulkancubes/main.cpp')
0 files changed, 0 insertions, 0 deletions