本文整理汇总了Python中PySide2.QtWidgets.QApplication.restoreOverrideCursor方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.restoreOverrideCursor方法的具体用法?Python QApplication.restoreOverrideCursor怎么用?Python QApplication.restoreOverrideCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets.QApplication
的用法示例。
在下文中一共展示了QApplication.restoreOverrideCursor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: round
# 需要导入模块: from PySide2.QtWidgets import QApplication [as 别名]
# 或者: from PySide2.QtWidgets.QApplication import restoreOverrideCursor [as 别名]
def round(self, tile: TicTacToe.Tile):
QApplication.setOverrideCursor(Qt.WaitCursor)
self.player.tile = tile
score = self.ticTacToe.round(True)
QApplication.restoreOverrideCursor()
if score is not None:
if score == +1:
QMessageBox.information(self, self.tr("Victory!"), self.tr("You won :)"), QMessageBox.Ok)
if score == 0:
QMessageBox.warning(self, self.tr("Tie!"), self.tr("You tied :|"), QMessageBox.Ok)
if score == -1:
QMessageBox.critical(self, self.tr("Defeat!"), self.tr("You lost :("), QMessageBox.Ok)
self.ticTacToe.reset(True)
示例2: saveFile
# 需要导入模块: from PySide2.QtWidgets import QApplication [as 别名]
# 或者: from PySide2.QtWidgets.QApplication import restoreOverrideCursor [as 别名]
def saveFile(self, fileName):
file = QFile(fileName)
if not file.open(QFile.WriteOnly | QFile.Text):
QMessageBox.warning(self, "MDI",
"Cannot write file %s:\n%s." % (fileName, file.errorString()))
return False
outstr = QTextStream(file)
QApplication.setOverrideCursor(Qt.WaitCursor)
outstr << self.toPlainText()
QApplication.restoreOverrideCursor()
self.setCurrentFile(fileName)
return True
示例3: loadFile
# 需要导入模块: from PySide2.QtWidgets import QApplication [as 别名]
# 或者: from PySide2.QtWidgets.QApplication import restoreOverrideCursor [as 别名]
def loadFile(self, fileName):
file = QFile(fileName)
if not file.open(QFile.ReadOnly | QFile.Text):
QMessageBox.warning(self, "MDI",
"Cannot read file %s:\n%s." % (fileName, file.errorString()))
return False
instr = QTextStream(file)
QApplication.setOverrideCursor(Qt.WaitCursor)
self.setPlainText(instr.readAll())
QApplication.restoreOverrideCursor()
self.setCurrentFile(fileName)
self.document().contentsChanged.connect(self.documentWasModified)
return True