Hi All,
I am trying to use qfilesystemwatcher on a touch input file to detect touch idleness for a specific amount of time, And turn Display back light off/on accordingly. But I don't see the signal being triggered, when the file changed. The touch file I am monitoring is "/dev/input/event0" which is event file assocaited with my touch driver. When I check using cat command I could see this file being changed on each touch I do, But not working in my code using qfilesystemwatcher. Can you please look at my code and see, If I am missing anything?

Qt Code:
  1. QFileSystemWatcher *touchFileWatcher;
  2. QStringList *watchPaths = new QStringList(Inputfile);
  3. touchFileWatcher = new QFileSystemWatcher(*watchPaths,parent);
  4. qDebug() << "touchFileWatcher Files: " << touchFileWatcher->files();
  5. connect(touchFileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(touchFileChanged(const QString &)));
  6.  
  7. void Hardware::touchFileChanged(const QString &path)
  8. {
  9. qDebug() << "File changed" << path;
  10. }
To copy to clipboard, switch view to plain text mode