-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistitem.cpp
More file actions
82 lines (72 loc) · 1.56 KB
/
Copy pathlistitem.cpp
File metadata and controls
82 lines (72 loc) · 1.56 KB
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
#include "listitem.h"
#include "ui_listitem.h"
ListItem::ListItem(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ListItem)
,_like(false)
{
ui->setupUi(this);
//两次绑定click信号
}
ListItem::~ListItem()
{
delete ui;
}
void ListItem::enterEvent(QEvent *event)
{
(void)event;
setStyleSheet("background-color:#EFEFEF");
}
void ListItem::leaveEvent(QEvent *event)
{
(void)event;
setStyleSheet("");
}
void ListItem::SetMusicName(const QString &name)
{
ui->MusicName->setText(name);
}
void ListItem::SetSinger(const QString &singer)
{
ui->SingerName->setText(singer);
}
void ListItem::SetAlbum(const QString &album)
{
ui->AblumName->setText(album);
}
void ListItem::SetLikeIcon(bool flag)
{
_like=flag;
if(_like)
{
ui->Likebtn->setIcon(QIcon(":/images/like_2.png"));
}else
{
ui->Likebtn->setIcon(QIcon(":/images/like_3.png"));
}
}
void ListItem::SetHeightLight(bool islight)
{
if(islight==true)
{
setStyleSheet("background-color:#D0E4FF; color:#000000;");
QFont font=ui->MusicName->font();
font.setBold(true);
ui->MusicName->setFont(font);
ui->SingerName->setFont(font);
ui->AblumName->setFont(font);
}else {
setStyleSheet("");
QFont font=ui->MusicName->font();
font.setBold(false);
ui->MusicName->setFont(font);
ui->SingerName->setFont(font);
ui->AblumName->setFont(font);
}
}
void ListItem::on_Likebtn_clicked()
{
_like=!_like;
SetLikeIcon(_like);
emit setlike(_like);
}