Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128586

Signals without arguments give false warnings in QML in Android

    XMLWordPrintable

Details

    • Android
    • e02813eeb (dev), c28225e46 (6.8), 08f085918 (dev), 8fa8607c8 (6.8)

    Description

      Steps

      1. Build and launch any example that has a 0-parameter signal from QML to Java, e.g. qtdeclarative/examples/platforms/android/qtquickview_java
      2. Press the button that causes the onClicked() signal to be sent

      Expected Result

      1. No warnings.

      Actual Result

      1. 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              soarmin Soheil Armin
              pevirkku Petri Virkkunen
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes