Files
GUI/src/keyboard/SwitchInputModeButton.h

30 lines
532 B
C
Raw Normal View History

2022-07-20 17:05:50 +08:00
#ifndef SWITCHINPUTMODEBUTTON_H
#define SWITCHINPUTMODEBUTTON_H
#include <QPushButton>
#include <QTimer>
class SwitchInputModeButton : public QPushButton
{
Q_OBJECT
public:
explicit SwitchInputModeButton(QWidget *aParent = nullptr);
~SwitchInputModeButton();
signals:
void repeatPress();
void singlePress();
private slots:
void handleButtonPressed();
void handleButtonReleased();
void prepareRepeatPress();
private:
bool mIsRepeat;
QTimer* mTimer;
};
#endif // SWITCHINPUTMODEBUTTON_H