Forward declaration error inside include qtableview.h
-
Hello.
I'm trying to build this program using Qt Creator but during compilation I get this error:
The compiler is calling incomplete type class QHeaderView and directs the problem to the forward declaration of QHeaderView inside qtableview.h. I have no idea what could be causing this since qtableview.h is a file from Qt sources. Nothing has been modified inside those files.
Any help would be appreciated. -
Just include QHeaderView in your cpp file.
-
It worked, thanks.
Don't really know what happended there, but it did work.
Thank you very much. -
@smillmorel said in Forward declaration error inside include qtableview.h:
Don't really know what happended there, but it did work.
There is no magic to it. Some Qt classes only forward declare the classes they use internally. If you use them in your code, you need to include them on your side.