aboutsummaryrefslogtreecommitdiff
path: root/src/sensor.h
diff options
context:
space:
mode:
authorAlexis Maiquez Murcia <almamu@almamu.com>2019-02-19 16:56:26 +0100
committerAlexis Maiquez Murcia <almamu@almamu.com>2019-02-19 16:56:26 +0100
commita64ffe1153d7b637007c2dde8bd39c559c97a1fe (patch)
treed1b7d773b093fd5f9e82d6ec7fdbc2437e40431a /src/sensor.h
parent81aba56ae3ff565d5650ead18344c0d66ee62579 (diff)
downloadlead-a64ffe1153d7b637007c2dde8bd39c559c97a1fe.tar
lead-a64ffe1153d7b637007c2dde8bd39c559c97a1fe.tar.gz
lead-a64ffe1153d7b637007c2dde8bd39c559c97a1fe.zip
Added support for sensor leaving events with delay support
Here delay means the time the mouse has to be in the sensor for the leave event to trigger the action Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
Diffstat (limited to 'src/sensor.h')
-rw-r--r--src/sensor.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/sensor.h b/src/sensor.h
index ed5add8..bc4857b 100644
--- a/src/sensor.h
+++ b/src/sensor.h
@@ -41,7 +41,7 @@ class Sensor : public QWidget
Q_OBJECT
public:
- explicit Sensor(int x, int y, int w, int h, QString action, int interval);
+ explicit Sensor(int x, int y, int w, int h, QString enterAction, QString exitAction, int enterInterval, int exitInterval);
~Sensor();
protected:
@@ -49,12 +49,17 @@ protected:
void leaveEvent(QEvent * event);
private:
- QString action;
- QTimer *timer;
- int interval;
+ QString enterAction;
+ QString exitAction;
+ QTimer *enterTimer;
+ QTimer *exitTimer;
+ int enterInterval;
+ int exitInterval;
+ bool canTriggerExit;
public slots:
- void activate();
+ void activateEnter();
+ void activateExit();
};