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

QAndroidApplication::context() doesn't have all methods of QJniObject

XMLWordPrintable

    • Android
    • 2025wk40s2-3QtforAndroid

      Docs say that QAndroidApplication::context() returns QJniObject. This class has callMethod overload that accepts signature parameter. But attempt to use it on the returned context object results in an error:

      /Users/andrey.filipenkov/dev/other/vcmi/launcher/main.cpp:43:51: error: no matching member function for call to 'callMethod'
              QNativeInterface::QAndroidApplication::context().callMethod<void>("test", "(Z)V", true);
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
      /Users/andrey.filipenkov/dev/Qt-libs/6.9.2/android_arm64_v8a/include/QtCore/qjniobject.h:791:10: note: candidate template ignored: requirement 'ValidSignatureTypesDetail<void, char[5], bool>' was not satisfied [with Ret = void, Args = <const char (&)[5], bool>]
          auto callMethod(const char *method, Args &&...args) const
               ^
      1 error generated.
      

      Seems that JObject class is missing method overload that accepts signature parameter.

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

            qtandroidteam Qt Android Team
            kambala Andrey Filipenkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes