30 lines
532 B
C++
30 lines
532 B
C++
#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
|