Hi everyone, I have just downloaded QT 5.4.1 for a couple of days. Because there is no book for Qt 5, I use the book named "C++ GUI Programming with Qt 4". I'm learning about QDialog and Qt Designer, and I copied the source code from that book to run on my Qt. However, it didn't work but announced "The inferior stopped because it triggered an exception.". I don't know why. Here are he source code:
The header:
Qt Code:
  1. #ifndef GOTOCELLDIALOG_H
  2. #define GOTOCELLDIALOG_H
  3.  
  4. #include <QDialog>
  5. #include "ui_gotocelldialog.h"
  6.  
  7. namespace Ui
  8. {
  9. class GoToCellDialog;
  10. }
  11.  
  12. class GoToCellDialog : public QDialog, public Ui::GoToCellDialog
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit GoToCellDialog(QWidget *parent = 0);
  17. ~GoToCellDialog();
  18. private slots:
  19. void on_lineEdit_textChanged();
  20. private:
  21. Ui::GoToCellDialog *ui;
  22. };
  23.  
  24. #endif // GOTOCELLDIALOG_H
To copy to clipboard, switch view to plain text mode 

The implementation of the class:
Qt Code:
  1. #include "gotocelldialog.h"
  2.  
  3. GoToCellDialog::GoToCellDialog(QWidget *parent)
  4. :QDialog(parent),
  5. ui(new Ui::GoToCellDialog)
  6. {
  7. ui->setupUi(this);
  8.  
  9. QRegExp regExp("[A-Za-z][1-9][0-9]{0,2}");
  10. lineEdit->setValidator(new QRegExpValidator(regExp, this));
  11.  
  12. connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
  13. connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
  14. }
  15.  
  16. GoToCellDialog::~GoToCellDialog()
  17. {
  18. delete ui;
  19. }
  20.  
  21. void GoToCellDialog::on_lineEdit_textChanged()
  22. {
  23. okButton->setEnabled(lineEdit->hasAcceptableInput());
  24. }
To copy to clipboard, switch view to plain text mode 

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

There's also a .ui file that contains a label, lineEdit, okButton and cancelButton. Please help me solve this error. Thanks in advance.