[EMAIL PROTECTED] wrote:
> Hi All,
> i've the following code
>
> class AdvertiseDetails
> {
>
> public:
> /* some methods*/
>
> };
>
>
> typedef
> QList<AdvertiseDetails> AdvertiseList;
>
> class AdvertiseInfo
> {
>
> public:
> static AdvertiseList parseXml(const QByteArray& answer);
>
> };
>
> generator produces the following not compiling code due to
> qtjambi_from_cpointer: impossible converting parameter 2 from
> AdvertaiseDetails
> to const void*
>
Is AdvertiseDetails declared an object-type in your type system? Object
types must consistently be passed by pointer, never by value. Not sure
how the rest of your code looks, but if this is indeed the issue, then
you must either declare the type as a value-type (passed by value,
constant reference or pointer (note: pointers to value types are
converted to QNativePointer in the Java API)) or the AdvertiseList type
has to be defined as QList<AdvertiseDetails *> instead.
If you are sure AdvertiseDetails is indeed an object-type and you still
want to store it in a list as values, then the only option is to
manually tweak the code produced by the generator to convert between
Java and C++. This will require some patience, and a bit of
understanding of both JNI and the Qt Jambi binding layer. The type
system tag in question is <conversion-rule>:
http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/qtjambi-typesystem.html#conversion-rule
and possibly <replace-type>
http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/qtjambi-typesystem.html#replace-type
Hope this helps!
-- Eskil
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest