That is a forward declaration of the class QToolButton
(if you google forward declaration c++ you will find plenty of good search results regarding this topic)
This allows the usage of the class QToolButton
for pointers and references, as long the members of QToolButton
are not accessed in that particular Header file.
The purpose of forward declarations is to speed up compilation. If you dont use forward declarations, you would need to include the Header file of QToolButton
.
This would mean, that every Source file which inclues the Header file of EnhancedLineEdit
also indirectly includes the Header file of QToolButton
, even if that class is not used in the Source file itself, which will slow down the compilation process.
So only the source file of EnhancedLineEdit
will need to include <QToolButton>
. Source files which include the header file of EnhancedLineEdit
wont need to do so, unless they want to make direct use of the class QToolButton
themselves. Otherwise the forward declaration is sufficient to allow the usage of pointers to QToolButton
in the header file of EnhancedLineEdit
.