Qt Jambi and threads
I'm trying to create a Qt widget in C++ as a child of a Jambi widget. Passing the parent's native pointer into a JNI method seems to be the straightforward approach, but Qt complains about creating the widget on a different thread than the parent.
Does JNI run methods on a different thread than the Java code? Or is Jambi doing some trickery behind the scenes and my Java Qt calls are really being invoked on a different thread? O开发者_如何转开发r something else? What's going on here, and what can I do about it?
Quit writing your own JNI, use The Qt Jambi Generator to generate stub for your C++ Widget and do all your code in java.
精彩评论