-
Notifications
You must be signed in to change notification settings - Fork 0
/
artistview.h
74 lines (63 loc) · 1.91 KB
/
artistview.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
#ifndef ARTISTVIEW_H
#define ARTISTVIEW_H
#include <QWidget>
#include <QVBoxLayout>
#include <QScrollArea>
#include "artistviewtitle.h"
class ArtistView : public QWidget
{
Q_OBJECT
public:
ArtistView()
{
hide();
layout->setAlignment(Qt::AlignTop);
layout->setContentsMargins(15,0,15,0);
layout->setSpacing(0);
layout->addWidget(artistViewTitle);
layout->addWidget(scroll,10);
scroll->setStyleSheet("QScrollArea{border:none;background:transparent}");
scroll->setWidget(albumsFrame);
scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scroll->setWidgetResizable( true );
albumsFrame->setLayout(albumsLayout);
albumsFrame->setObjectName("fram");
albumsFrame->setStyleSheet("#fram{background:transparent}");
albumsLayout->setMargin(15);
albumsLayout->setSpacing(40);
}
int songCount;
int albumCount;
QString artistName;
QWidget *albumsFrame = new QWidget();
QVBoxLayout *albumsLayout = new QVBoxLayout(albumsFrame);
QVBoxLayout *layout = new QVBoxLayout(this);
ArtistViewTitle *artistViewTitle = new ArtistViewTitle();
QScrollArea *scroll = new QScrollArea();
void setData(QString name, int albums, int songs){
albumCount = albums;
songCount = songs;
artistName = name;
artistViewTitle->artistName->changeText(name);
QString P1,P2;
if(albumCount == 1)
{
P1 = "1 album, ";
}
else
{
P1 = QString::number(albumCount) + " albums, ";
}
if(songCount == 1)
{
P2 = "1 song";
}
else
{
P2 = QString::number(songCount) + " songs";
}
artistViewTitle->artistInfo->changeText(P1 + P2);
}
};
#endif // ARTISTVIEW_H