blob: 9ecbb4d33bf6fd0bb396b336db260306437e82ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifndef AUTORESPONDSELECTIONLATCH_HPP
#define AUTORESPONDSELECTIONLATCH_HPP
#include <QObject>
#include <QTimer>
class AutoRespondSelectionLatch : public QObject
{
public:
enum { DefaultResetDelayMs = 6000 };
explicit AutoRespondSelectionLatch(QObject * parent = nullptr);
bool isSelected() const;
void selectFor(int delayMs = DefaultResetDelayMs);
void clear();
private:
QTimer m_resetTimer;
bool m_selected {false};
};
#endif
|