[Kde-bindings] Using generics in Qyoto

Richard Dale rdale at foton.es
Fri Jan 12 16:16:21 UTC 2007

On Friday 12 January 2007 15:43, Arno Rehn wrote:
> Am Donnerstag, 11. Januar 2007 14:30 schrieb Richard Dale:
> > On Thursday 11 January 2007 13:05, Arno Rehn wrote:
> > > > I think we just need to build Qyoto with gmcs instead of mcs, and
> > > > don't need to change anything much so it looks as though it should be
> > > > easy to switch.
> > >
> > > Good idea, but we would have to re-write some major parts of the
> > > list-marshallers. But that shouldn't be the problem.
> > > Anyway, I first try to get my dbus things to work
> >
> > Well I was assuming the marshallers wouldn't need a huge change, but
> > maybe I'm wrong. But I won't checkin that uses generics until you've
> > tracked down why your dbus doesn't work anyway.
> OK, as my dbus is now working, let's come back to generics.
> I see two possibilities for things like QLists and QPairs etc...
> We could parse those classes with Kalyptus and work with them like with any
> other class, when we request an element via QLists.At() it would probably
> get marshalled the normal way - that would not require a huge change in the
> marshalling functions - I think we could even just delete the ValueList
> Marshallers.
> The other possibility would be to create our own Lists<T>, but it would be
> quite difficult to marshall from a C++-QList to a C#-List<T>.
> I would prefer to just parse the Qt stuff with kalyptus and nothing more.
> We can then add some functions for interopability with C#, e.g. to cast a
> QList to an ArrayList and vice versa, so it is easier to use other
> libraries for Mono.
> Well, that's my opinion.
> Do you already have some code?
No, I haven't done anything other than to find out about the List<T> type in 
C#/mono. I was thinking we would:

Change this C++
QList<QWidget *> associatedWidgets() const;

to this C#
List<QWidget> associatedWidgets();

I don't think we want a QList type in Qyoto. I'm assuming that the above 
would't be a huge change to the code that currently marshalls from a 
QList<QWidget *> to an ArrayList.

-- Richard

More information about the Kde-bindings mailing list