title: Error while declaring QVector of class type
body: <p>Getting error while declaring QVector of class type in Qt.</p>
  
  <p>Error :<strong>"incomplete type is not allowed"</strong></p>
  
  <p>I didn't understand what causes this error.</p>
  
  <p>if i #include "storage.h" in main.cpp and declare a Qvector of class storeage it works fine but when i do the same in waveform class it reports an error.</p>
  
  <p>I've tried forward declaring storage class in waveform class but still getting the same error.</p>
  
  <p>Any Help??</p>
  
  <p>main.cpp</p>
  
  <pre><code>#include "test_subject_02.h"
  #include &lt;QtGui/QApplication&gt;
  
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      TEST_SUBJECT_02 w;
      w.show();
      return a.exec();
  }
  </code></pre>
  
  <p>test_subject_02.h</p>
  
  <pre><code>#ifndef TEST_SUBJECT_02_H
  #define TEST_SUBJECT_02_H
  
  #include &lt;QtGui/QMainWindow&gt;
  #include "ui_test_subject_02.h"
  #include"waveform.h"
  #include "storage.h"
  
  
  class TEST_SUBJECT_02 : public QMainWindow
  {
      Q_OBJECT
  
  public:
      TEST_SUBJECT_02(QWidget *parent = 0, Qt::WFlags flags = 0);
      waveform *wv;
      ~TEST_SUBJECT_02();
  
  private:
      Ui::TEST_SUBJECT_02Class ui;
  };
  
  #endif // TEST_SUBJECT_02_H
  </code></pre>
  
  <p>test_subject_02.cpp</p>
  
  <pre><code>#include "test_subject_02.h"
  
  TEST_SUBJECT_02::TEST_SUBJECT_02(QWidget *parent, Qt::WFlags flags)
      : QMainWindow(parent, flags)
  {
      ui.setupUi(this);
      QVector&lt;storage&gt; ser; //works fine here
      wv-&gt;readfile("e:/testing2/result/3/abc.cur");
  
  }
  
  TEST_SUBJECT_02::~TEST_SUBJECT_02()
  {
  
  }
  </code></pre>
  
  <p>waveform.h</p>
  
  <pre><code>#ifndef WAVEFORM_H
  #define WAVEFORM_H
  
  #include "storage.h"
  #include &lt;QObject&gt;
  
  class waveform : public QObject
  {
      Q_OBJECT
  
  
  public:
      waveform(QObject *parent=0);
      void readfile(QString);
  
      QVector &lt;storage&gt; myvector ; // incomplete type is not allowed
      ~waveform();
  
  private:
  
  };
  
  #endif // WAVEFORM_H
  </code></pre>
  
  <p>waveform.cpp</p>
  
  <pre><code>#include "waveform.h"
  
  waveform::waveform(QObject *parent)
      : QObject(parent)
  {
  
  }
  
  void waveform::readfile(QString file)
  {  
      QVector&lt;storage&gt; sw; //again error incomplete type is not allowed
  
  }
  
  waveform::~waveform()
  {
  
  }
  </code></pre>
  
  <p>storage.h</p>
  
  <pre><code>#ifndef STORAGE_H
  #define STORAGE_H
  
  #include &lt;QObject&gt;
  
  class storage : public QObject
  {
      Q_OBJECT
  
  public:
      storage(QObject *parent);
      storage();
      storage(QString,QString);
      ~storage();
  
  private:
      QString x;
      QString y;
  
  };
  
  #endif // STORAGE_H
  </code></pre>
  
  <p>storage.cpp</p>
  
  <pre><code>#include "storage.h"
  
  storage::storage(QObject *parent)
      : QObject(parent)
  {
  
  }
  
  storage::storage(QString xcord,QString ycord)
  {
      x=xcord;
      y=ycord;
  
  }
  
  storage::storage()
  {
  
  }
  
  storage::~storage()
  {
  
  }
  </code></pre>