title: Pyside window closes immediately after opening
body: <p>I've been able to create pyside UIs before using this method, but for some reason for this time it wont stay open. It seems to flicker on quickly and then closes. I believe that it would be the trash colector that delets the app for not being used but I'm not sure as to how I can use the app more.</p>
  
  <pre><code># coding: iso8859-1
  import locale
  import views
  from PySide import QtGui
  import PySide
  from PySide import QtCore
  import sys
  
  locale.setlocale(locale.LC_CTYPE, '')
  class gui(QtGui.QWidget):
  
      def __init__(self):
          super(gui, self).__init__()
          print "inside __init__"
          self.initUI()
  
      def initUI(self):
          self.window = QtGui.QMainWindow(self)
          self.grid = QtGui.QGridLayout()
          self.menuBTN = QtGui.QToolButton()
          self.menuBTN.setText("MENU")
          self.menuBTN.setMinimumSize(QtCore.QSize(100, 100))
          self.grid.addWidget(self.menuBTN, 0, 0, 1, 1)
  
          self.setLayout(self.grid)
          self.setWindowTitle('Office Works')
          self.showFullScreen()
  
      def change_layout(self):
          '''
          Method for saving the current view class and
          loading the view requested by the user. this
          method can be called by any of the view classes
          and it's functions to be able to change the screen
          when the user clicks on any if it's list objects or
          buttons
  
          '''
          pass
          blah=()
          class_temp = views.billing(blah)
          self.grid.addLayout(class_temp.grid, 0, 1)
  
  if __name__ == '__main__':
      app = QtGui.QApplication(sys.argv)
      gui()
      print "executed gui"
      sys.exit(app.exec_())
  </code></pre>