Hello. In my program is the class MainWindow, which is inherited from QMainWindow. Is it possible to create another class, which would be the heir to MainWindow. I want to create objects by these classes in main.cpp and call methods. Just when I attempted such an implementation methods successor from MainWindow not performed.

.h

Qt Code:
  1. class MainWindow : public QMainWindow
  2. {
  3. Q_OBJECT
  4. QWidget *centralWidget;
  5. public:
  6. MainWindow (QWidget* parent=0);
  7. QwtPlot *funPlot;
  8. }
  9. class OptionPlot : public MainWindow
  10. {
  11. Q_OBJECT
  12. public:
  13. OptionPlot (QWidget* parent=0);
  14. ...
  15. }
To copy to clipboard, switch view to plain text mode 

.cpp

Qt Code:
  1. ...
  2. MainWindow::MainWindow(QWidget *parent):
  3. QMainWindow(parent) {
  4. funPlot = new QwtPlot(this);
  5. }
  6. OptionPlot:OptionPlot(QWidget *parent):
  7. MainWindow(parent) {
  8. }
  9. ...
  10. // implementation of methods MainWindow class and OptionPlot further
To copy to clipboard, switch view to plain text mode 

main.cpp

Qt Code:
  1. ...
  2. QApplication app(argc, argv);
  3. MainWindow *window = new MainWindow;
  4. OptionPlot *option1 = new OptionPlot;
  5.  
  6. window->setPlot();
  7. window->setGrid();
  8. window->createMenu();
  9.  
  10. option1->setCurve();
  11. option1->addPoints();
  12. option1->setCheckBox();
  13. ...
  14. return app.exec();
To copy to clipboard, switch view to plain text mode 

The window is created, the grid and the menu too, but CheckBoxes and graphics isn't. What is a mistake of that realization?