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:
  1. #ifndef WINDOW_H
  2. #define WINDOW_H
  3.  
  4. #include <QDialog>
  5.  
  6. class QComboBox;
  7. class QDir;
  8. class QLabel;
  9. class QPushButton;
  10. class QTableWidget;
  11.  
  12. class Window : public QDialog
  13. {
  14. Q_OBJECT
  15.  
  16. public:
  17. Window(QWidget *parent = 0);
  18.  
  19. private slots:
  20. void browse();
  21. void find();
  22.  
  23. private:
  24. QStringList findFiles(const QDir &directory, const QStringList &files,
  25. const QString &text);
  26. void showFiles(const QDir &directory, const QStringList &files);
  27. QPushButton *createButton(const QString &text, const char *member);
  28. QComboBox *createComboBox(const QString &text = QString());
  29. void createFilesTable();
  30.  
  31. QComboBox *fileComboBox;
  32. QComboBox *textComboBox;
  33. QComboBox *directoryComboBox;
  34. QLabel *fileLabel;
  35. QLabel *textLabel;
  36. QLabel *directoryLabel;
  37. QLabel *filesFoundLabel;
  38. QPushButton *browseButton;
  39. QPushButton *findButton;
  40. QTableWidget *filesTable;
  41. };
  42.  
  43. #endif
To 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,