I have the following code in file mainwindow.h:

Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5. #include "logindialog.h"
  6.  
  7. namespace Ui {
  8. class MainWindow;
  9. }
  10.  
  11. class MainWindow : public QMainWindow
  12. {
  13. Q_OBJECT
  14.  
  15. private:
  16. Ui::MainWindow *ui;
  17. LoginDialog *logindialog;
  18.  
  19. public:
  20. explicit MainWindow(QWidget *parent = 0);
  21. ~MainWindow();
  22.  
  23. private slots:
  24. void ALogin_Clicked();
  25. void LoginDialog_Destroyed();
  26.  
  27. };
  28.  
  29. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

Other related files:
logindialog.cpp
logindialog.h
mainwindow.cpp

Everything works fine, until I put ANY changes into logindialog.cpp file. When I do, I get the following error in line 17:

Qt Code:
  1. c:\users\mati\komunikator_klient_da_ze\mainwindow.h:17: błąd:C2143: syntax error : missing ';' before '*'
  2. c:\users\mati\komunikator_klient_da_ze\mainwindow.h:17: błąd:C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  3. c:\users\mati\komunikator_klient_da_ze\mainwindow.h:17: błąd:C4430: missing type specifier - int assumed. Note: C++ does not support default-int
To copy to clipboard, switch view to plain text mode 

The problem can easily be fixed, by removing line 17, recompliling the project (which gives even more errors) and then putting that line back. Everything will work fine, until I change logindialog.cpp again.
While it doesn't make it impossible to continue the project, it makes it very annoying...
The IDE I use is QtCreator 2.4.1

Could someone please help me?