Obsolete Members for QJniEnvironment

QJniEnvironment クラスの以下のメンバーは非推奨となっています。これらは、古いソースコードが動作し続けるように提供されているものです。新しいコードでの使用は強く推奨しません。

パブリック関数

(deprecated in 6.2) bool registerNativeMethods(const char *className, JNINativeMethod[] methods, int size)

メンバー関数のドキュメント

[deprecated in 6.2] bool QJniEnvironment::registerNativeMethods(const char *className, JNINativeMethod[] methods, int size)

この関数はバージョン 6.2 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

代わりに、const JNINativeMethod[] を使用するオーバーロードをご利用ください。

サイズsize の配列methods 内の Java メソッドを登録します。これらのメソッドはそれぞれ、クラスclassName のネイティブ C++ 関数を呼び出すことができます。これらのメソッドは、呼び出しを試みる前に登録しておく必要があります。

登録に成功した場合は `true ` を返し、失敗した場合は `false` を返します。

methods配列の各要素は、以下の構成となっています:

  • Javaメソッド名
  • メソッドのシグネチャ
  • 実行されるC++関数
JNINativeMethod methods[] = {{"callNativeOne", "(I)V", reinterpret_cast<void *>(fromJavaOne)},
                             {"callNativeTwo", "(I)V", reinterpret_cast<void *>(fromJavaTwo)}};
QJniEnvironment env;
env.registerNativeMethods("org/qtproject/android/TestJavaClass", methods, 2);

これはオーバーロードされた関数です。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.