Example #1
0
 def setLines(self):
     """设置装饰用小细线。"""
     self.line1 = QFrame(self)
     self.line1.setObjectName("line1")
     self.line1.setFrameShape(QFrame.VLine)
     self.line1.setFrameShadow(QFrame.Plain)
     self.line1.setMaximumSize(1, 25)
Example #2
0
    def __init__(self, parent=None):
        """包括发现音乐,MV,我的音乐, 歌单等导航信息。"""
        super(Navigation, self).__init__(parent)
        self.parent = parent
        self.frame = QFrame()
        # self.setMaximumHeight(576)
        self.setMaximumWidth(200)

        self.setWidget(self.frame)
        self.setWidgetResizable(True)
        # self.frame.setMaximumWidth(200)
        self.frame.setMinimumWidth(200)

        # 定义3个事件函数,方便扩展。
        self.navigationListFunction = self.none
        self.nativeListFunction = self.none
        self.singsFunction = self.none

        with open('QSS/navigation.qss', 'r') as f:
            style = f.read()
            self.setStyleSheet(style)
            self.frame.setStyleSheet(style)

        # 包括显示信息: 推荐 我的音乐 歌单。
        self.setLabels()
        # 包括详细的内容:发现音乐,FM,MV等。
        self.setListViews()

        self.setLayouts()
Example #3
0
 def setLines(self):
     """设置布局小细线。"""
     self.line1 = QFrame(self)
     self.line1.setObjectName("line1")
     self.line1.setFrameShape(QFrame.HLine)
     self.line1.setFrameShadow(QFrame.Plain)
     self.line1.setLineWidth(2)
Example #4
0
    def setSingsFrame(self):
        # 单曲界面。
        self.singsFrame = QFrame()
        self.singsFrameLayout = VBoxLayout(self.singsFrame)

        self.noSingsContentsLabel = QLabel(self.singsFrame)
        self.noSingsContentsLabel.setMaximumHeight(60)

        self.noSingsContentsLabel.setObjectName("noSingsLable")
        self.noSingsContentsLabel.hide()

        self.singsResultTable = TableWidget(3, ['音乐标题', '歌手', '时长'])
        self.singsResultTable.setObjectName('singsTable')
        self.singsResultTable.setMinimumWidth(self.width())
        self.singsResultTable.setColumnWidths({
            i: j
            for i, j in zip(range(3), [
                self.width() / 3 * 1.25,
                self.width() / 3 * 1.25,
                self.width() / 3 * 0.5
            ])
        })

        self.singsFrameLayout.addWidget(self.singsResultTable,
                                        Qt.AlignTop | Qt.AlignCenter)

        self.centerLabelLayout = HBoxLayout()
        self.centerLabelLayout.addStretch(1)
        self.centerLabelLayout.addWidget(self.noSingsContentsLabel)
        self.centerLabelLayout.addStretch(1)

        self.singsFrameLayout.addLayout(self.centerLabelLayout)

        self.contentsTab.addTab(self.singsFrame, "单曲")
Example #5
0
    def setHeader(self):
        # self.titleLabel = QLabel("我的下载")

        self.spaceLine = QFrame(self)
        self.spaceLine.setObjectName("spaceLine")
        self.spaceLine.setFrameShape(QFrame.HLine)
        self.spaceLine.setFrameShadow(QFrame.Plain)
        self.spaceLine.setLineWidth(2)

        self.currentStorageFolderLabel = QLabel("当前存储目录: ")

        self.currentStorageFolder = QLabel()

        self.selectButton = QPushButton("选择目录")
        self.selectButton.setObjectName('selectButton')

        self.topShowLayout = QHBoxLayout()
        self.topShowLayout.addSpacing(20)
        # self.topShowLayout.addWidget(self.titleLabel)
        self.topShowLayout.addWidget(self.currentStorageFolderLabel)
        self.topShowLayout.addWidget(self.currentStorageFolder)
        self.topShowLayout.addWidget(self.selectButton)
        self.topShowLayout.addStretch(1)

        self.mainLayout.addLayout(self.topShowLayout)
        self.mainLayout.addWidget(self.spaceLine)
    def setHeader(self):
        self.spaceLine = QFrame(self)
        self.spaceLine.setObjectName("spaceLine")
        self.spaceLine.setFrameShape(QFrame.HLine)
        self.spaceLine.setFrameShadow(QFrame.Plain)
        self.spaceLine.setLineWidth(2)

        self.recommendLabel = QLabel("你的专属推荐~❤")

        self.topShowLayout = QHBoxLayout()
        self.topShowLayout.addSpacing(20)
        # self.topShowLayout.addWidget(self.titleLabel)
        self.topShowLayout.addWidget(self.recommendLabel)
        self.topShowLayout.addStretch(1)

        self.mainLayout.addLayout(self.topShowLayout)
        self.mainLayout.addWidget(self.spaceLine)
Example #7
0
    def setTopShow(self):
        self.showLabel = QLabel("本地音乐")

        self.spaceLine = QFrame(self)
        self.spaceLine.setObjectName("spaceLine")
        self.spaceLine.setFrameShape(QFrame.HLine)
        self.spaceLine.setFrameShadow(QFrame.Plain)
        self.spaceLine.setLineWidth(2)

        self.selectButton = QPushButton("选择目录")
        self.selectButton.setObjectName('selectButton')

        self.topShowLayout = QHBoxLayout()
        self.topShowLayout.addSpacing(20)
        self.topShowLayout.addWidget(self.showLabel)
        self.topShowLayout.addWidget(self.selectButton)
        self.topShowLayout.addStretch(1)

        self.mainLayout.addLayout(self.topShowLayout)
        self.mainLayout.addWidget(self.spaceLine)