Quote Originally Posted by naturalpsychic View Post
i dont understand why are my signals not working in this multi threaded app
Have a look at the comments I have inserted into your code snippets
file.h:
Qt Code:
  1. #include <QObject>
  2.  
  3.  
  4. class FThread;
  5.  
  6. class File : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. File(QObject *parent = 0);
  11. FThread *fthread;
  12. // ^^^^^ Where does this pointer ever get an instance of FThread attached to it?
  13. public slots:
  14. void print();
  15.  
  16. };
To copy to clipboard, switch view to plain text mode 

file.cpp:
Qt Code:
  1. #include "file.h"
  2. #include <QDebug>
  3. #include "fthread.h"
  4.  
  5. File::File(QObject *parent) :
  6. QObject(parent)
  7. {
  8.  
  9. connect(fthread,SIGNAL(done()),this,SLOT(print()));
  10. // ^^^^^ you use fthread here but is has not been initialised either 0 (NULL)
  11. // or to be a valid pointer.
  12. // On the way to crash city
  13.  
  14. }
  15. void File::print(){
  16. qDebug()<<"printing from File object";
  17. fthread.exit();
  18. // ^^^^^ given that fthread is a pointer I am surprised this even compiles
  19. }
To copy to clipboard, switch view to plain text mode 

NOTE:

i get following output:

App started
The program has unexpectedly finished.
...path/Thread exited with code 0

means it is exiting without error
Which part of "The program has unexpectedly finished." means "exiting without error"?

Have you single-stepped the program to see at what point the program terminates unexpectedly?