Hi I am connection to application using dbus.
One application is using gui. and another one is non-gui application.
I am sending touch events(i.e click event, focus event) from gui application to non-gui application using dbus.
I am able to get events from gui to non-gui application.
But I am having few other critical task(dsp hpi communication etc) to call from non-gui application and i cant spend 1ms each time to call QCoreApplication::ProcessEvents(QEventLoop::AllEve nts,1);

so my code is as below,
Qt Code:
  1. while(1)
  2. {
  3. /* setTimer(20); // timer overflow will set this flag on every 20msec
  4.   if(g20MsecTimer == TRUE)
  5.   {
  7.   // I am calling process event task on every 20 msec
  8.   QCoreApplication::ProcessEvents(QEventLoop::AllEvents,1);
  9.   g20MsecTimer = FLASE;
  11.   }
  12.   dsptask();
  13.   //few other task ...
  15. }
To copy to clipboard, switch view to plain text mode 

this result in a very long response time arount 5 to 10 seconds and gui gets freeze for this period.

Can anybody suggest any solution to process event eventually without getting gui freeze

But if I use below code gui works fine, but i cant afford it because i dont know how much exact time will qt take to process events.
Qt Code:
  1. while(1)
  2. {
  5. QCoreApplication::ProcessEvents(QEventLoop::AllEvents,1);
  6. dsptask();
  7. //few other task ...
  9. }
To copy to clipboard, switch view to plain text mode