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.