[PyKDE] Using SIP to wrap python objects
Rob Knapp
myddrin at myddrin.com
Fri Jun 13 12:57:00 BST 2003
[snip]
> > So, if I inherit a C++ object from QWidget and write a sip binding, then
> > I'm set. That's what I thought, but what I was hoping for was some way
> > to automatically generate this "in between" object.
>
> It can't be automatically generated if you are adding functionality (the
> new methods and slots) to it.
That's ok, I think what I layout below will work (using python introspection
and maybe a little hand tweaking)
[snip]
> > From what I'm seeing in the responses, I would write a C++
> > class(QMyddrin) that inherits from QWidget and adds these methods. Then
> > my python ocde I would inherit from QMyddrin and it should all work as
> > long as I do the conversion from Py_Object to CppPointer (I forget the
> > call name.)
>
> Yes - but where are you going to put the code that does that conversion?
> Does the dialog include a method that will embed your QMyddrin instance?
The API we are using provides a place that is perfect just for this. :)
Thanks for the help, I think I have enough that I can start moving forward.
And yes, I realize this makes for a bizarre sounding solution. I can't really
go into why I think this is a good thing to do right now. But it meets our
needs very well.
More information about the PyQt
mailing list