title: Displaying pop-up windows in Python (PyQt4)
body: <p>I need to know how to be able to make a dialog pop-up when a user clicks a button. </p>
  
  <p>I'm relatively new to both Python and PyQt/QtDesigner. I've only been using in them for about a month, but I think I have a good grasp.</p>
  
  <p>Here's what I have: A main dialog (which is the main part of the application), which I designed in QtDesigner. I converted the .ui to .py using pyuic4easy.</p>
  
  <p>Here's what I want to do: design a new dialog box in the QtDesigner and somehow make it pop up when a user clicks a button on the first (main) dialog.</p>
  
  <p>Here's the code for my main dialog:</p>
  
  <pre><code>import sys
  from PyQt4.QtCore import *
  from loginScreen import *
  
  
  class MyForm(QtGui.QDialog):
  
      def __init__(self, parent=None):
          QtGui.QWidget.__init__(self, parent)
          self.ui = Ui_Dialog()
          self.ui.setupUi(self)
          QtCore.QObject.connect(self.ui.pushButton, QtCore.SIGNAL('clicked()'), self.popup)     
          ...
  
          ... Some functions ...
  
     def popup(self):
          #Pop-up the new dialog
  
  if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     myapp= MyForm()
     myapp.show()
     sys.exit(app.exec_())
  </code></pre>
  
  <p>So as you can see, I've connected the first button to a method named 'popup', which needs to be filled in with code to make my second window pop up. How do I go about doing this? Remember that I already have designed my second dialog in QtDesigner, and I don't need to create a new one.</p>
  
  <p>Thanks for all the help!</p>