Petri Virkkunen 2c6be851ae Android: Support multi-arg signal generation in androiddeployqt
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>
2025-06-10 18:09:25 +03:00
2024-11-05 14:36:16 +01:00
2025-05-30 18:16:40 +02:00
2025-06-05 00:07:53 +01:00
2025-03-24 23:19:04 +01:00
2025-04-09 13:49:11 +02:00
2024-06-25 11:44:00 +02:00
2025-05-25 23:09:56 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%