[PyQt] A Qt error pushed me out of Python

Paul Giannaros ceruleanblaze at gmail.com
Fri Apr 13 17:07:13 BST 2007


On Friday 13 April 2007 16:55:02 Shriramana Sharma wrote:
> Phil Thompson wrote:
> > It's a fatal error and can't be changed.
>
> Why not? If I do a mistake at the Python level, I always get the
> interpreter back. Is it because the error occurs at the C++ level of Qt?
> Can't that error be caught and something meaningful printed? I mean,
> other Python modules written is C/C++ must have had to face this?
>

It is on the C++ side. The problem is that when you try and construct the 
QPaintDevice before a QApplication, things go bad so QWidget calls exit to 
break out of the program. That can't be trapped. PyQt could possibly check in 
advance to see if a QApplication has been constructed before creating any 
QPaintDevice, but that'd be pretty bad for performance and other things (or 
so I guess -- I don't know too much about the inner workings of PyQt).

> Shriramana Sharma.
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list