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

List:       kde-bindings
Subject:    Re: [Kde-bindings] Qyoto: SIGNALS/SLOTS
From:       Arno Rehn <arno () arnorehn ! de>
Date:       2005-12-30 13:36:53
Message-ID: 200512301436.53590.arno () arnorehn ! de
[Download RAW message or body]

Am Freitag, 30. Dezember 2005 12:12 schrieb Richard Dale:
> On Friday 30 December 2005 11:05, Richard Dale wrote:
> > On Thursday 29 December 2005 23:19, Arno Rehn wrote:
> > > > 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.
> > >
> > > By the way, how do we get the other types like a string out of the
> > > struct in C++, when we call a method in C# like 'SetText' ? The
> > > GCHandle of the string is stored in s_intptr in the C#-struct, but
> > > there is no equivalent for this in the C++-struct. How can we access it
> > > in C++ then ?
> >
> > Have a look at the code the marshall_basetype() function in
> > qt3handlers.cpp:
> >
> > 		smokeqyoto_object *o = value_obj_info(m->var().s_class);
> >
> > value_obj_info() in qt3qyoto.cpp obtains the smokeqyoto_object for the C#
> > instance with a callback, and then the C++ instance is 'o->ptr'.
> >
> > smokeqyoto_object *value_obj_info(void * qyoto_value) {
> >     smokeqyoto_object * o = (smokeqyoto_object*) (*GetSmokeObject)
> > (qyoto_value);
> >     return o;
> > }
>
> Actually I've described getting a C++ QWidget from a C# one, not how to get
> a QString from a C# string. See marshall_QString() for where that's done.
>
Yeah, found out about this last night ;)

-- 
MfG
Arno Rehn
arno@arnorehn.de
_______________________________________________
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