Hi guys, I got a little Problem with a forward declaration. It may be solved easily, but I don't find my mistake.

I got a class TrackElement that has exactly the following header file.

Qt Code:
  1. #ifndef TRACKELEMENT_H
  2. #define TRACKELEMENT_H
  3.  
  4. #include <QLabel>
  5.  
  6. #include "tracktest.h"
  7.  
  8. class TrackTest;
  9.  
  10. class TrackElement : public QLabel
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit TrackElement(TrackTest *parent = 0);
  15.  
  16. private:
  17. TrackTest test;
  18. };
  19.  
  20. #endif // TRACKELEMENT_H
To copy to clipboard, switch view to plain text mode 

First, when I didn't use the forward declaration, the constructor had problems with it too, because im using the TrackElement to create TrackTest and vice versa.
With the forward declaration the constructor causes no errors, but my private test variable of type TrackTest does. "field 'test' has incomplete type"

I don't get it why, if I create a new TrackTest file in the TrackElement .cpp-file, there is no error at all.

Thanks for fast answers