title: Python PySide (Internal c++ Object Already Deleted)
body: <p>I recently decided to write my first app with Python and PySide. But I have a problem and hope you guys can help.</p>
  
  <p>Python keeps raising exceptions that the "Internal C++ Object" is deleted. From my limited experience with Python I figure that my object is going out of scope and being deleted by Python's Garbage Collector.</p>
  
  <p>So how would I go about designing a multi-page application in Python with PySide. And being able to keep my QWidgets so I can show the page again.</p>
  
  <p>Thanks for your time.</p>
  
  <p><strong>Update (Code)</strong></p>
  
  <pre><code>instancing = None
  def instance():
     global instancing
     if instancing == None:
        instancing = WPZKernel()
     return instancing
  
  class WPZKernel:
      win = None
      mainscreen = None
  
      def mainwindow(self):
          if self.win == None:
            self.win = GMKMainWindow(self)
          return self.win
  
      def main_panel(self):
          if self.mainscreen == None:
             self.mainscreen = GMKMainScreen(self.mainwindow())
          return self.mainscreen
  </code></pre>
  
  <p>I would then normally access the mainpanel by calling:</p>
  
  <pre><code>import kernel
  kernel.instance().main_panel()
  </code></pre>
  
  <p>So am I going about this the wrong way?</p>