Question

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? Or something else? What's going on here, and what can I do about it?

Was it helpful?

Solution

Quit writing your own JNI, use The Qt Jambi Generator to generate stub for your C++ Widget and do all your code in java.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top