コード例 #1
0
 def set_artist_info(self, artist):
     if artist == 'Zheng-Yejian':
         self.ui_initial()
     elif artist != self.artistName.text():
         infoPath = SearchOnline.get_artist_info_path(artist)
         infoDict = parse_artist_info(infoPath)
         self.artistName.setText(artist)
         self.artistBirthday.setText('生日:%s'%infoDict['birthday'])
         self.artistBirthplace.setText('出生地:%s'%infoDict['birthplace'])
         self.artistLanguage.setText('语言:%s'%infoDict['language'])
         self.artistGender.setText('性别:%s'%infoDict['gender'])
         self.artistConstellation.setText('星座:%s'%infoDict['constellation'])
         self.artistDetail.clear()
         self.artistDetail.setAlignment(Qt.AlignHCenter)
         self.artistDetail.setHtml(self.get_artist_detail_style_text(infoDict['info']))
         imagePath = SearchOnline.get_artist_image_path(artist)
         if imagePath:
             pixmap = QPixmap(imagePath)
         else:
             pixmap = QPixmap(IconsHub.Anonymous)
         self.artistHeadLabel.setPixmap(pixmap)
コード例 #2
0
 def set_artist_info(self, artist):
     if artist == 'Zheng-Yejian':
         self.ui_initial()
     elif artist != self.artistName.text():
         infoPath = SearchOnline.get_artist_info_path(artist)
         infoDict = parse_artist_info(infoPath)
         self.artistName.setText(artist)
         self.artistBirthday.setText('生日:%s' % infoDict['birthday'])
         self.artistBirthplace.setText('出生地:%s' % infoDict['birthplace'])
         self.artistLanguage.setText('语言:%s' % infoDict['language'])
         self.artistGender.setText('性别:%s' % infoDict['gender'])
         self.artistConstellation.setText('星座:%s' %
                                          infoDict['constellation'])
         self.artistDetail.clear()
         self.artistDetail.setAlignment(Qt.AlignHCenter)
         self.artistDetail.setHtml(
             self.get_artist_detail_style_text(infoDict['info']))
         imagePath = SearchOnline.get_artist_image_path(artist)
         if imagePath:
             pixmap = QPixmap(imagePath)
         else:
             pixmap = QPixmap(IconsHub.Anonymous)
         self.artistHeadLabel.setPixmap(pixmap)