(self)
设置所有的按钮组件，包括前/后一首，暂停/播放等。
设置所有的按钮组件，包括前/后一首，暂停/播放等。
设置所有的按钮组件，包括前 / 后一首，暂停 / 播放等。
def setButtons(self):
        """设置所有的按钮组件，包括前/后一首，暂停/播放等。"""
        self.previousButton = QPushButton(self)
        self.previousButton.setObjectName("previousButton")
        self.previousButton.clicked.connect(self.previousSing)

        self.playButton = QPushButton(self)
        self.playButton.setObjectName("playButton")
        self.playButton.clicked.connect(lambda: self.playEvent(self.player))

        self.pauseButton = QPushButton(self)
        self.pauseButton.setObjectName("pauseButton")
        self.pauseButton.clicked.connect(lambda: self.pauseEvent(self.player))

        # 默认hide.
        self.pauseButton.hide()

        self.nextButton = QPushButton(self)
        self.nextButton.setObjectName("nextButton")
        self.nextButton.clicked.connect(self.nextSing)

        self.volume = QPushButton(self)
        self.volume.setObjectName("volume")
        self.volume.clicked.connect(self.volumeEvent)

        self.noVolume = QPushButton(self)
        self.noVolume.setObjectName("no_volume")
        self.noVolume.hide()
        self.noVolume.clicked.connect(self.noVolumeEvent)

        self.single = QPushButton(self)
        self.single.setObjectName("single")
        self.single.hide()
        self.single.setToolTip("单曲循环")
        self.single.clicked.connect(self.singleEvent)

        self.repeat = QPushButton(self)
        self.repeat.setObjectName("repeat")
        self.repeat.setToolTip("列表循环")
        self.repeat.clicked.connect(self.repeatEvent)

        self.shuffle = QPushButton(self)
        self.shuffle.setObjectName("shuffle")
        self.shuffle.hide()
        self.shuffle.setToolTip("随机播放")
        self.shuffle.clicked.connect(self.shuffleEvent)

        self.lyricButton = QPushButton(self)
        self.lyricButton.setText("词")
        self.lyricButton.setToolTip("打开歌词")
        self.lyricButton.setObjectName("lyricButton")
        self.lyricButton.clicked.connect(self.lyricEvent)

        self.playlist = QPushButton(self)
        self.playlist.setObjectName("playlist")
        self.playlist.clicked.connect(self.playlistEvent)
def setButtons ( self ) : self . previousButton = QPushButton ( self ) self . previousButton . setObjectName ( "previousButton" ) self . previousButton . clicked . connect ( self . previousSing ) self . playButton = QPushButton ( self ) self . playButton . setObjectName ( "playButton" ) self . playButton . clicked . connect ( lambda : self . playEvent ( self . player ) ) self . pauseButton = QPushButton ( self ) self . pauseButton . setObjectName ( "pauseButton" ) self . pauseButton . clicked . connect ( lambda : self . pauseEvent ( self . player ) ) # 默认hide. self . pauseButton . hide ( ) self . nextButton = QPushButton ( self ) self . nextButton . setObjectName ( "nextButton" ) self . nextButton . clicked . connect ( self . nextSing ) self . volume = QPushButton ( self ) self . volume . setObjectName ( "volume" ) self . volume . clicked . connect ( self . volumeEvent ) self . noVolume = QPushButton ( self ) self . noVolume . setObjectName ( "no_volume" ) self . noVolume . hide ( ) self . noVolume . clicked . connect ( self . noVolumeEvent ) self . single = QPushButton ( self ) self . single . setObjectName ( "single" ) self . single . hide ( ) self . single . setToolTip ( "单曲循环") self . single . clicked . connect ( self . singleEvent ) self . repeat = QPushButton ( self ) self . repeat . setObjectName ( "repeat" ) self . repeat . setToolTip ( "列表循环") self . repeat . clicked . connect ( self . repeatEvent ) self . shuffle = QPushButton ( self ) self . shuffle . setObjectName ( "shuffle" ) self . shuffle . hide ( ) self . shuffle . setToolTip ( "随机播放") self . shuffle . clicked . connect ( self . shuffleEvent ) self . lyricButton = QPushButton ( self ) self . lyricButton . setText ( "词") self . lyricButton . setToolTip ( "打开歌词") self . lyricButton . setObjectName ( "lyricButton" ) self . lyricButton . clicked . connect ( self . lyricEvent ) self . playlist = QPushButton ( self ) self . playlist . setObjectName ( "playlist" ) self . playlist . clicked . connect ( self . playlistEvent )