title: Qt: invalid use of incomplete type and forward declaration
body: <p>I have some misunderstanding:</p>
  
  <p>A.h</p>
  
  <pre><code>#ifndef A_H
  #define A_H
  
  #include "B.h"
  
  class A : public B
  {
      Q_OBJECT
  public:
      A();
  };
  #endif
  </code></pre>
  
  <p>A.cpp</p>
  
  <pre><code>#include "A.h"
  A::A()
  {
      B::ui-&gt;blancH2-&gt;setValue(2);
  }
  </code></pre>
  
  <p>B.h</p>
  
  <pre><code>#include &lt;QWidget&gt;
  #ifndef B_H
  #define B_H
  
  namespace Ui {
      class B;
  }
  class B
  {
      Q_OBJECT
  public:
      explicit B(QWidget *parent = 0);
  
  public:
      Ui::B *ui;
  };
  
  #endif 
  </code></pre>
  
  <p>As result of compiling I have next errors:
  A.cpp: In constructor 'A::A()': invalid use of incomplete type 'class Ui::B'
  B.h: forward declaration of 'class Ui::B'</p>
  
  <p>Can anybody explain why I have this errors?</p>