window.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:MusicNet 作者: vidursatija 项目源码 文件源码
def drawUI(self):

        self.alpha_rect = QLabel(self)
        self.alpha_rect.setPixmap(QPixmap("black_alpha.png").scaled(320, 480, Qt.KeepAspectRatio, Qt.SmoothTransformation))

        self.current_song = SongWidget(self)
        self.current_song.drawUI()
        self.current_song.move(40, 40)

        self.line1 = QLabel(self)
        self.line1.setPixmap(QPixmap('line.png').scaled(300, 1))
        self.line1.move(10, 120)

        self.time_line = QSlider(Qt.Horizontal, self)
        self.time_line.setGeometry(40, 135, 240, 4)
        self.time_line.setMaximum(157)
        self.time_line.setMinimum(0)
        self.time_line.setValue(0)
        self.time_line.setStyleSheet("""QSlider::groove:horizontal 
            {background-color: rgba(128, 128, 128, 0.5); border: 1px solid rgba(128, 128, 128, 0.5); border-radius: 2px; height:4px;} 
            QSlider::handle:horizontal 
            {border: 1px solid #fff;width: 4px;height: 4px;border-radius: 2px; background-color: #fff;}
            QSlider::sub-page:horizontal
            {background-color: #fff;}
            """)
        self.time_line.sliderReleased.connect(self.changeTime)

        self.rewind = RewindBtn(self)
        self.rewind.move(50, 175)

        self.play = StateBtn(self)
        self.play.move(135, 165)

        self.fastforward = ForwardBtn(self)
        self.fastforward.move(220, 175)

        self.line2 = QLabel(self)
        self.line2.setPixmap(QPixmap('line.png').scaled(300, 1))
        self.line2.move(10, 240)

        self.r_song.append(SongWidget(self))
        self.r_song[0].drawUI()
        self.r_song[0].move(40, 270)

        self.r_song.append(SongWidget(self))
        self.r_song[1].drawUI()
        self.r_song[1].move(40, 330)

        self.r_song.append(SongWidget(self))
        self.r_song[2].drawUI()#, song_loc="/Users/vidursatija/Music/iTunes/iTunes Media/Music/Halsey/hopeless fountain kingdom (Deluxe)/01 The Prologue.mp3")
        self.r_song[2].move(40, 390)

        self.timer = QTimer(self)
        self.timer.timeout.connect(self.updateLabels)
        self.timer.start(1000)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号