title: How to display a custom dialog using PyQt and QtDesigner to design the custom dialog?
body: <p>I have designed 2 widgets - one is the main application widget and a custom widget which would allow me to set the preferences in my main application. They are named - main and child.</p>
  
  <p>Now, I can't get the child widget to show when I click the button in the main application.
  Tried to learn from the Rapid GUI programming using Python and Qt book, but the example given there is for a hand coded form and not designed using QtDesigner. I am getting confused. Kindly help.</p>
  
  <p>My code so far is this-</p>
  
  <pre><code>import serial, sys
  
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  from main import Ui_Form                      # main.py and child.py are the ui 
  from child import Ui_Form as Child_Form       # files generated using pyuic4
  
  class Main(QMainWindow):
      def __init__(self, parent = None):
          super(Main, self).__init__(parent)
          self.ui = Ui_Form()
          self.ui.setupUi(self)
          self.connect(self.ui.btnLaunch, SIGNAL("clicked()"), self.show)
      def show(self):
          dialog = QDialog()
          dialog.ui = Child_Form()
          dialog.ui.setupUi(self)
  
  
  if __name__ == "__main__":
      app = QApplication(sys.argv)
      myapp = Main()
      myapp.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>However, nothing happens when I try to launch this program.</p>