hi
i am trying to print a no. o points on canvas. These points are read from a fifo through a clas MyThread.
Qt Code:
  1. class MyThread: public QThread
  2. {
  3. Q_OBJECT
  4. public:
  5. MyThread(QObject *parent=0);
  6. ~MyThread();
  7. double x;
  8. double y;
  9.  
  10. protected:
  11. void run();
  12. signals:
  13. void dataAvailable();
  14. public slots:
  15. void startThread();
  16.  
  17. };
  18.  
  19. #endif
To copy to clipboard, switch view to plain text mode 
amd its implementation is as
Qt Code:
  1. #ifndef MYTHREAD_cpp
  2. #define MYTHREAD_cpp
  3. #include <stdio.h>
  4. #include <sys/types.h>
  5. #include <sys/stat.h>
  6. #include <fcntl.h>
  7. #include <unistd.h>
  8. #include "MyThread.h"
  9. #include <iostream.h>
  10.  
  11.  
  12. MyThread::MyThread(QObject *parent) :QThread(parent)
  13. {
  14.  
  15. }
  16.  
  17. MyThread::~MyThread()
  18. {
  19. }
  20.  
  21. void MyThread::run()
  22. {
  23. int fd0;
  24.  
  25.  
  26. fd0 = open("/home/prince/mydev01",O_RDWR);
  27. if(fd0== -1)
  28. cout<<"\n------------------- No fifo found///////---------------------\n\n";
  29. else
  30. cout<<" Fifo founf \n";
  31.  
  32. read(fd0,&x,sizeof(int));
  33. read(fd0,&y,sizeof(int));
  34. printf("\nReceived x = %d & y = %d from RTCore\n",
  35. x,y);
  36. close(fd0);
  37. emit dataAvailable();
  38. }
  39. void MyThread::startThread()
  40. {
  41. start(LowPriority);
  42. }
  43.  
  44.  
  45. #endif
To copy to clipboard, switch view to plain text mode 

I need to refresh view every second. So a Timer generates a signal everysecond to run some code to claa slot MyThread::startThread(). Control reaches and it also goes to run(). But either it donot enters run() ( i checked it with gdb breakpoint method) or before reads it again comes to MyThread::startThread().
I couldn't figure out the cause