[PyQt] PyQt4 QApplication.commitData and QApplication.saveState under Windows

Strato pyqt at p0w.org
Sun Jun 13 18:05:55 BST 2010


Hi,

I have a long running app that I use for as long as I am working on the 
computer, but I have a problem to cleanly close the app when the Windows 
session terminate.

I've found a thread that talked about how to use 
QApplication.commitData() and QApplication.saveState() in the C++ 
version of Qt, but doing the same under PyQt4 does not work either.

the key seems to be that thoses functions are available only when 
subclassing QApplication. in my case, this simply does not work, thoses 
methods are not called when the Windows session finishes.

I suspect this is "normal", as if I think a little about what happens 
when Windows send some kind of sinal to inform running applications to 
close, I think this is the python.exe "host" who receive the signal, not 
the PyQt4 script.

So, does anyone have an idea to solve this issue ?

Thanks.


More information about the PyQt mailing list