Hello,

I am new to QT.. well my question is probably is a basic C++ thingy anyway..

I want to develop the application and having in mind that i should make each window in it's own c++ file, for a start i want to have the main.cpp to only contain the basic application setup, then develop the mainwindow in another c++ file, for example:

main.cpp:
Qt Code:
  1. #include "main.h"
  2. #include <QApplication>
  3. int main(int argc, char *argv[])
  4. {
  5. QApplication a(argc, argv);
  6.  
  7. return a.exec();
  8. }
To copy to clipboard, switch view to plain text mode 

then have a mainwindow class in another c++ file

mainWindow.cpp
Qt Code:
  1. #include <QMainWindow>
  2.  
  3. class MainWindow : public QMainWindow
  4. {
  5. public:
  6. MainWindow();
  7.  
  8. };
  9.  
  10. MainWindow::MainWindow()
  11. {
  12. setWindowTitle("Test");
  13. }
To copy to clipboard, switch view to plain text mode 

now i want to know how to add the MainWindow class to the app in main.cpp? i mean how to add it to the application then call it from there?