[Mono-list] Re: Status of the Qt c# bindings

Richard Dale Richard_Dale@tipitina.demon.co.uk
Fri, 1 Mar 2002 11:52:31 +0000


On Thursday 28 February 2002 9:45 am, Adam Treat wrote:
> Just wanted to let anyone who might be interested know what is going on
> with the Qt c# bindings.  Tonight, I was finally able to compile the
> bindings for 476 Qt classes.  The hello world example is now referencing
> this compiled dll.  Slots and Signals are also fully implemented and all of
> this running on linux with mint and mono.  mcs is not able to compile the
> bindings _yet_ although I have been able to exercise mcs a little and point
> out some bugs ;-) There are still quite a few tasks before the qt bindings
> will be useful for real development:
Good stuff! I'm pleased to see such rapid progress..

> 1.  No way to extend the qt classes _yet_ (this is next)
Have you got C to C# callbacks working yet? I've seen the P/Invoke code which 
calls C from C#, and then in turn calls C++. But can you call C from C#? For 
example, is it possible to do this?

C# calls QApplication.exec()
  C calls qt_QApplication_exec()
    C++ calls QApplication::exec(), which calls a C++ event handler
      C event handler callback function calls C# event handler in a C# widget
        C# event handler invokes a slot
	  C slot/signal wrappers invoke C++ slot 
            C++ slot invokes C# via C wrapper functions
..

Event handlers can be nested too with drag and drop, and slots/signals can 
also be nested. There are event handling and slot/signal callbacks in the QtC 
bindings that it should be possible to use for this - I don't know how far 
you've got..

More virtual method callbacks in the QtC bindings are needed if you want to do 
more than just customize event handling though.
      
> 2.  Several Qt classes are missing methods and constructors because...
> 3.  The type mappings are not completely fleshed out
Do you mean you need to complete the runtime conversion functions to convert 
between C# and Qt types?
> 4.  No kde classes
If you can do it for 300+ Qt classes, then it's just more of the same for 
KDE.. You can convert KDE kdoc comments to C# style xml, which should be fun 
though.

> Well, I can envision these bindings ready for some practical development
> very soon as well as providing some scaffolding for Windows.Forms in the
> not to distant future.

On Thursday 28 February 2002 6:32 pm, Miguel de Icaza wrote:
> > Just wanted to let anyone who might be interested know what is going on
> > with the Qt c# bindings.  Tonight, I was finally able to compile the
> > bindings for 476 Qt classes.  The hello world example is now referencing
> > this compiled dll.
>
> Congratulations!  Would you like to put this on CVS?
Yes, agreed! And the code is also most welcome in the kdebindings CVS too. 
Maybe it wouldn't do any harm to have it in both places. But if you check in 
the kalyptus C# + P/Invoke bindings code generation option into kdebindings, 
I would be happy to help tweak it.

Please add the QtC bindings to the Mono cvs too, if people want them together, 
that's fine with me.

-- Richard