lena_pi/LenaPi/MouseEventSpy.h
2019-04-03 17:44:46 +02:00

27 lines
630 B
C++

#ifndef MOUSEEVENTSPY_H
#define MOUSEEVENTSPY_H
#include <QObject>
/**
* 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