Hello. I'm trying to make a widget and a child widget. I'd like Widget2 to be a child of Widget. Would anybody be able to check if I'm doing it right. Thanx

main.cpp:
Qt Code:
  1. .......
  2. Widget2::Widget2(Widget* parent): Widget(parent)
  3. {
  4. }
  5.  
  6. Widget::Widget(QWidget* parent): QWidget(parent)
  7. {
  8. }
  9. ......
To copy to clipboard, switch view to plain text mode 

hfile.h
Qt Code:
  1. #ifndef HFILE_H
  2. #define HFILE_H
  3.  
  4. #include <QtGui>
  5.  
  6. class Widget : public QWidget
  7. {
  8. Q_OBJECT
  9. public:
  10. Widget (QWidget* parent = 0);
  11. protected:
  12. private:
  13. };
  14.  
  15. class Widget2 : public Widget
  16. {
  17. Q_OBJECT
  18. public:
  19. Widget2 (Widget* QWidget);
  20. protected:
  21. private:
  22. };
  23. #endif
To copy to clipboard, switch view to plain text mode