41 lines
898 B
C++
41 lines
898 B
C++
#ifndef TOUCH_BUTT_H
|
|
#define TOUCH_BUTT_H
|
|
|
|
#include <QPushButton>
|
|
#include <QPalette>
|
|
#include <QEvent>
|
|
#include <QTimer>
|
|
#include <QDebug>
|
|
|
|
class touch_butt : public QPushButton
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
touch_butt(int butt_index, QString caption, QColor colr, QColor colg, QColor colw, QColor colp, QPushButton * parent = 0);
|
|
int index;
|
|
void setRed();
|
|
void setGreen();
|
|
void setWhite();
|
|
void setColor(QColor colr, QColor colg, QColor colw, QColor colp);
|
|
QColor color() const {return next_col;}
|
|
public slots:
|
|
void butt_click();
|
|
void butt_toggle(bool checked);
|
|
private:
|
|
QTimer * timer;
|
|
QColor aim_col, next_col;
|
|
QColor cr,cg,cw,cp;
|
|
bool is_push;
|
|
void setPush();
|
|
private slots:
|
|
void butt_push();
|
|
void butt_release();
|
|
void timerDone();
|
|
signals:
|
|
void touch_push(int index);
|
|
void touch_click(int index);
|
|
void touch_toggle(int index, bool checked);
|
|
};
|
|
|
|
#endif // TOUCH_BUTT_H
|