当前位置: 首页>>代码示例>>Python>>正文


Python QWidget.depth方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QWidget.depth方法的典型用法代码示例。如果您正苦于以下问题:Python QWidget.depth方法的具体用法?Python QWidget.depth怎么用?Python QWidget.depth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets.QWidget的用法示例。


在下文中一共展示了QWidget.depth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: postConfigure

# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import depth [as 别名]
    def postConfigure(cls):
        if not cls.noAdapt:
            w = QWidget()

            if w.depth() < 16:
                cls.useEightBitPalette = True
                cls.adapted = True
                cls.debug("- Adapt: Color depth less than 16 bit. Using 8 bit palette")
开发者ID:death-finger,项目名称:Scripts,代码行数:10,代码来源:colors.py

示例2: keyPressEvent

# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import depth [as 别名]
    def keyPressEvent(self, event):
        if event.key() == Qt.Key_Escape:
            QApplication.quit()
        elif event.key() == Qt.Key_Q:
            QApplication.quit()
        elif event.key() == Qt.Key_F:
            self.toggleFullscreen()
        elif event.key() == Qt.Key_F1:
            #playList=QMediaPlaylist()
            #playList.setPlaybackMode(QMediaPlaylist.Loop)
            #playList.addMedia(QMediaContent(QUrl.fromLocalFile("f:/mp3/qh.mp3")))
            #player = QMediaPlayer()
            #player.setPlaylist(playList)
            #player.play()
            #print(player.metaData(QMediaMetaData.Author))
            #
            #m_device = QAudioDeviceInfo.defaultOutputDevice()
            #print(m_device)
            #self.xxx = QMediaPlayer()

            #self.xxx.setMedia(QMediaContent(QUrl.fromLocalFile("yinpin.wav")))
            #self.xxx.setMedia(QMediaContent(QUrl.fromUserInput("http://192.168.20.200/qh.mp3")))
            #self.xxx.play()
            #qq = QUrl()
            #qq.setPath("f:/mp3/")
            #qq = QUrl.fromUserInput("http://192.168.20.200/qh.mp3")

            #print(qq)
            #ss=QMediaContent(QUrl.fromLocalFile("yinpin.wav"))
            #sss=QMediaContent(QUrl.fromLocalFile(""))
            s = "这是一个正在开发的东西,慢慢来吧:\n"
            w = QWidget()
            s += "\n[色位深度]: %d" % w.depth()
            s += "\n[动画支持]: "
            s += "\n[bufferStatus]: "+str(self.homeAction.playObj.bufferStatus())
            s += "\n[position]: "+str(self.homeAction.playObj.position())
            s += "\n[state]: "+str(self.homeAction.playObj.state())
            s += "\n[filePath]: "+self.homeAction.openPath
            #s += "\n[xxxx]: "+str(ss)
            #s += "\n[sss]: "+str(sss)
            #s += "\n[qqq]: "+qq.scheme()
            #s += ["on", "off"][Colors.noAnimations]
            QMessageBox.information(None, "【F1】你想知道什么:", s)
        super(Ui_MainWindow, self).keyPressEvent(event)
开发者ID:peeped,项目名称:musicPlayer,代码行数:46,代码来源:mainWindow.py

示例3: keyPressEvent

# 需要导入模块: from PyQt5.QtWidgets import QWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QWidget import depth [as 别名]
    def keyPressEvent(self, event):
        if event.key() == Qt.Key_Escape:
            QApplication.quit()
        elif event.key() == Qt.Key_F1:
            s = ""
            s += "\nAdapt: "
            s += ["on", "off"][Colors.noAdapt]
            s += "\nAdaption occured: "
            s += ["no", "yes"][Colors.adapted]
            w = QWidget()
            s += "\nColor bit depth: %d" % w.depth()
            s += "\nWanted FPS: %d" % Colors.fps
            s += "\nBenchmarked FPS: ";
            if Colors.benchmarkFps != -1:
                s += "%d" % Colors.benchmarkFps
            else:
                s += "not calculated"
            s += "\nAnimations: ";
            s += ["on", "off"][Colors.noAnimations]
            s += "\nBlending: ";
            s += ["on", "off"][Colors.useEightBitPalette]
            s += "\nTicker: ";
            s += ["on", "off"][Colors.noTicker]
            s += "\nPixmaps: ";
            s += ["off", "on"][Colors.usePixmaps]
            s += "\nRescale images on resize: ";
            s += ["on", "off"][Colors.noRescale]
            s += "\nTimer based updates: ";
            s += ["on", "off"][Colors.noTimerUpdate]
            s += "\nSeparate loop: ";
            s += ["no", "yes"][Colors.useLoop]
            s += "\nScreen sync: ";
            s += ["yes", "no"][Colors.noScreenSync]
            QMessageBox.information(None, "Current configuration", s)

        super(MainWindow, self).keyPressEvent(event)
开发者ID:CarlosAndres12,项目名称:pyqt5,代码行数:38,代码来源:mainwindow.py


注:本文中的PyQt5.QtWidgets.QWidget.depth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。