title: Setting up the form layout in correct way. QGridLayout.addLayout(QLayout, int, int, Qt.Alignment alignment=0): not enough arguments
body: <p>I'm trying to make a form for user info data:</p>
  
  <pre><code>#!/usr/bin/python
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  import sys, os, time
  
  class SetName(QWidget):
      def __init__(self):
          QWidget.__init__(self)
          self.show()
          toplayout = QGridLayout()
          self.setWindowTitle('Personal Info')
          self.form_layout = QFormLayout()
          self.setLayout(self.form_layout)
          self.line_edit_param = QLineEdit(self)
  
          self.line_edit_param.setPlaceholderText("Write Here")
          self.form_layout.addRow('Write Name', self.line_edit_param)      
          toplayout.addLayout(self.form_layout)
          self.setFocus()
  
  class LearnApp(QDialog):
      def __init__(self):
          super(QDialog, self).__init__()
          self.setWindowTitle("LearnApp")
  
          self.active = False
  
          close_button = QPushButton("Close")
          close_button.clicked.connect(self.close)
  
          self.check_button = QPushButton("Check")
          self.check_button.clicked.connect(self.set_data)        
          self.tr = QTextEdit()
          self.tr.setReadOnly(True)
          # layout
          layout = QHBoxLayout()        
          #layout.addWidget(self.button3)
          sub_layout = QVBoxLayout()
          sub_layout.addWidget(self.check_button)
          sub_layout.addWidget(close_button)
          layout.addLayout(sub_layout)
          layout.addWidget(self.tr)
          self.setLayout(layout)
          self.setFocus()
  
      def set_data(self):
          print "in set_data"
          SetName()
  
  app = QApplication(sys.argv)
  dialog = LearnApp()
  dialog.show()
  app.exec_()
  </code></pre>
  
  <p>It opens up the form the way I wanted it but it's giving me following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "data_log.py", line 50, in set_data
      SetName()
    File "data_log.py", line 20, in __init__
      toplayout.addLayout(self.form_layout)
  TypeError: arguments did not match any overloaded call:
    QGridLayout.addLayout(QLayout, int, int, Qt.Alignment alignment=0): not enough arguments
    QGridLayout.addLayout(QLayout, int, int, int, int, Qt.Alignment alignment=0): not enough arguments
  </code></pre>
  
  <p>Where exactly I'm going wrong? How should I tackle this?
  I tried to debug a lot but couldn't realize the mistake I'm doing.</p>