title: Not able to display widgets in QGridLayout from MainWindow
body: <pre><code>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
  {
      reminderTextEdit     = new QTextEdit("");
      reminderTextEdit-&gt;setPlaceholderText("What do you want to be reminded of?");
      /// Setting parent is necessary otherwise it will be created in a window of its own.
      reminderTextEdit-&gt;setParent(this);
      reminderTextEdit-&gt;show();
  
      dateComboBox         = new QComboBox();
      dateComboBox-&gt;setParent(this);
      dateComboBox-&gt;show();
  
      monthComboBox        = new QComboBox();
      monthComboBox-&gt;setParent(this);
      monthComboBox-&gt;show();
  
      yearComboBox         = new QComboBox();
      yearComboBox-&gt;setParent(this);
      yearComboBox-&gt;show();
  
      doneAndAddMoreButton = new QPushButton();
      doneAndAddMoreButton-&gt;setParent(this);
      doneAndAddMoreButton-&gt;show();
  
      doneAndQuitButton    = new QPushButton();
      doneAndQuitButton-&gt;setParent(this);
      doneAndQuitButton-&gt;show();
  
      gridLayout           = new QGridLayout;
      gridLayout-&gt;addWidget(reminderTextEdit, 0, 0, 0, 0);
      gridLayout-&gt;addWidget(dateComboBox, 1, 0);
      gridLayout-&gt;addWidget(monthComboBox, 1, 1);
      gridLayout-&gt;addWidget(yearComboBox, 1, 2);
      gridLayout-&gt;addWidget(doneAndAddMoreButton, 2, 0);
      gridLayout-&gt;addWidget(doneAndQuitButton, 2, 1);
  }
  </code></pre>
  
  <p>This code just produces a parent window and a child window in it.  </p>
  
  <p>Adding <code>setLayout(gridLayout);</code> at the end of it produces following error:  </p>
  
  <p><code>QWidget::setLayout: Attempting to set QLayout "" on MainWindow "", which already has a layout</code></p>
  
  <p>Point out the wrong doings, please.</p>