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?
qDebug() << "touchFileWatcher Files: " << touchFileWatcher->files();
connect(touchFileWatcher,
SIGNAL(fileChanged
(const QString &)),
this,
SLOT(touchFileChanged
(const QString &)));
void Hardware
::touchFileChanged(const QString &path
) {
qDebug() << "File changed" << path;
}
QFileSystemWatcher *touchFileWatcher;
QStringList *watchPaths = new QStringList(Inputfile);
touchFileWatcher = new QFileSystemWatcher(*watchPaths,parent);
qDebug() << "touchFileWatcher Files: " << touchFileWatcher->files();
connect(touchFileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(touchFileChanged(const QString &)));
void Hardware::touchFileChanged(const QString &path)
{
qDebug() << "File changed" << path;
}
To copy to clipboard, switch view to plain text mode
Bookmarks