Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
6.7.0
-
-
7d9cedec6 (dev), e08da3550 (6.7)
-
2024wk16FOQtforAndroid
Description
The following code compiles fine with Qt 6.6.0:
QJniObject getUriForFile(const QString &fileProvider, const QJniObject &java_io_File) { return QJniObject::callStaticObjectMethod( "androidx/core/content/FileProvider", "getUriForFile", "(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;)Landroid/net/Uri;", QNativeInterface::QAndroidApplication::context(), QJniObject::fromString(fileProvider).object(), java_io_File.object()); }
now it complains with:
error: cannot pass object of non-trivial type 'QtJniTypes::Context' through variadic function; call will abort at runtime [-Wnon-pod-varargs]
It seems it either picked a different overload or Qt6.7 has different flags, either way passing context is quite common, would be nice to have documented on how to do it now, my search didn't helped me much but seems I need to register this type, which again "maybe" should be done by Qt?