-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy360button.h
217 lines (183 loc) · 4.92 KB
/
my360button.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#ifndef MY360BUTTON_H
#define MY360BUTTON_H
#include <QObject>
#include <QWidget>
#include<QPaintEvent>
#include<QEvent>
#include<QPushButton>
#include<qpropertyanimation.h>
#include<QDebug>
class mainButton : public QPushButton//用于主的图片
{
Q_OBJECT
public:
mainButton(QString pixnormal,QString pixenter,QString pixleave,QWidget*parent);
~mainButton();
protected:
void enterEvent(QEvent*);
void leaveEvent(QEvent*);
void paintEvent(QPaintEvent*);
QPropertyAnimation*m_enteranimation;
QPropertyAnimation*m_leaveanimation;
QList<QPixmap> m_enterlist;
QList<QPixmap> m_leavelist;
QPixmap m_pixnormal;
int m_enterIndex;
int m_leaveIndex;
bool m_enter;
bool m_leave;
public slots:
void entervaluechange(QVariant var){m_enterIndex=var.toInt();update();}
void leavevaluechange(QVariant var){m_leaveIndex=var.toInt();update();}
};
class main2Button:public QPushButton//用于4太图片加下文字
{
Q_OBJECT
public:
main2Button(QString pixnormal,QString text,QWidget*parent);
protected:
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
private:
QPixmap m_pix;
QPixmap m_pixborder;
QString m_text;
bool m_enter;
};
class main3Button:public QPushButton//用于四态图片
{
Q_OBJECT
public:
main3Button(QString pix_listurl,QWidget*parent);
protected:
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *);
void leaveEvent(QEvent*);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e) override;
private:
QList<QPixmap> m_pixlist;
int m_index;
bool m_enter;
};
///////////////////////////////////////////////////////
class headButton:public QPushButton//头像按钮
{
Q_OBJECT
public:
headButton(QWidget*parent=0);
protected:
void paintEvent(QPaintEvent*);
void enterEvent(QEvent*);
void leaveEvent(QEvent*);
private:
QList<QPixmap> m_pixlist;
int m_index;
};
class wordslineButton:public QPushButton//下划线按钮
{
Q_OBJECT
public:
wordslineButton(QString text,QWidget*parent=0);
protected:
void paintEvent(QPaintEvent*);
void enterEvent(QEvent*);
void leaveEvent(QEvent*);
private:
QString m_text;
bool m_enter;
};
class checkButton:public QPushButton////////////check优化加速界面下的
{
Q_OBJECT
public:
checkButton(QString pixcheckurl,QString pixuncheckurl,QWidget *parent);
protected:
void paintEvent(QPaintEvent*);
void enterEvent(QEvent*);
void leaveEvent(QEvent*);
void mousePressEvent(QMouseEvent*);
private:
bool m_checked;
bool m_enter;
QList<QPixmap> m_checklist;
QPixmap m_pixcheck;
QPixmap m_pixuncheck;
int m_checkindex;
int m_uncheckindex;
};
class main4Button:public QPushButton//8个图与4个图
{
Q_OBJECT
public:
main4Button(QString pixanima,QString pixurl,QWidget*parent=0);
protected:
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
private:
QList<QPixmap> m_animalist;
QList<QPixmap> m_normallist;
QPropertyAnimation *m_animation;
int animaindex;
bool m_enter;
private slots:
void slot_valuechange(QVariant var){animaindex=var.toInt();update();}
// void slot_aniamtion();
};
class cleanMainButton:public QPushButton//清理界面的按钮
{
Q_OBJECT
public:
cleanMainButton(QString normal,QString gray,QString aninormal,QString anigray,int number,QWidget *parent);
protected:
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *);
void mousePressEvent(QMouseEvent *);
void leaveEvent(QEvent *);
private:
QList<QPixmap> m_pixaninormallist;
QList<QPixmap> m_pixanigraylist;
QPixmap m_pixnormal;
QPixmap m_pixgray;
int m_normalindex;
int count;
QPropertyAnimation *m_aninormal;
bool m_enter;
bool m_ischeck;
private slots:
void slot_normalaimachange(QVariant var){m_normalindex=var.toInt();update();}
};
class main5Button:public QPushButton//用于四态图片加中间文字
{
Q_OBJECT
public:
main5Button(QString pix_listurl,QString text,QWidget*parent);
protected:
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *);
void leaveEvent(QEvent*);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
private:
QList<QPixmap> m_pixlist;
int m_index;
QString m_text;
bool m_enter;
};
class main6Button:public QPushButton
{
Q_OBJECT
public:
main6Button(QString pixurl,QString text,QWidget*parent=0);
protected:
void paintEvent(QPaintEvent*);
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
private:
QString m_text;
QPixmap m_pix;
bool m_enter;
};
#endif // MY360BUTTON_H