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 <assam.boudjelthia@qt.io>
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%