title: How to display a widget inside a main window
body: <p>I have a project marines and i have the following files structure.</p>
  
  <p>marines.pro     </p>
  
  <p>FORMS</p>
  
  <p>iran.ui
  marines.h</p>
  
  <p>Headers</p>
  
  <p>iran.h
  marines.h</p>
  
  <p>Sources</p>
  
  <p>iran.cpp
  main.cpp
  marines.cpp</p>
  
  <p>I added the widget iran in the project marines.</p>
  
  <p>Here is marines.cpp</p>
  
  <pre><code>#include &lt;QtGui&gt;
  #include "marines.h"
  #include "iran.h"
  
  
  marines::marines(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::marines)
  {
      ui-&gt;setupUi(this);
      connect(ui-&gt;actionExit, SIGNAL(triggered()), this, SLOT(close()));
      connect(ui-&gt;actionIran, SIGNAL(triggered()), this, SLOT(ir()));
  }
  
  void marines::ir()
  {
  //slot to display iran ui inside my main window
  }
  
  marines::~marines()
  {
      delete ui;
  }
  </code></pre>
  
  <p>and here is my iran.cpp</p>
  
  <pre><code>#include "iran.h"
  #include &lt;QtGui&gt;
  
  iran::iran(QWidget *parent) :
      QWidget(parent),
      ui(new Ui::iran)
  {
      ui-&gt;setupUi(this);
  }
  
  iran::~iran()
  {
      delete ui;
  }
  </code></pre>
  
  <p>How can i display the widget iran i made in qt designer?.</p>