[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] causes self to be owned by Qt instead of PyQt ???
From:       redstone-cold <redstone-cold () 163 ! com>
Date:       2015-04-02 13:18:53
Message-ID: 337c9d9a.2fd.14c7a48ca4e.Coremail.redstone-cold () 163 ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]





Ok, this is the example 
https://bpaste.net/show/a5b2b50e5052


BTW,if you comment print(model.parent()),then console show
QObject::startTimer: QTimer can only be used with threads started with QThread


what's wrong in the code ?


在2015年04月02 18时04分, "Phil Thompson"<phil@riverbankcomputing.com>写道:

On 02/04/2015 6:05 am, 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.
> 
> 
> 
> 
> 1)Does this mean these C++ instances and C structures still exist in
> memory even when application existed ?
> ----------------------------------------------------------------------------------------------------------------------------------
> 

No - you need to read a basic introduction to operating systems book.

> > 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 ?
> ----------------------------------------------------------------------------------------------------------------------------------
> 

No.

> > 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 .
> ----------------------------------------------------------------------------------------------------------------------------------
> 

"Doesn't work" is very different to "doesn't exist". If you think there
is a bug then post a simple, complete example demonstrating the problem.

Phil


[Attachment #5 (text/html)]

<div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: \
14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: \
14px;"><br></div><div><div>Ok, this is the \
example&nbsp;</div><div>https://bpaste.net/show/a5b2b50e5052</div><div><br></div><div>BTW,if \
you comment print(model.parent()),then console show</div><div>QObject::startTimer: \
QTimer can only be used with threads started with \
QThread</div><div><br></div><div>what's wrong in the code ?</div></div><div \
style="color: rgb(0, 0, 0); font-family: arial; font-size: \
14px;"><br></div></div><!-- jy5ContentSuffix --><div>在2015年04月02 18时04分, \
"Phil Thompson"&lt;phil@riverbankcomputing.com&gt;写道:</div><blockquote \
id="isReplyContent" style="padding-left:1ex; margin: 0px 0px 0px 0.8ex; BORDER-LEFT: \
#ccc 1px solid"><br>On 02/04/2015 6:05 am, redstone-cold wrote:<br>&gt;&gt;&gt; 2)In \
the doc of sip.setdestroyonexit(destroy) says, "Calling this<br>&gt;&gt;&gt; function \
with a value of False disables the automatic destruction of<br>&gt;&gt;&gt; C++ \
instances and C structures(owned by Python)." ,then which is<br>&gt;&gt;&gt; \
responsible for destroying these C++ instances and C structures? the<br>&gt;&gt;&gt; \
dtor of them ?<br>&gt;&gt; <br>&gt;&gt; Nothing destroys them, the dtors never get \
called.<br>&gt;&gt; <br>&gt;&gt; 1)Then on application existing ,who destroys them \
?<br>&gt; <br>&gt; <br>&gt; As I said - nothing, the dtors never get called.<br>&gt; \
<br>&gt; <br>&gt; <br>&gt; <br>&gt; 1)Does this mean these C++ instances and C \
structures still exist in<br>&gt; memory even when application existed ?<br>&gt; \
----------------------------------------------------------------------------------------------------------------------------------<br><br>No \
- you need to read a basic introduction to operating systems book.<br><br>&gt;&gt; \
3)Can you explain why Python has stopped working in this issue ?<br>&gt;&gt; \
http://www.riverbankcomputing.com/pipermail/pyqt/2015-March/035730.html<br>&gt; \
<br>&gt; <br>&gt; No.<br>&gt; <br>&gt; <br>&gt;&gt; Any way to solve the problem \
?<br>&gt;&gt; if we solve the problem via sip.setdestroyonexit(False), &nbsp;then \
I<br>&gt;&gt; tested on Windows that the system tray icon doesn't disappear right \
<br>&gt;&gt; away as<br>&gt;&gt; application exists .<br>&gt;&gt; <br>&gt; <br>&gt; \
<br>&gt; 2)Is this a bug with PyQt ?<br>&gt; \
----------------------------------------------------------------------------------------------------------------------------------<br><br>No.<br><br>&gt;&gt; \
4)bug report : QFileSystemModel.parent() doesn't exist ,but it should<br>&gt;&gt; \
have one according to the Qt doc.<br>&gt; <br>&gt; <br>&gt; It does exist.<br>&gt; \
<br>&gt; <br>&gt; 3)Have you tested it ? I tested in PyQt4 that<br>&gt; \
QFileSystemModel.parent() doesn't work .<br>&gt; \
----------------------------------------------------------------------------------------------------------------------------------<br><br>"Doesn't \
work" is very different to "doesn't exist". If you think there <br>is a bug then post \
a simple, complete example demonstrating the \
problem.<br><br>Phil<br></blockquote><br><br><span title="neteasefooter"><span \
id="netease_mail_footer"></span></span>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic