Hi people,
I'm a beginner in C++ and recently started learning Qt. I was just going through the QT 'Find Files' example when I got this doubt. It is regarding some elements of the 'window.h' header file which is part of the 'Find Files' example.
First let me post the source of the window.h file. Then I'll ask my doubt.
window.h
Qt Code:
#ifndef WINDOW_H #define WINDOW_H #include <QDialog> class QComboBox; class QDir; class QLabel; class QPushButton; class QTableWidget; { Q_OBJECT public: private slots: void browse(); void find(); private: void createFilesTable(); QComboBox *fileComboBox; QComboBox *textComboBox; QComboBox *directoryComboBox; QLabel *fileLabel; QLabel *textLabel; QLabel *directoryLabel; QLabel *filesFoundLabel; QPushButton *browseButton; QPushButton *findButton; QTableWidget *filesTable; }; #endifTo copy to clipboard, switch view to plain text mode
Doubt Questions:
As you can see above, all the classes of objects that have been used in the header file have been forward declared (like QLabel, QPushbutton, QDir etc. etc.). But in line no. 24, an object of class QStringlist has been declared without any forward declaration of the class QStringlist. A similar case can be found in line no. 17 where the function takes a argument of the type QWidget.
Can anyone explain why these two classes were not forward declared?
Regards,
Bookmarks