TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
TTKModule
TTKWidget
musicCoreKits
musicratinglabel.cpp
Go to the documentation of this file.
1
#include "
musicratinglabel.h
"
2
3
#include <QPainter>
4
5
MusicRatingLabel::MusicRatingLabel
(QWidget *parent)
6
:
MusicRatingLabel
(0, parent)
7
{
8
9
}
10
11
MusicRatingLabel::MusicRatingLabel
(
int
value, QWidget *parent)
12
: QLabel(parent),
13
m_value(value)
14
{
15
setFixedSize(26 * 5, 22);
16
}
17
18
void
MusicRatingLabel::setValue
(
int
value)
19
{
20
m_value
= value;
21
}
22
23
void
MusicRatingLabel::paintEvent
(QPaintEvent *)
24
{
25
QPainter painter(
this
);
26
27
for
(
int
i = 0; i < 5; ++i)
28
{
29
const
bool
active =
m_value
- i - 1 >= 0;
30
painter.drawPixmap(i * 26, 0, QPixmap(active ?
":/tiny/lb_star"
:
":/tiny/lb_unstar"
));
31
}
32
}
MusicRatingLabel::m_value
int m_value
Definition:
musicratinglabel.h:51
musicratinglabel.h
MusicRatingLabel::MusicRatingLabel
MusicRatingLabel(QWidget *parent=nullptr)
Definition:
musicratinglabel.cpp:5
MusicRatingLabel::paintEvent
virtual void paintEvent(QPaintEvent *event) overridefinal
Definition:
musicratinglabel.cpp:23
MusicRatingLabel::setValue
void setValue(int value)
Definition:
musicratinglabel.cpp:18
MusicRatingLabel
The class of the rating label.
Definition:
musicratinglabel.h:29
Generated on Tue Jan 21 2025 21:07:13 for TTKMusicPlayer by
1.8.8