title: Qt QFrame becomes separate window
body: <p>I'm constructing UI in QT programatically. The problem is when making a <code>Qframe</code>, setting into a layout and adding the layout to my main window, the frame becomes a window of it's own. I've searched around but I can't seem to get it to become a frame within my main window.</p>
  
  <pre><code>    MainWindow::MainWindow()
      {
  
          QWidget::showMaximized();
          frame = new QFrame();
          layout = new QHBoxLayout();
          button = new QPushButton("Push");
  
          layout-&gt;addWidget(frame);
          frame-&gt;show();
          this-&gt;setLayout(layout);
  
          Setstyles();
      }
  </code></pre>