[PyQt] causes self to be owned by Qt instead of PyQt ???

redstone-cold redstone-cold at 163.com
Thu Apr 2 06:05:13 BST 2015



>> 2)In the doc of sip.setdestroyonexit(destroy) says, "Calling this
>> function with a value of False disables the automatic destruction of
>> C++ instances and C structures(owned by Python)." ,then which is
>> responsible for destroying these C++ instances and C structures? the
>> dtor of them ?
> 
> Nothing destroys them, the dtors never get called.
> 
> 1)Then on application existing ,who destroys them ?


As I said - nothing, the dtors never get called.




1)Does this mean these C++ instances and C structures still exist in memory even when application existed ?
----------------------------------------------------------------------------------------------------------------------------------






> 3)Can you explain why Python has stopped working in this issue ?
> http://www.riverbankcomputing.com/pipermail/pyqt/2015-March/035730.html


No.


> Any way to solve the problem ?
> if we solve the problem via sip.setdestroyonexit(False),  then I
> tested on Windows that the system tray icon doesn't disappear right away as
> application exists .
> 


2)Is this a bug with PyQt ?
----------------------------------------------------------------------------------------------------------------------------------


> 4)bug report : QFileSystemModel.parent() doesn't exist ,but it should
> have one according to the Qt doc.


It does exist.


3)Have you tested it ? I tested in PyQt4 that QFileSystemModel.parent() doesn't work .
----------------------------------------------------------------------------------------------------------------------------------






在2015年04月01 21时48分, "Phil Thompson"<phil at riverbankcomputing.com>写道:

On 01/04/2015 2:19 pm, redstone-cold wrote:
>> 2)In the doc of sip.setdestroyonexit(destroy) says, "Calling this
>> function with a value of False disables the automatic destruction of
>> C++ instances and C structures(owned by Python)." ,then which is
>> responsible for destroying these C++ instances and C structures? the
>> dtor of them ?
>
> Nothing destroys them, the dtors never get called.
> ----------------------------------------------------------------------------------------------------------------------------------
> 1)Then on application existing ,who destroys them ?

As I said - nothing, the dtors never get called.

>
>
> 2)Since sip.setdestroyonexit(True) may cause memory faults, why not
> make sip.setdestroyonexit(False) be the default.

Backwards compatibility. False is the default for PyQt5.

>
>
> 3)Can you explain why Python has stopped working in this issue ?
> http://www.riverbankcomputing.com/pipermail/pyqt/2015-March/035730.html

No.

> Any way to solve the problem ?
> if we solve the problem via sip.setdestroyonexit(False),  then I
> tested that the system tray icon doesn't disappear right away as
> application exists .
>
>
>
>
> 4)bug report : QFileSystemModel.parent() doesn't exist ,but it should
> have one according to the Qt doc.

It does exist.

> QAbstractTableModel also has the same bug.

Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150402/693a6c43/attachment.html>


More information about the PyQt mailing list