Hi All,

I feel like this should be simple I am just not sure what is going on.

I've got a ProgressUpdator function used to handle the signal updates of a progress bar:
Qt Code:
  1. #ifndef PROGRESSUPDATOR_H
  2. #define PROGRESSUPDATOR_H
  3.  
  4. #include <QObject>
  5.  
  6. class ProgressUpdator : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit ProgressUpdator(QObject *parent = nullptr);
  11.  
  12. signals:
  13. void updateProgress(int progress);
  14.  
  15. public:
  16. void setProgress(int progress);
  17. };
  18.  
  19. #endif // PROGRESSUPDATOR_H
To copy to clipboard, switch view to plain text mode 

with my .cpp file being:
Qt Code:
  1. #include "progressupdator.h"
  2.  
  3. ProgressUpdator::ProgressUpdator(QObject *parent) : QObject(parent)
  4. {}
  5.  
  6. void ProgressUpdator::setProgress(int progress)
  7. {
  8. emit updateProgress(progress);
  9. }
To copy to clipboard, switch view to plain text mode 

This is called from a class performing the algorithm
Qt Code:
  1. for (int i=0; i<100; ++i)
  2. {
  3. // Do work
  4. progressUpdator->setProgress(i);
  5. }
To copy to clipboard, switch view to plain text mode 

Any my .pro file has all files added to HEADERS and SOURCES as needed.

But this comes up with a undefined reference to setProgress().

If I try and get around this and put the contents of setProgress in the header file as an inline function the linker then complains that it cannot find the reference to updateProgress instead.

I've also tried running qmake and rebuilding but this doesn't make a difference.

Thanks in advance.