Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.9
-
-
e02813eeb (dev), c28225e46 (6.8), 08f085918 (dev), 8fa8607c8 (6.8)
Description
Steps
- Build and launch any example that has a 0-parameter signal from QML to Java, e.g. qtdeclarative/examples/platforms/android/qtquickview_java
- Press the button that causes the onClicked() signal to be sent
Expected Result
- No warnings.
Actual Result
libqtquick..._x86_64.so com.example.qtquickview_java W Mismatching argument types between QML signal (onClicked()) and the Java function (java/lang/Void). Sending null as argument.
Probable cause
In QAndroidViewSignalManager::invokeListener, where this warning is printed, we don't handle this case correctly. In this case the generated Java/Kotlin code expects the user to supply a QtSignalListener<Void>, which will have a method onSignalEmitted(String, Void). But the C++ side does not recognize that Void can be a type when getting the value for that parameter, and so the variable "jValue" ends up being invalid and that results in this warning.
Probably either the QtSignalListener<Void> has to be replaced with a QtSignalListener without a type parameter, or QAndroidTypeConverter::toJavaObject has to be extended to handle Void types along with adding a Void overload to QAndroidViewSignalManager methods.
Attachments
Issue Links
- relates to
-
QTBUG-127142 OnClickedListener and multiple buttons
- Closed