Quote Originally Posted by wysota View Post
Use QSocketNotifier on your /dev/button to be notified of changes in the button and only react when there actually is a change. There is no point in having a busy loop (and wasting cpu power and electricity) just for reading the button status.
Now i have tried both ways using processevents and Qsocketnotifier.
placing process events in a loop made the application heavy since CPU load
Qsocketnotifier works very good. now i have to check how fast the signals are caught.
here is the part for the code:

Qt Code:
  1. buttons_fd = ::open("/dev/buttons", 0);
  2. QSocketNotifier *sockerNotifier= new QSocketNotifier(buttons_fd,QSocketNotifier::Read,this);
  3. connect(sockerNotifier,SIGNAL(activated(int)),this,SLOT(notify()));
To copy to clipboard, switch view to plain text mode 


thank you for your help