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 を返します。

メソッド配列の各要素は、以下から構成されます:

  • 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);

© 2025 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.