I do not have much experience with C++ and I have a question regarding the following lines from Qt documentation here : http://qt-project.org/doc/qt-4.8/mainwindows-application-mainwindow-h.html ( Lines 4-6 after the comment at the top )
class QAction;
class QMenu;
class QPlainTextEdit;
Since QAction, QMenu and QPlainTextEdit are library classes of Qt ( clicking on them leads to their documentation pages), shouldn't they be included using '#include ' ? What purpose does just declaring them with the keyword 'class' serve ? As far as I think , the compiler will think of it as a completely new class, having nothing to do with the library class QAction.
However, the 'mainwindow.cpp' file ( http://qt-project.org/doc/qt-4.8/mainwindows-application-mainwindow-cpp.html ) does not contain any definition of class QAction, though its objects are being used in the code.
What is going on here ?
Edit : Further explanation of the problem
Look into the createActions method of class MainWindow ( http://qt-project.org/doc/qt-4.8/mainwindows-application-mainwindow-cpp.html ). Here objects of class QAction are being created but nowhere can I find a definition of QAction class.