title: How to link the window close (red x) to a function to close all threads in PyQt?
body: <p>Currently I am working on a GUI application that is developed in <code>PyQt.</code> </p>
  
  <p>The functionality of this GUI contains several threads. I assume this is the reason that when I simply click the red x in the corner of the window. </p>
  
  <p>It doesn't fully close the process (despite the visual aspect of the GUI disappearing). </p>
  
  <p>Is there a way I can link the x in the main window to a close function that stops all threads? </p>
  
  <p>I am new to <code>PyQt</code> so go easy on me! (Also, I believe all of my threads are Python threads, not Qthreads)</p>