#ifndef MOUSEEVENTSPY_H #define MOUSEEVENTSPY_H #include /** * Catches all mouse event and starts timer -- basically behaves like a screensaver. * Based on * https://stackoverflow.com/questions/46173105/how-can-i-reset-a-timer-every-time-i-receive-a-touch-event-from-a-qml-page * * @todo implement timer and behavior on timeout. */ class MouseEventSpy : public QObject { Q_OBJECT public: explicit MouseEventSpy(QObject *parent = 0); static MouseEventSpy* instance(); protected: bool eventFilter(QObject* watched, QEvent* event); signals: void mouseEventDetected(); }; #endif // MOUSEEVENTSPY_H