[Kde-bindings] Again Qyoto

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Jan 7 09:13:08 UTC 2006


On Friday 06 January 2006 18:06, Arno Rehn wrote:
> Hi,
>
> first: It's really cool that virtual methods are working now.
> But there are still some problems:
> 1. I wanted to test the virtual functions, while testing I recognizted
> QSyntaxHighlighter is the constructor. Ther should be somthing like
> QSyntaxHighlighter(QTextEdit textEdit).
Yes, that's strange - I'm not sure what's happened to the QSyntaxHighlighter 
constructors.

> 2. Only strings as 'non-primitive' return types seem to work. When I try to
> use 'QMainWindow.StatusBar()' I get an error that GCHandle cannot be zero.
I think that's because the StatusBar() isn't constructed in Qyoto, but via 
C++, and there isn't any code yet to take a C++ instance and create a C# 
wrapper. It would need to use Activator.CreateInstance() - I don't know if 
that calls the default args constructor - I hope it doesn't. But if so we 
would need to stop it from creating another C++ instance, and also maybe 
generate private no args constructors for any classes that didn't have one.

> 3. Not really a problem, but a tip: When generating the bindings with
> Kalyptus, I think it would be better to keep the namespaces. I played a bit
> with smoke + kimono and there would be a problem, when you create
> additional bindings, e.g. for KTextEditor. There would be two
> 'Document'-classes for example, one from DOM and one from KTextEditor.
Yes, that's certainly wrong and should be changed - it shouldn't be too hard, 
but best to get the Qt only stuff working a bit better first.

> But besides this, the bindings are really great and make fast progress :)
Yes - they're nearly useful now..

Enums: at the moment they are converted to ints in method calls - they should 
be the actual enum instead. If there is a duplicate enum type and method call 
the enum is currently renamed. So QFont.Weight becomes QFont.E_Weight so it 
doesn't conflict with QFont.Weight(). But this is a bit ugly, and maybe the 
method name should be left as lower case to avoid the clash QFont.weight().

This:
		quit.SetFont( new QFont( "Times", 18, (int) QFont.E_Weight.Bold ) );
Should be:
		quit.SetFont( new QFont( "Times", 18, QFont.Weight.Bold ) );

Static instance variables like 'Qt::yellow' need to have accessor methods 
generated.

-- Richard



More information about the Kde-bindings mailing list