title: Handling multiple ui files in Qt
body: <p>I am new to the Qt framework and am trying to load another UI file when SubmitClicked. The file's name is Form.ui </p>
  
  <pre><code>//MainWindow.cpp
  #include "mainwindow.h"
  #include "ui_mainwindow.h"
  #include "form.h"
  #include &lt;QtCore/QCoreApplication&gt;
  
  MainWindow::MainWindow(QWidget *parent)
  : QMainWindow(parent), ui(new Ui::MainWindow)
  {
  ui-&gt;setupUi(this);
  
  }
  
  MainWindow::~MainWindow()
  {
     delete ui;
  }
  void MainWindow:: SubmitClicked()
  {
     Form* f= new Form(this);
     f-&gt;show();
     f-&gt;raise();
     f-&gt;activateWindow();
  }
  
  
  
  
  //Form.cpp
  #include "form.h"
  #include "ui_form.h"
  
  Form::Form(QWidget *parent) :
  QWidget(parent),
  ui(new Ui::Form)
  {
  ui-&gt;setupUi(this);
  }
  
  Form::~Form()
  {
  delete ui;
  }
  </code></pre>
  
  <p>This didn't work out! Can you tell me what's wrong? </p>