[Kde-bindings] Qyoto: SIGNALS/SLOTS

Arno Rehn arno at arnorehn.de
Thu Dec 22 13:08:29 UTC 2005

Am Montag, 19. Dezember 2005 17:21 schrieb Adam Treat:
> On Monday December 19 2005 7:02 am, Richard Dale wrote:
> > In Qyoto the '_smokeObject' is a pointer directly to the C++ instance, it
> > is a struct which contains that pointer, along with several other things.
> > So it is the direct equivalent of the Qt# QtSharp class.
> >
> > From qyoto.h:
> >
> > struct smokeqyoto_object {
> >     bool allocated;
> >     Smoke *smoke;
> >     int classId;
> >     void *ptr;
> > };
> >
> > The 'ptr' field is the C++ instance. 'allocated' is true if the C#
> > instance was allocated from the C# side, or false if an existing C++
> > instance was wrapped, and the C++ instance shouldn't be deleted on
> > garbage collection. 'classId' is a numeric identifier that is used in the
> > lookup tables inside the Smoke library. 'smoke' is a  handle to the Smoke
> > library instance being used for the class (always the same for every
> > class in the current implementation).
> Ahh, that is cool.  I had something similar for libqtsharp.  So, Arno, it
> looks like the problem you were having was you were trying to connect the
> smoke object directly, instead of the underlying QObject which is the void
> ptr.  However, I think Richard is absolutely right, you don't want to be
> using Qt#'s libqtsharp for signal/slot connections on the C/C++ side of
> things when SMOKE will provide this for you.  Better to do it the SMOKE way
> since that is the binding library.

Yepp, seems like I took the smokeobject instead of the QObject.

I also think it would be better to do it the SMOKE way, but I really don't 
know how to do that. I looked in the bindings for ruby, but I don't get how 
it was done there. The ruby-bindings don't even work for me.

Arno Rehn
arno at arnorehn.de

More information about the Kde-bindings mailing list