Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-27 Thread Mathias . Born
On 27.08.2012, 22:50:43 Phil Thompson wrote: > On Sun, 26 Aug 2012 21:11:50 +0200, mathias.b...@gmx.de wrote: >> On 26.08.2012, 18:15:55 Phil Thompson wrote: >>> On Wed, 15 Aug 2012 11:55:47 +0200, mathias.b...@gmx.de wrote: On 15.08.2012, 11:05:42 Phil Thompson wrote: > I could change sip

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-26 Thread Phil Thompson
On Sun, 26 Aug 2012 21:11:50 +0200, mathias.b...@gmx.de wrote: > On 26.08.2012, 18:15:55 Phil Thompson wrote: >> On Wed, 15 Aug 2012 11:55:47 +0200, mathias.b...@gmx.de wrote: >>> On 15.08.2012, 11:05:42 Phil Thompson wrote: I could change sipTransferTo() to do this if the owner was Py_None. A

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-26 Thread Mathias . Born
On 26.08.2012, 18:15:55 Phil Thompson wrote: > On Wed, 15 Aug 2012 11:55:47 +0200, mathias.b...@gmx.de wrote: >> On 15.08.2012, 11:05:42 Phil Thompson wrote: >>> I could change sipTransferTo() to do this if the owner was Py_None. At >>> the >>> moment this is undocumented behaviour. Would this be s

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-15 Thread Mathias . Born
On 15.08.2012, 18:15:55 Phil Thompson wrote: > On Wed, 15 Aug 2012 11:55:47 +0200, mathias.b...@gmx.de wrote: >> On 15.08.2012, 11:05:42 Phil Thompson wrote: >>> I could change sipTransferTo() to do this if the owner was Py_None. At >>> the >>> moment this is undocumented behaviour. Would this be s

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-15 Thread Phil Thompson
On Wed, 15 Aug 2012 11:55:47 +0200, mathias.b...@gmx.de wrote: > On 15.08.2012, 11:05:42 Phil Thompson wrote: >> I could change sipTransferTo() to do this if the owner was Py_None. At >> the >> moment this is undocumented behaviour. Would this be sufficient? > > I believe so. Done in hg. Phil __

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-15 Thread Mathias . Born
On 15.08.2012, 11:05:42 Phil Thompson wrote: > On Tue, 14 Aug 2012 23:47:51 +0200, mathias.b...@gmx.de wrote: >> Thanks for the answer. However, it appears I've not made myself >> clear enough. >> I don't want the C++ wrapper to be owned by Python; surely, I >> can achieve that with "sipTransferTo"

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-15 Thread Phil Thompson
On Tue, 14 Aug 2012 23:47:51 +0200, mathias.b...@gmx.de wrote: > Thanks for the answer. However, it appears I've not made myself > clear enough. > I don't want the C++ wrapper to be owned by Python; surely, I > can achieve that with "sipTransferTo". But nothing is done about the > Python part. When

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-14 Thread Mathias . Born
Thanks for the answer. However, it appears I've not made myself clear enough. I don't want the C++ wrapper to be owned by Python; surely, I can achieve that with "sipTransferTo". But nothing is done about the Python part. When I delete the wrapper in C++, the Python part it wraps stays alive, becau

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-14 Thread Phil Thompson
On Mon, 13 Aug 2012 23:07:07 +0200, mathias.b...@gmx.de wrote: > Hi, > > I have a C++ class "Project", which I expose to Python > via sip. > In Python, I sub-class: > > class Derived(Project): > ... > > In addition, there is a Python factory function which creates an > instance of "Derived

[PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-13 Thread Mathias . Born
Hi, I have a C++ class "Project", which I expose to Python via sip. In Python, I sub-class: class Derived(Project): ... In addition, there is a Python factory function which creates an instance of "Derived" and returns it: def f(): return Derived(...) I call this function from within