[Kde-bindings] Qyoto: SIGNALS/SLOTS

Arno Rehn arno at arnorehn.de
Tue Dec 13 15:51:16 UTC 2005


Am Montag, 12. Dezember 2005 18:01 schrieb Richard Dale:
> On Sunday 11 December 2005 14:39, Arno Rehn wrote:
> > > I got this wrong, it should look like this:
> > >
> > > ((IQApplicationSignals) myInstance.Emit()).LastWindowClosed();
> > >
> > > And the interface for a class would need to extend the signals
> > > interface for its superclass. So in the case above the
> > > IQApplicationSignals interface would need to extend the IQObjectSignals
> > > interface. But this doesn't really fit in with delegates.
> > >
> > > > > And it would be forwarded to SignalInvocation.Invoke(), in a
> > > > > similar manner to how ordinary method calls get diverted to
> > > > > SmokeInvocation.Invoke() at the moment.
> >
> > We don't need a thing like SignalInvocation if all the signal are
> > delegates. With QObject.Emit() we would just call an delegate. I wouldn't
> > use interaces at all, just delegates which are declared in the class
> > directly. The delegates would be inherited by derived classes, too.
>
> I think we might need two ways of emitting signals; one which looked as
> Qt/C++ like as possible, and the other which looks as C#/delegate like as
> possible. I'm not sure if it's actually possible to do it with delegates
> though. The QObject.Emit() syntax above can definately be made to work
> though.
That's exactly what I was thinking of ;) .
>
> > > > > But slots are easiest to get working first though, and marking them
> > > > > with attributes like you've done looks pretty good to me.
> > >
> > > I think the slots need to be marked as slots, along with the C++ type
> > > signature that would be used for constructing the QMetaObject entry for
> > > it. Like this:
>
> ...
>
> > Looks very good, but my question: How do we connect a native Qt-signal to
> > a C#-method ? Can we trap these signals and then call a C#-method? Or can
> > we connect a C++ signal to a C#-method directly?
>
> We can trap signal calls by overriding the QObject::qt_invoke() method.
> ...
Where do you get the QObject::qt_invoke() from? I looked in the Qt-docs and in 
every header-file used by QObject.h . I can't find anything like this. The 
only objects with a qt_invoke() are the Active Qt things. 

-- 
MfG
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list