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

List:       pykde
Subject:    Re: [PyQt] Exit crash with QGraphicsScene
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2014-11-27 10:15:54
Message-ID: 0a5ade8d5fe110316bca8cc0eee88350 () riverbankcomputing ! com
[Download RAW message or body]

On 27/11/2014 12:14 am, Luke Campagnola wrote:
> Hello,
> 
> I have an example that produces a crash on exit:
> 
> from PyQt4 import Qt, QtGui, QtCore
> def main() :
>     app = QtGui.QApplication([])
>     x = QtGui.QGraphicsView()
>     s = QtGui.QGraphicsScene()
>     x.setScene(s)
>     x.show()
>     app.exec_()
> 
> main()
> 
> The basic issue seems to be that the QApplication is deleted before 
> python
> exits, and the QGraphicsScene is not given a parent and thus outlives 
> the
> QApplication.
> 
> I am wondering if this is a PyQt bug, or if falls into the category of
> object lifetime / deletion issues that the user is responsible for? I 
> do
> not get the same behavior with PySide, so I assume it should be 
> possible to
> fix in PyQt as well..

See...

http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#object-destruction-on-exit

Phil
_______________________________________________
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