title: Remove everything from a frame in pyqt
body: <p>There are some examples of removing specific items from a layout, but I can not find anything on simply deleting everything from a frame.  </p>
  
  <p>Using pyqt designer, I have created a frame.  Then using pyuic4 the file is converted to python.  In the main program, some layouts, items, and widgets are dynamically inserted to the frame.  However, I dont actually keep track of all the items.  On a button refresh, I want to delete everything contained in the frame and populate it again.</p>
  
  <p>My question is, is there a simple way to delete everything that is contained in a frame, including layouts, widgets, and items.</p>
  
  <p>As of now, I can do:</p>
  
  <pre><code>for i in range(len(MyResourceFrame.children())):
      MyResourceFrame.children()[i].deleteLater()
  </code></pre>
  
  <p>However, I have code directly under that, and after the first qframe population, clicking on repopulate give the error that a frame is already there, which then removes all items.  The second click on repopulate works.  Does this have something to do with "Later" wanting to be out of scope first or is that just a name?</p>