MCPcopy Create free account
hub / github.com/PyQt5/PyQt / CoverLabel

Class CoverLabel

QGridLayout/Lib/CoverLabel.py:23–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class CoverLabel(QLabel, Ui_CoverLabel):
24
25 def __init__(self, *args, **kwargs):
26 super(CoverLabel, self).__init__(*args, **kwargs)
27 self.setupUi(self)
28
29 def init(self, cover_path, play_url, play_count):
30 self.cover_path = cover_path
31 self.play_url = play_url
32 self.setPixmap(QPixmap(cover_path))
33 self.labelHeadset.setPixmap(QPixmap('Data/Svg_icon_headset_sm.svg'))
34 self.labelPlay.setPixmap(QPixmap('Data/Svg_icon_play_sm.svg'))
35 self.labelCount.setStyleSheet('color: #999999;')
36 self.labelCount.setText(play_count)
37
38 def setCoverPath(self, path):
39 self.cover_path = path
40
41 def mouseReleaseEvent(self, event):
42 super(CoverLabel, self).mouseReleaseEvent(event)
43 webbrowser.open_new_tab(self.play_url)

Callers 1

setupUiMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected