The event loop implementations need some pre- and post processing to correctly work. This is currently not done in case an already running QApplication is used. The provided commit changes that. Furthermore it forbids to run the default loop entry points when the loop is already running, to prevent wrong usage after initialization with an running QApplication.
Note: The postprocessing of the event loop needs to happen on application closing, as this is the behavior when using run_forever/run_until_complete. I opted to use the applications aboutToQuit signal to trigger this action, but mostly as I had no other working idea. Seems not very elegant. Please carefully review this implementation.
The event loop implementations need some pre- and post processing to correctly work. This is currently not done in case an already running QApplication is used. The provided commit changes that. Furthermore it forbids to run the default loop entry points when the loop is already running, to prevent wrong usage after initialization with an running QApplication.
Note: The postprocessing of the event loop needs to happen on application closing, as this is the behavior when using run_forever/run_until_complete. I opted to use the applications aboutToQuit signal to trigger this action, but mostly as I had no other working idea. Seems not very elegant. Please carefully review this implementation.
Fixes #30