So I'm trying to have my slot emit a signal but I am getting the error " C2065 emit undeclared identifier." I think I have all the includes I need. I'm probably just doing something stupid, here is my code:

Qt Code:
  1. class MyWidget : public QWidget
  2. {
  3. Q_OBJECT
  4. .....
  5.  
  6. Q_SIGNALS:
  7. void validFile();
  8.  
  9. public Q_SLOTS:
  10. void enterFile();
  11. void getDates();
  12. void slotButtonLoads();
  13. };
  14.  
  15. MyWidget::MyWidget(QWidget * parent):QWidget(parent){
  16. ...
  17. push = new QPushButton("Plot", this);
  18. connect(push, SIGNAL(clicked()), this, SLOT(enterFile()));
  19. connect(push, SIGNAL(validFile()),this, SLOT(getDates())); ///also I don't know what my sender should be for this new signal, 'push' is probably not right
  20. }
  21.  
  22. void MyWidget::enterFile()
  23. {
  24. QString textEntered = lineedit->text();
  25. FileName = qstrdup( textEntered.toLatin1() );
  26. if (fopen (FileName, "rb") == NULL){
  27. emit validFile();
  28. }else{
  29. //something } //// a third question.. how can I allow the user to try again with the filename. I don't think I should
  30. ////// push->disconnect() because it will break my connection
  31. }
To copy to clipboard, switch view to plain text mode 

Thanks for all the help