-
Notifications
You must be signed in to change notification settings - Fork 65
/
emotion.cpp
68 lines (66 loc) · 2.13 KB
/
emotion.cpp
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
#include "emotion.h"
#include "ui_emotion.h"
#include<QLabel>
#include<QDebug>
Emotion::Emotion(QWidget *parent) :
QWidget(parent),
ui(new Ui::Emotion)
{
ui->setupUi(this);
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint|Qt::FramelessWindowHint);
ui->label->installEventFilter(this);
ui->label_2->installEventFilter(this);
ui->label_3->installEventFilter(this);
//ui->label_15->installEventFilter(this);
ui->label_4->installEventFilter(this);
ui->label_5->installEventFilter(this);
ui->label_6->installEventFilter(this);
ui->label_7->installEventFilter(this);
//ui->label_8->installEventFilter(this);
//ui->label_9->installEventFilter(this);
//ui->label_10->installEventFilter(this);
//ui->label_11->installEventFilter(this);
//ui->label_12->installEventFilter(this);
//ui->label_13->installEventFilter(this);
}
Emotion::~Emotion()
{
delete ui;
}
bool Emotion::eventFilter(QObject *object, QEvent *e)
{
if(e->type()==QEvent::MouseButtonPress&&object==ui->label)
{
emit imgurl(QString(":/emotion/emotion/emotion01.png"));
hide();
}
else if(e->type()==QEvent::MouseButtonPress&&object==ui->label_2){
emit imgurl(QString(":/emotion/emotion/emotion02.png"));
hide();
}
else if(e->type()==QEvent::MouseButtonPress&&object==ui->label_3){
emit imgurl(QString(":/emotion/emotion/emotion03.png"));
hide();
}
else if(e->type()==QEvent::MouseButtonPress&&object==ui->label_4){
emit imgurl(QString(":/emotion/emotion/emotion04.png"));
hide();
}
else if(e->type()==QEvent::MouseButtonPress&&object==ui->label_5){
emit imgurl(QString(":/emotion/emotion/emotion05.png"));
hide();
}
else if(e->type()==QEvent::MouseButtonPress&&object==ui->label_6){
emit imgurl(QString(":/emotion/emotion/emotion06.png"));
hide();
}
else if(e->type()==QEvent::MouseButtonPress&&object==ui->label_7){
emit imgurl(QString(":/emotion/emotion/emotion07.png"));
hide();
}
return false;
}
void Emotion::on_pushButton_clicked()
{
qDebug()<<"点击了";
}