Ejemplo n.º 1
0
def start():
    app = QApplication(sys.argv)

    # 将Qt事件循环写到asyncio事件循环里。
    # QEventLoop不是Qt原生事件循环,
    # 是被asyncio重写的事件循环。
    eventLoop = QEventLoop(app)
    asyncio.set_event_loop(eventLoop)

    try:
        main = Window()

        main.show()
        # 当前音乐的显示信息。
        # 因为需要布局之后重新绘制的宽高。
        # 这个宽高会在show之后才会改变。
        # 需要获取宽,高并嵌入到父窗口里。
        main.playWidgets.currentMusic.resize(main.navigation.width(), 64)

        with eventLoop:
            eventLoop.run_forever()

        sys.exit(0)
    except:
        logger.error("got some error", exc_info=True)
Ejemplo n.º 2
0
    def configFeatures(self):
        self.config = ConfigWindow(self)
        self.header.config = ConfigHeader(self.header)
        self.downloadFrame.config = ConfigDownloadFrame(self.downloadFrame)
        self.searchArea.config = ConfigSearchArea(self.searchArea)
        self.navigation.config = ConfigNavigation(self.navigation)
        self.nativeMusic.config = ConfigNative(self.nativeMusic)
        self.mainContent.config = ConfigMainContent(self.mainContent)
        self.detailSings.config = ConfigDetailSings(self.detailSings)
        self.indexNetEaseSings.config = ConfigNetEase(self.indexNetEaseSings)
        self.indexXiamiSings.config = ConfigXiami(self.indexXiamiSings)
        self.indexQQSings.config = ConfigQQ(self.indexQQSings)
        self.systemTray.config = ConfigSystemTray(self.systemTray)
        self.recommendFrame.config = ConfigRecommendFrame(self.recommendFrame)

        self.indexNetEaseSings.config.initThread()
        self.indexXiamiSings.config.initThread()
        self.indexQQSings.config.initThread()

        # 当前耦合度过高。
        self.downloadFrame.config.getDownloadSignal()

        self.config.pullRecommendSong()

        # move to center.
        screen = QApplication.desktop().availableGeometry()
        self.playWidgets.desktopLyric.resize(screen.width(), 50)
        self.playWidgets.desktopLyric.move(0, screen.height() - 100)
Ejemplo n.º 3
0
    def configFeatures(self):
        self.config = ConfigWindow(self)
        self.header.config = ConfigHeader(self.header)
        self.downloadFrame.config = ConfigDownloadFrame(self.downloadFrame)
        self.searchArea.config = ConfigSearchArea(self.searchArea)
        self.navigation.config = ConfigNavigation(self.navigation)
        self.nativeMusic.config = ConfigNative(self.nativeMusic)
        self.mainContent.config = ConfigMainContent(self.mainContent)
        self.detailSings.config = ConfigDetailSings(self.detailSings)
        self.indexNetEaseSings.config = ConfigNetEase(self.indexNetEaseSings)
        self.indexXiamiSings.config = ConfigXiami(self.indexXiamiSings)
        self.indexQQSings.config = ConfigQQ(self.indexQQSings)
        self.systemTray.config = ConfigSystemTray(self.systemTray)
        self.recommendFrame.config = ConfigRecommendFrame(self.recommendFrame)

        self.indexNetEaseSings.config.initThread()
        self.indexXiamiSings.config.initThread()
        self.indexQQSings.config.initThread()

        # 当前耦合度过高。
        self.downloadFrame.config.getDownloadSignal()
        
        self.config.pullRecommendSong()

        # move to center.
        screen = QApplication.desktop().availableGeometry()
        self.playWidgets.desktopLyric.resize(screen.width(), 50)
        self.playWidgets.desktopLyric.move(0, screen.height() - 100)
Ejemplo n.º 4
0
    def configFeatures(self):
        self.config = ConfigWindow(self)
        self.header.config = ConfigHeader(self.header)
        self.searchArea.config = ConfigSearchArea(self.searchArea)
        self.navigation.config = ConfigNavigation(self.navigation)
        self.nativeMusic.config = ConfigNative(self.nativeMusic)
        self.mainContent.config = ConfigMainContent(self.mainContent)
        self.detailSings.config = ConfigDetailSings(self.detailSings)
        self.indexNetEaseSings.config = ConfigNetEase(self.indexNetEaseSings)
        self.indexXiamiSings.config = ConfigXiami(self.indexXiamiSings)
        self.indexQQSings.config = ConfigQQ(self.indexQQSings)
        self.systemTray.config = ConfigSystemTray(self.systemTray)

        self.indexNetEaseSings.config.initThread()
        self.indexXiamiSings.config.initThread()
        self.indexQQSings.config.initThread()

        # test desktop lyric。
        screen = QApplication.desktop().availableGeometry()
        self.playWidgets.desktopLyric.resize(screen.width(), 50)
        self.playWidgets.desktopLyric.move(0, screen.height() - 100)
        self.playWidgets.desktopLyric.show()
Ejemplo n.º 5
0
def start():
    app = QApplication(sys.argv)

    # 将Qt事件循环写到asyncio事件循环里。
    # QEventLoop不是Qt原生事件循环,
    # 是被asyncio重写的事件循环。
    eventLoop = QEventLoop(app)
    asyncio.set_event_loop(eventLoop)
    main = Window()

    main.show()
    # 当前音乐的显示信息。
    # 因为需要布局之后重新绘制的宽高。
    # 这个宽高会在show之后才会改变。
    # 需要获取宽,高并嵌入到父窗口里。
    main.playWidgets.currentMusic.resize(main.navigation.width(), 64)
    main.playWidgets.currentMusic.move(
        0,
        main.height() - 64 - main.playWidgets.height())

    with eventLoop:
        eventLoop.run_forever()

    sys.exit(0)
Ejemplo n.º 6
0
        self.xiamiSearchFrame = XiamiSearchResultFrame(self)
        self.contentsTab.addTab(self.xiamiSearchFrame, "虾米")

        self.qqSearchFrame = QQSearchResultFrame(self)
        self.contentsTab.addTab(self.qqSearchFrame, 'QQ')

    # 功能。
    def setText(self, text):
        self.text = text
        self.titleLabel.setText(
            "搜索<font color='#23518F'>“{0}”</font><br>".format(self.text))


if __name__ == '__main__':
    app = QApplication(sys.argv)

    # 将Qt事件循环写到asyncio事件循环里。
    # QEventLoop不是Qt原生事件循环,
    # 是被asyncio重写的事件循环。
    eventLoop = QEventLoop(app)
    asyncio.set_event_loop(eventLoop)
    main = Window()

    main.show()
    # 当前音乐的显示信息。
    # 因为需要布局之后重新绘制的宽高。
    # 这个宽高会在show之后才会改变。
    # 需要获取宽,高并嵌入到父窗口里。
    main.playWidgets.currentMusic.resize(main.navigation.width(), 64)
    main.playWidgets.currentMusic.move(