hi

i have a problem in one of Qt example. I am following C++ GUI Programming with Qt, Second Edition and Using Qt Creator. I copy an example from this book but it is not working and showing error this error to me

Qt Code:
  1. Starting: "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" -w
  2.  
  3. mingw32-make: Entering directory `C:/Qt/2010.04/examples/find-build-desktop'
  4.  
  5. C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Debug
  6.  
  7. mingw32-make[1]: Entering directory `C:/Qt/2010.04/examples/find-build-desktop'
  8.  
  9. c:\Qt\2010.04\qt\bin\uic.exe ..\find\finddialog.ui -o ui_finddialog.h
  10.  
  11. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\qt\include\QtCore" -I"..\..\qt\include\QtGui" -I"..\..\qt\include" -I"..\..\qt\include\ActiveQt" -I"debug" -I"." -I"..\find" -I"." -I"..\..\qt\mkspecs\win32-g++" -o debug\main.o ..\find\main.cpp
  12.  
  13. mingw32-make[1]: Leaving directory `C:/Qt/2010.04/examples/find-build-desktop'
  14.  
  15. mingw32-make: Leaving directory `C:/Qt/2010.04/examples/find-build-desktop'
  16.  
  17. mingw32-make[1]: *** [debug/main.o] Error 1
  18.  
  19. mingw32-make: *** [debug] Error 2
  20.  
  21. The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
  22.  
  23. Error while building project find (target: Desktop)
  24.  
  25. When executing build step 'Make'
To copy to clipboard, switch view to plain text mode 

here is my code
finddialog.h
Qt Code:
  1. #ifndef FINDDIALOG_H #define FINDDIALOG_H
  2. #include <QDialog>
  3. class QCheckBox;
  4. class QLabel;
  5. class QlineEdit;
  6. class FindDialog : public QDialog
  7. {
  8. Q_OBJECT;
  9. public:
  10. FindDialog(QWidget *parent = 0);
  11. signals:
  12. void findNext(const QString &str, Qt::CaseSensitivity cs);
  13. void findPrevious(const QString &str, Qt::CaseSensitivity cs);
  14. private slots:
  15. void findClicked();
  16. void enableFindButton(const QString &text);
  17. private:
  18. QLabel *label;
  19. QLineEdit *lineEdit;
  20. QCheckBox *caseCheckBox;
  21. QCheckBox *backwardCheckBox;
  22. QPushButton *findButton;
  23. QPushButton *closeButton;
  24. };
  25. #endif
To copy to clipboard, switch view to plain text mode 

finddialog.cpp
Qt Code:
  1. #include <QtGui> #include "finddialog.h";
  2. FindDialog::FindDialog(QWidget *parent)
  3. :QDialog(parent)
  4. {
  5. label = new QLabel(tr("Find &what:"));
  6. lineEdit = new QLineEdit;
  7. label->setBuddy(lineEdit);
  8. caseCheckBox = new QCheckBox(tr("Match &case"));
  9. backwardCheckBox = new QCheckBox(tr("Search &backward"));
  10. findButton = new QPushButton(tr("&Find"));
  11. findButton->setDefault(true);
  12. findButton->setEnabled(false);
  13. closeButton = new QPushButton(tr("Close"));
  14. connect(lineEdit, SIGNAL(textChanged(const QString &)),
  15. this, SLOT(enableFindButton(const QString &)));
  16. connect(findButton, SIGNAL(clicked()),
  17. this, SLOT(findClicked()));
  18. connect(closeButton, SIGNAL(clicked()),
  19. this, SLOT(close()));
  20. QHBoxLayout *topLeftLayout = new QHBoxLayout;
  21. topLeftLayout->addWidget(label);
  22. topLeftLayout->addWidget(lineEdit);
  23. QVBoxLayout *leftLayout = new QVBoxLayout;
  24. leftLayout->addLayout(topLeftLayout);
  25. leftLayout->addWidget(caseCheckBox);
  26. leftLayout->addWidget(backwardCheckBox);
  27. QVBoxLayout *rightLayout = new QVBoxLayout;
  28. rightLayout->addWidget(findButton);
  29. rightLayout->addWidget(closeButton);
  30. rightLayout->addStretch();
  31. QHBoxLayout *mainLayout = new QHBoxLayout;
  32. mainLayout->addLayout(leftLayout);
  33. mainLayout->addLayout(rightLayout);
  34. setLayout(mainLayout);
  35. setWindowTitle(tr("Find"));
  36. setFixedHeight(sizeHint().height());
  37. }
  38. void FindDialog::findClicked()
  39. {
  40. QString text = lineEdit->text();
  41. QtCaseSensitivity cs =
  42. caseCheckBox->isChecked() ? Qt::CaseSensitive
  43. : Qt::CaseInsensitive;
  44. if(backwardCheckBox->isChecked())
  45. {
  46. emit findPrevious(text, cs);
  47. }
  48. else {
  49. emit findNext(text, cs);
  50. }
  51. }
  52. void FindDialog::enableFindButton(const QString &text)
  53. {
  54. findButton->setEnabled(!text.isEmpty());
  55. }
To copy to clipboard, switch view to plain text mode 

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