Re: [PyQt] Passing a QWidget* wrapped in a PyCObject from a C++ program?

2010-10-21 Thread Phil Thompson
On Thu, 21 Oct 2010 11:45:25 +0200, Elias Bachaalany wrote: > Hi Phil, > > Using Python 2.6, I could make it work with: > > sip.wrapinstance(sip.voidptr(the_widget).__int__(), QtGui.QWidget) sip.wrapinstance(int(sip.voidptr(the_widget)), QtGui.QWidget) ...is a bit nicer. > But only after figu

Re: [PyQt] Passing a QWidget* wrapped in a PyCObject from a C++ program?

2010-10-21 Thread Elias Bachaalany
Hi Phil, Using Python 2.6, I could make it work with: sip.wrapinstance(sip.voidptr(the_widget).__int__(), QtGui.QWidget) But only after figuring out that I also had to recompile SIP with SIP_SUPPORT_PYCOBJECT Thanks a lot. -- Elias On 10/18/2010 2:04 PM, Phil Thompson wrote: On Mon, 18 Oct

Re: [PyQt] Passing a QWidget* wrapped in a PyCObject from a C++ program?

2010-10-18 Thread Phil Thompson
On Mon, 18 Oct 2010 11:45:07 +0200, Elias Bachaalany wrote: > Hello > > I have a C++ program that creates a QWidget* and can return that to Python. > > I want to pass that QWidget * to PyQt so that the newly created widgets > have this widget as their parent. How to do that? > > In C++: > > Q

[PyQt] Passing a QWidget* wrapped in a PyCObject from a C++ program?

2010-10-18 Thread Elias Bachaalany
Hello I have a C++ program that creates a QWidget* and can return that to Python. I want to pass that QWidget * to PyQt so that the newly created widgets have this widget as their parent. How to do that? In C++: QWidget *theWidget; PyObject *get_widget() { return PyCObject_FromVoidPtr(theW