I use wiringSerial.h library to read from USB port of raspi in thread
Qt Code:
  1. void MyThread::run()
  2. {
  3.  
  4. qDebug("Thread id inside run %d",(int)QThread::currentThreadId());
  5.  
  6. int fd ,value;
  7.  
  8. if ((fd = serialOpen ("/dev/ttyACM0",230400)) < 0)
  9. {
  10. fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
  11. }
  12.  
  13. while (serialDataAvail(fd)>-2)
  14. {
  15.  
  16. value=serialGetchar (fd) ;
  17.  
  18. msleep(1);
  19. emit signalValueUpdated(value);
  20. }
  21. serialClose(fd);
  22.  
  23. }
To copy to clipboard, switch view to plain text mode 

the data that received is a number between -1 to 255
when use value in emit signal Value Updated(value); or print it
the value is not the same value that send to raspberry pi, what should I do?