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

List:       pykde
Subject:    Re: [PyQt] sip. setdestroyonexit
From:       "Zhao Lee" <redstone-cold () 163 ! com>
Date:       2016-08-25 1:40:35
Message-ID: 5f4894ea.55.156bf5b1f57.Coremail.redstone-cold () 163 ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

I always wrap the start-up entry  in a separate function, typically called main(), \
and never see the Crashes On Exit error , \
http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit


def main():
    app = QApplication(sys.argv)


    w = QWidget()
    w.show()


    app.exec()


if __name__ == '__main__':
    main()






在2016年08月16 05时35分, "Phil Thompson"<phil@riverbankcomputing.com>写道:

On 15 Aug 2016, at 9:11 pm, Carl Wolff <carl@wolff-online.nl> wrote:
> 
> Hello,
> 
> I succesfully applied sip. setdestroyonexit on a fairly large pyqt4 application \
> suffering from occasional crashes at exit time. 
> My question is twofold:
> - why is destroyonexit not set to False by default;

So as not to change the behaviour of existing applications.

> - Is it (theoretically) possible to live without using this sip call? E.g. by \
> adhering to guidelines regarding pyqt wrapper/qt ownership and qt/python garbage \
> collection? When I read the API documentation of sip.setdestroyonexit carefully, I \
> get the impression that it is impossible to live without this sip call.

As far as I can remember I've never used it in my own code.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com


[Attachment #5 (text/html)]

<div><div style="">I always wrap the start-up entry &nbsp;in a separate function, \
typically called main(), and never see the Crashes On Exit error , <a \
href="http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit" \
_src="http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit">http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit</a> \
</div><div style=""><br></div><div>def main():</div><div>&nbsp; &nbsp; app = \
QApplication(sys.argv)</div><div><br></div><div>&nbsp; &nbsp; w = \
QWidget()</div><div>&nbsp; &nbsp; w.show()</div><div><br></div><div>&nbsp; &nbsp; \
app.exec()</div><div><br></div><div>if __name__ == '__main__':</div><div>&nbsp; \
&nbsp; main()</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 style="color: rgb(0, 0, 0); font-family: arial; font-size: \
14px;"><br></div></div><!-- jy5ContentSuffix --><div>在2016年08月16 05时35分, \
"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 15 Aug 2016, at 9:11 pm, Carl Wolff &lt;<a \
href="mailto:carl@wolff-online.nl">carl@wolff-online.nl</a>&gt; wrote:<br>&gt; \
<br>&gt; Hello,<br>&gt; <br>&gt; I succesfully applied sip. setdestroyonexit on a \
fairly large pyqt4 application suffering from occasional crashes at exit \
time.<br>&gt; <br>&gt; My question is twofold:<br>&gt; - why is destroyonexit not set \
to False by default;<br><br>So as not to change the behaviour of existing \
applications.<br><br>&gt; - Is it (theoretically) possible to live without using this \
sip call? E.g. by adhering to guidelines regarding pyqt wrapper/qt ownership and \
qt/python garbage collection? When I read the API documentation of \
sip.setdestroyonexit carefully, I get the impression that it is impossible to live \
without this sip call.<br><br>As far as I can remember I've never used it in my own \
code.<br><br>Phil<br>_______________________________________________<br>PyQt mailing \
list &nbsp; &nbsp;<a \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br></blockquote><br><br><span \
title="neteasefooter"><p>&nbsp;</p></span>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://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