title: Window built with qt designer not showing up
body: <p>I'm trying to learn how to build some simple gui stuff with pyqt, and i made a dialog window with a label, line edit and pushbutton in Qt designer and converted the ui file to python code. </p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  # Form implementation generated from reading ui file 'gui.ui'
  #
  # Created by: PyQt4 UI code generator 4.11.4
  #
  # WARNING! All changes made in this file will be lost!
  
  from PyQt4 import QtCore, QtGui
  
  try:
      _fromUtf8 = QtCore.QString.fromUtf8
  except AttributeError:
      def _fromUtf8(s):
          return s
  
  try:
      _encoding = QtGui.QApplication.UnicodeUTF8
      def _translate(context, text, disambig):
          return QtGui.QApplication.translate(context, text, disambig, _encoding)
  except AttributeError:
      def _translate(context, text, disambig):
          return QtGui.QApplication.translate(context, text, disambig)
  
  class Ui_Dialog(object):
      def setupUi(self, Dialog):
          Dialog.setObjectName(_fromUtf8("Dialog"))
          Dialog.resize(569, 444)
          self.label = QtGui.QLabel(Dialog)
          self.label.setGeometry(QtCore.QRect(90, 90, 46, 13))
          self.label.setObjectName(_fromUtf8("label"))
          self.lineEdit = QtGui.QLineEdit(Dialog)
          self.lineEdit.setGeometry(QtCore.QRect(160, 90, 113, 20))
          self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
          self.pushButton = QtGui.QPushButton(Dialog)
          self.pushButton.setGeometry(QtCore.QRect(170, 160, 75, 23))
          self.pushButton.setObjectName(_fromUtf8("pushButton"))
  
          self.retranslateUi(Dialog)
          QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.lineEdit.clear)
          QtCore.QMetaObject.connectSlotsByName(Dialog)
  
      def retranslateUi(self, Dialog):
          Dialog.setWindowTitle(_translate("Dialog", "Dialog", None))
          self.label.setText(_translate("Dialog", "TextLabel", None))
          self.pushButton.setText(_translate("Dialog", "PushButton", None))
  </code></pre>
  
  <p>And here's the code from the file that imports the gui file</p>
  
  <pre><code>import sys
  from gui import *
  class MyForm(QtGui.QDialog):
      def __init__(self, parent = None):
          QtGui.QWidget.__init__(self, parent)
          self.ui = Ui_Dialog()
          self.ui.setupUi(self)
  if __name__ == "main":
      app = QtGui.QApplication(sys.argv)
  
      myapp = MyForm()
      myapp.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>When i try running it with python.exe window pops up for split-second and disappears. I'm using python 3.4 and Qt 4.1.1.4 32 bit</p>