-
Notifications
You must be signed in to change notification settings - Fork 0
/
mypushbutton.cpp
59 lines (51 loc) · 1.37 KB
/
mypushbutton.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
#include "mypushbutton.h"
MyPushButton::MyPushButton(QWidget* parent)
: QPushButton(parent)
{
}
void MyPushButton::mouseReleaseEvent(QMouseEvent *e)
{
if ( e->button() == Qt::LeftButton )
{
if ( text() == "Pause" )
{
emit clickedToPause();
setText("Play");
}
else if ( text() == "Play" )
{
emit clickedToResume();
setText("Pause");
}
else if ( text() == "Muted" )
{
emit clickedToSetMuted(false);
setText("Unmuted");
}
else if ( text() == "Unmuted" )
{
emit clickedToSetMuted(true);
setText("Muted");
}
else if ( text() == "Shuffled On" )
{
emit clickedToSetShuffled(false);
setText("Shuffled Off");
}
else if ( text() == "Shuffled Off")
{
emit clickedToSetShuffled(true);
setText("Shuffled On");
}
else if ( text() == "Repeat Off" )
{
emit clickedToSetRepeated(true);
setText("Repeat On");
}
else if ( text() == "Repeat On" )
{
emit clickedToSetRepeated(false);
setText("Repeat Off");
}
}
}