本文整理汇总了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")
示例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)
示例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)