I want to set the text of a label when I click a button.

I have a button called 'pushButton' and a label called 'label'.

My form class is like this (buttonform.h):

Qt Code:
  1. #ifndef BUTTONFORM_H
  2. #define BUTTONFORM_H
  3.  
  4. #include "ui_buttonform.h"
  5.  
  6. class ButtonForm : public QWidget
  7. {
  8. Q_OBJECT
  9.  
  10. public:
  11. ButtonForm(QWidget *parent = 0);
  12.  
  13. private slots:
  14. //void pushButton_Clicked();
  15.  
  16. signals:
  17. void pushButton_Clicked();
  18. private:
  19. Ui::ButtonForm ui;
  20. };
  21.  
  22. #endif
To copy to clipboard, switch view to plain text mode 

In buttonform.cpp, I had this:
Qt Code:
  1. #include <QtGui>
  2.  
  3. #include "buttonform.h"
  4. #include <iostream>
  5.  
  6. ButtonForm::ButtonForm(QWidget *parent)
  7. : QWidget(parent)
  8. {
  9. ui.setupUi(this);
  10. }
  11.  
  12. void ButtonForm::pushButton_Clicked()
  13. {
  14. ui.label->setText("hello");
  15. }
To copy to clipboard, switch view to plain text mode 

but it tells me that pushButton_Clicked() is already defined in moc_buttonform.cxx.

How should I go about doing this?

Thanks!

Dave