title: Qt Ui namespace
body: <p>What is the significance of the namespace <code>Ui</code> that is auto-generated by Qt?</p>
  
  <p>Are these two namespaces the same? </p>
  
  <p>In the first one, which contains a forward declaration of the class MainWindow from <code>ui_MainWindow.h</code> why is it not declared as <code>class Ui::MainWindow</code>? How does the compiler know that MainWindow is coming from the auto-generated Ui header? </p>
  
  <p>In MainWindow.h</p>
  
  <pre><code>namespace Ui {
  class MainWindow; //MainWindow from ui_MainWindow.h
  }
  </code></pre>
  
  <p>In ui_MainWindow.h</p>
  
  <pre><code>namespace Ui {
      class MainWindow: public Ui_MainWindow {};
  } // namespace Ui
  </code></pre>