View Full Version : Error declaring Qt object
Doug Broadwell
9th September 2007, 20:59
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
marcel
9th September 2007, 21:06
Try a forward declaration at the beginning of your header, after the include section:
class QDirModel;
Note that in the cpp you have to include QDirModel.
Regards
jpn
9th September 2007, 21:06
Depending on your needs, either forward declare:
class QDirModel;
or include the header:
#include <QDirModel>
Doug Broadwell
9th September 2007, 21:15
Thanks very much !
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.