tbscope , i checked that but i didn't initialise any of the UI items manually.i left what uic generated . Is that necessary to initialise them ?

here's the code ....they're simple .
mainwindow.h

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

mainwindow.cpp

Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5. QMainWindow(parent),
  6. ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9. }
  10. MainWindow::~MainWindow()
  11. {
  12. delete ui;
  13. }
  14. void MainWindow::on_login_clicked()
  15. {
  16. user=usernameip->displayText();
  17. pass=passwordip->displayText();
  18. if(user.compare("user")&&pass.compare("pass"))
  19. {
  20. //msg.setText("The username is correct");
  21. //msg.exec();
  22. }
  23. }
To copy to clipboard, switch view to plain text mode 

And the uic generated file ui_mainwindow.h file
Does anyone has idea wat's wrong ?