Hi guys

I've created a small window (derived from QWidget) with a QProgressBar inside. Then I've created a thread class (derived from QThread). When i launch my file I create the window and the start the thread with an overloaded run method. I want that the thread (during the run) updates the progress bar at each operation. I've thought to the slots and signals system but I have problems: I've implemented a slot in the window class that updates the value of the progress bar and a signal in the thread class that invokes the slot method. In detail:

Qt Code:
  1. class Window: public QWidget {
  2.  
  3. data and methods
  4.  
  5. public slots:
  6. void updatePB(int);
  7.  
  8. };
  9.  
  10. void Window::updatePB(int val) { pb->setValue(val); }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. class Thread: public QThread {
  2.  
  3. data and methods
  4.  
  5. Window* pointerWindow;
  6.  
  7. signals:
  8. void signalUpdate(int);
  9. };
  10.  
  11. Thread::Thread (Window* w) {
  12. pointerWindow = w;
  13. connect (this,SIGNAL(signalUpdate(int)), pointerWindow, SLOT(updatePb(int)));
  14. }
  15.  
  16. void Thread::run() {
  17.  
  18. while (true) emit signalUpdate(30);
  19.  
  20. }
To copy to clipboard, switch view to plain text mode 

Now the questions are:
a) why doesn't it compile? It returns the error: no maching function for call to Thread::connect(Thread* const,const char*, Setup*&,const char*). I think the problem is the pointer to the window but I don't know why (I create the thread with: "Thread* th=new Thread(this);"
b) should I define the signal method?

Thanks a lot =)