[Kde-bindings] Some questions on kalyptus
arno at arnorehn.de
Thu Jan 18 18:49:26 UTC 2007
Am Donnerstag, 18. Januar 2007 19:29 schrieb Richard Dale:
> On Thursday 18 January 2007 17:27, Arno Rehn wrote:
> > Hi,
> > I just looked through the code of kalyptus in order to get on
> > with ".NET-2.0-ifying" and I have a few questions on the CxxToKimono
> > module. First, why are so many Enums converted to int's (e.g.
> > 'Qt::ToolBarAreas' => 'int'). We have these enums in C#, as far as I
> > know, so why are they int's?
> The items in that list are mostly Q_FLAGS, rather than enums. Which are
> enum values and'd or or'd together. I don't know how to do that for a C#
> api, and so for the moment they are converted to ints. But I think you're
> right about Qt::ToolBarAreas, that is an enum, and so I think the code
> generation is wrong for that one.
> I did make a start on changing ArrayLists to List<>s so I'll check in what
> I've done so far. Mainly what needs doing is changing the arraytypeslist
> hash to have strings for the names of the List<> types instead of just '1'
> to mean true. Then changing the code that uses it so it uses the values
> like 'List<foo>' instead of ArrayList.
Snap! That was what I've just been doing :-)
> > Then I think I found a bug in the code generation for QApplication for
> > Qt4. In the first constructor it says
> > string args = new string[argv.Length + 1];
> > args = System.Reflection.Assembly.GetExecutingAssembly().Location;
> > argv.CopyTo(args, 1);
> > NewQApplication(args.Length, args);
> > which is correct, but the others take in the "NewQApplication" line
> > "argv" instead of new modified "args". This won't use the executing
> > assembly as first argument. In the Qt3 version everything is right.
> The methods called 'NewQApplication' aren't called directly by the Qyoto
> application code, only by the public constructors. So as long as the
> constructors just have an argv parameter the code is correct.
Yes, I know, but in the public constructors we modify the array to have as the
first element the executing assembly. Then we call NewQApplication and pass
the modifed array. But only in the first constructor the modified array is
actually passed, in the other two the unmodifief one is used, which will
probably cause some trouble.
arno at arnorehn.de
More information about the Kde-bindings