title: How to detect parent widget close in PyQT?
body: <p>I've created a <code>QVBoxLayout</code> which contains multiple other widgets. When the parent window of the <code>QVBoxLayout</code> (currently a <code>QDialog</code>) is closed, I need all the widgets to be notified of the close event so they may delete temporary files. Is this idiomatic and how could I do it?</p>
  
  <p>In my application, I have subclassed <code>QLabel</code> with a class that allows me to store a reference to the temporary file that makes up it's pixMap. When it's parent window is closed, I need to be able to close the file.</p>
  
  <p><strong>EDIT:</strong> I've already tried handling the close event:</p>
  
  <pre><code>def closeEvent(self, event):
      self.imgFile.close()
  </code></pre>