[Qt-jambi-interest] QNativePointer to void*

Gunnar Sletta gunnar at trolltech.com
Wed Aug 20 07:34:58 CEST 2008


Karim Andras Pinter wrote:
> Thanks for your fast relpy!
> I meant that there is a Java function which returns QNativePointer and what is returned should be accessed directly on the c++ side without copying as a void*.
> Is there any opportunity to reach Java data directly as a pointer without copying the data using Jambi? (or is it necessary to use JNI?)
> If yes how would the typeset look like?
> 
> Lets say:
> Java: void Converter( QNativePointer qnp )
> c++: void Converter( void* qnp )
> 
> How the typeset would look like?
> 
> I hope I managed to explain my problem more correctly :-)

I don't completely understand, no ;-)

Your java function above takes an argument and returns nothing. Do you 
mean that the C++ function has an out-value?

If you declare a void* in a C++ file and map this using the generator 
you will have a QNativePointer with Pointer type in Java. There will be 
no copying of data between the two, so you should not need to do 
anything to achieve this.

best regards,
Gunnar



More information about the Qt-jambi-interest mailing list