I've returned to programming after a while and so I'm rusty. I previously used Qdevelop and Qt 4.5 designer. I'm writing and designing another app in QtCreator. I decided to ease myself back in by getting my file -quit code to work. I copied and pasted the code over from my other app where it works. Surprise surprise it didn't work in the new one. By searching around I've managed to reduce the error to one. I've included CloseEvent in my mainwindow.cpp file and put a foward class declaration in my manwindow.hpp file something I did not have to do previously.

Qt Code:
  1. #ifndef QTSOLARDATAMAINWINDOW_H
  2. #define QTSOLARDATAMAINWINDOW_H
  3. #include <QMainWindow>
  4.  
  5. class QCloseEvent; // foward declaration of class
  6.  
  7.  
  8. namespace Ui {
  9. class QtSolarDataMainWindow;
  10. }
  11.  
  12.  
  13.  
  14. class QtSolarDataMainWindow : public QMainWindow
  15. {
  16. Q_OBJECT
  17.  
  18. public:
  19. explicit QtSolarDataMainWindow(QWidget *parent = 0);
  20. ~QtSolarDataMainWindow();
  21.  
  22. protected:
  23.  
  24. void closeEvent(QCloseEvent *event);
  25.  
  26. private:
  27. Ui::QtSolarDataMainWindow *ui;
  28.  
  29. private slots:
  30.  
  31. };
  32.  
  33. #endif // QTSOLARDATAMAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. include "qtsolardatamainwindow.h"
  2. #include "ui_qtsolardatamainwindow.h"
  3. #include <QCloseEvent>
  4.  
  5.  
  6. QtSolarDataMainWindow::QtSolarDataMainWindow(QWidget *parent) :
  7. QMainWindow(parent),
  8. ui(new Ui::QtSolarDataMainWindow)
  9. {
  10. ui->setupUi(this);
  11.  
  12. // signals and slots on constructor
  13.  
  14.  
  15. // file menu
  16. connect(action_Quit_Ctrl_Q, SIGNAL(triggered()), this, SLOT(close()));
  17.  
  18. }
  19.  
  20.  
  21. QtSolarDataMainWindow::~QtSolarDataMainWindow()
  22. {
  23. delete ui;
  24. }
  25.  
  26.  
  27. void QtSolarDataMainWindow::closeEvent(QCloseEvent *event)
  28. {
  29.  
  30. // writeSettings();
  31. event->accept();
  32.  
  33. }
To copy to clipboard, switch view to plain text mode 

I'm absolutely sure my signal has the right name that's its object name in the creator form designer. But its this line that is causing trouble

qtsolardatamainwindow.cpp: In constructor ‘QtSolarDataMainWindow::QtSolarDataMainWindo w(QWidget*)’:
qtsolardatamainwindow.cpp:16:13: error: ‘action_Quit_Ctrl_Q’ was not declared in this scope

Where am I going wrong and just out of interest why the change? Thankyou very much.