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)
评论列表
文章目录