开发者

Qt Jambi and threads

开发者 https://www.devze.com 2023-01-24 02:24 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号