On Tuesday 21 December 2010 13:56:10 Vladimir Rutsky wrote:
> Hello,
> 
> What is the "policy of crashing" for application that use PySide?
> Consider example:
> 
> import sys
> from PySide import QtCore, QtGui
> 
> # Forgot to initialize QApplication.
> # app = QtGui.QApplication(sys.argv)
> try:
>     win = QtGui.QWidget()
> finally:
>     print "done"
> 
> Last string (print "done") will not be reached because running
> "QtGui.QWidget()" without initialized QApplication prints
> 
> > QWidget: Must construct a QApplication before a QPaintDevice
> 
> and exits python process with error code 1.

This assertion is inside Qt code and if you construct a application this way 
it's broken by design and shouldn't work at all, so there's not much difference 
in throwing an exception and let Qt finish the process in your use case.
 
> May be such exceptional situations inside Qt should be treated as
> exceptions in Python?

List them, so we can think how to proceed.

-- 
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to