From a79a11d22dcb1bb0cbe47874d7f8ff5d58f2271a Mon Sep 17 00:00:00 2001 From: MageJohn Date: Mon, 18 Feb 2019 23:34:31 +0000 Subject: Implement basic delay support The ini file now has two entries for each corner, one for the action to be performed and one for the interval after which it will be performed if the mouse doesn't leave the hot corner/edge. This is a little inelegant, and I'd like to make the ini file nicer at some point. --- src/sensor.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/sensor.h') diff --git a/src/sensor.h b/src/sensor.h index 0a400b6..ed5add8 100644 --- a/src/sensor.h +++ b/src/sensor.h @@ -30,6 +30,7 @@ SOFTWARE. #include #include +#include namespace Lead { @@ -40,14 +41,21 @@ class Sensor : public QWidget Q_OBJECT public: - explicit Sensor(int x, int y, int w, int h, QString action); + explicit Sensor(int x, int y, int w, int h, QString action, int interval); ~Sensor(); protected: void enterEvent(QEvent * event); + void leaveEvent(QEvent * event); private: QString action; + QTimer *timer; + int interval; + +public slots: + void activate(); + }; -- cgit v1.2.3