If I launch an external application from within a Python GUI application (PySide), is there a way to install an 'exited' signal, to notify when the user has exited/closed the external application?
I understand there's subprocess.poll() and subprocess.wait(), but I'm more after a signal/slot procedure, not a polling procedure. If there are other options, not using subprocess, I'd be happy to implement them as well.
This is the approach I'm toying with at the moment:
def eventFilter(self, source, event):
if event.type() == QtCore.QEvent.Close/ChildRemoved/etc.:
print("App closed!")
self.AppClosedHandler()
self.App = subprocess.Popen([r'C:\WINDOWS\SYSTEM32\some_application.exe'], shell=True)
self.App.installEventFilter(self)
Unfortunately you can't install an Event Filter on a Popen.