Hi

This is my steps:

- I created the "Qt Widget Application"
- I opened the "MainWindow.ui" file and put on it the "mdiArea"
- I created the "Qt Designer Form Class" and wrote in the "MainWindow.h" and "MainWindow.cpp" files:
Qt Code:
  1. private:
  2. Ui::MainWindow *ui;
  3. FirstWindow *m_firstWindow;
  4. SecondWindow *m_secondWindow;
  5. ThirdWindow *m_thirdWindow;
To copy to clipboard, switch view to plain text mode 

MainWindow.cpp
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. m_firstWindow = new FirstWindow;
  8. m_secondWindow = new SecondWindow;
  9. m_thirdWindow = new ThirdWindow;
  10.  
  11. QMdiSubWindow *w1 = ui->mdiArea->addSubWindow( m_firstWindow );
  12. ui->mdiArea->addSubWindow( m_secondWindow );
  13. ui->mdiArea->addSubWindow( m_thirdWindow );
  14.  
  15. ui->mdiArea->cascadeSubWindows();
  16.  
  17. w1->resize( 500, 500 );
  18. }
To copy to clipboard, switch view to plain text mode 

- I opened "FirstWindow.h" and "FirstWindow.cpp" files and wrote:
FirstWindow.h
Qt Code:
  1. private:
  2. Ui::FirstWindow *ui;
  3. void keyPressEvent( QKeyEvent *event );
  4. };
To copy to clipboard, switch view to plain text mode 

FirstWindow.cpp
Qt Code:
  1. void FirstWindow::keyPressEvent(QKeyEvent *event)
  2. {
  3. qDebug() << "keyPressEvent";
  4. }
To copy to clipboard, switch view to plain text mode 

- I ran the application and pressed on the keys. But I didn't see the text "keyPressEvent" on the "Application Output"

Thank you!