-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtileview.h
46 lines (38 loc) · 1.08 KB
/
tileview.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef TILEVIEW_H
#define TILEVIEW_H
#include <QFrame>
#include "tilemodel.h"
class TileView : public QFrame
{
Q_OBJECT
private:
TileModel *tile;
QColor tileColor;
QTimer *animationTimer; // for animation
// QTimer *hintAnimationTimer; // for hint animation
int animationAngele = 90;
int rotateAngle = 0;
bool canBeClicked = true;
// double alphaValueF = 0;
public:
explicit TileView(TileModel *tile, QColor color, QFrame *parent = nullptr);
void rotateWithAnimation(int angle = 90);
void adjustAngle();
void setBackgroundColor(QColor color);
protected:
void paintEvent(QPaintEvent*) override;
signals:
void nodeChange(int times);
void clicked();
// void clickedWhileHint(TileModel *tileModel);
protected:
virtual void mouseReleaseEvent(QMouseEvent *ev) override;
public slots:
// void startHintAnimation();
// void stopHintAnimation();
void isConnected(bool connected);
private slots:
void rotateTimeout(); // for rotate animation
// void hintAnimationTimeout(); // for hint animation
};
#endif // TILEVIEW_H