[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bindings
Subject:    Re: [Kde-bindings] Qyoto: SIGNALS/SLOTS
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2005-12-29 13:26:45
Message-ID: 200512291326.46166.Richard_Dale () tipitina ! demon ! co ! uk
[Download RAW message or body]

On Tuesday 27 December 2005 00:31, Arno Rehn wrote:
> Ok, another question:
> Today I tried to get return values working. I modified 'CallMethod' in
> qt3qyoto.cpp to get the return value of 'MethodCall.var()' in
> SmokeInvocation.cs. That worked and I can get the value of methods which
> return an 'int' (I haven't tested other types) via the StackItem-struct. I
> think it will also go well with 'long', 'byte', etc. But when the method
> returns a string I don't know what to do. How do I get a string out of
> 'StackItem' ?
> See attached files.
OK thanks for that - I've just checked in a change to implement return types, 
but have done it a bit differently to what you had. 

What should have been happening is that the MethodReturnCall class should have 
been modifying the zeroth entry of the array of SmokeItems passed to 
CallMethod(). Then you don't need to use MethodCall.var() to return it. 

A QString return value would be marshalled to a C# string, which would be in a 
GCHandle in the 's_class' field of the C# array of SmokeItems. Similary Qt 
instances like QWidget need to end up as GCHandles in the 's_class' field. 
Primitive types are held directly in 's_int' or whatever in the SmokeItem. 
The only difference between the C++ array of SmokeItems, and the one built up 
in C# in SmokeInvocation.cs, is that non-primitive types are held as 
GCHandles, rather than as C++ pointers.

-- Richard
_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic