Error declaring Qt object
If I try to declare a QDirModel pointer in my class declaration in my header (QDirMidel* pDirModel), I get the error "ISO C++ forbids declaration of 'QDirModel' with no type".
If I declare other objects (e.g., QPainter* pPainter), I get no such error.
???
Thanks
Re: Error declaring Qt object
Try a forward declaration at the beginning of your header, after the include section:
Note that in the cpp you have to include QDirModel.
Regards
Re: Error declaring Qt object
Depending on your needs, either forward declare:
or include the header:
Code:
#include <QDirModel>
Re: Error declaring Qt object