[Kde-bindings] Qyoto: SIGNALS/SLOTS
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Mon Dec 12 16:54:33 UTC 2005
On Sunday 11 December 2005 14:39, Arno Rehn wrote:
> > We don't want to dynamically connect the delegate to target slots because
> > the Qt runtime will do that. But we would need to trap the
> > LastWindowClosed delegate call and then raise the Qt signal inside the
> > Qyoto runtime. I need to read up more on how delegates work. Should the
> > Q_SIGNAL attribute be against the delegate declaration?
> >
> > [Q_SIGNAL("void lastWindowClosed()")]
> > delegate void LastWindowClosedHandler();
>
> Yeah, that's right, the attribute has to be against the delegate
> declaration.
OK, I wasn't sure, I haven't done any experiments with attributes on delegates
yet.
> But I don't get the other part. LastWindowClosed is a native
> Qt-signal. So we would have to connect the native signal to a C#-slot ( a
> method or a delegate/event ). But I don't know how to do that. Can we call
> a C#-Method form C++ ?
The C++ Qt runtime calls a method called qt_invoke() for Qt 3 or qt_metacall()
for Qt 4 when it calls a signal. So you need to override those methods, and
marshall the C++ args to C# ones and then call the C# target slots or
signals.
-- Richard
More information about the Kde-bindings
mailing list