本文整理汇总了Python中PyQt5.Qt.QMessageBox.question方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.question方法的具体用法?Python QMessageBox.question怎么用?Python QMessageBox.question使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.question方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _remove_clicked
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 别名]
def _remove_clicked(self):
nickname = self.ui.nicknameEdit.text()
msg = 'Are you sure you want to remove project ' + nickname + '?'
reply = QMessageBox.question(QMessageBox(), 'Double check', msg)
if reply == QMessageBox.Yes:
rec = Dataset.projects[nickname]
rec.remove()
del Dataset.projects[nickname]
self._load_list(Dataset.projects.keys())
示例2: deleteFrame
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 别名]
def deleteFrame(self, caller):
if not self.buttons.active == None:
response = QMessageBox.question(caller, 'Frame Remove Message', "Are you sure you want to delete this frame?", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
if response == QMessageBox.Yes:
self.buttons.active.setParent(None)
del self.buttons[self.buttons.active]
if self.start_index > 0:
self.start_index = self.start_index-1
self.parent().canvas.hideMessage()
self.rearrangeButtons()
示例3: exportToPDF
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 别名]
def exportToPDF(self):
if self.slotsExportedDisabled_:
return
util = FLUtil()
fileName = QFileDialog.getSaveFileName(
self,
util.translate("app", "Exportar a PDF"),
"",
util.translate("app", "Fichero PDF (*.pdf)")
)
if fileName[0] == '':
return
if fileName[0].upper().find(".PDF") == -1:
fileName = fileName[0] + ".pdf"
if QtCore.QFile.exists(fileName):
q = QMessageBox.question(
self,
util.translate("app", "Sobreescribir {}").format(fileName),
util.translate(
"app",
"Ya existe un fichero llamado {}. ¿Desea sobreescribirlo?"
).format(fileName),
util.translate("app", "&Sí"),
util.translate("app", "&No"),
"",
0,
1
)
if q:
return
self.slotPrintReportToPdf(fileName)
示例4: _remove_clicked
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 别名]
def _remove_clicked(self):
# nickname = self.ui.nicknameEdit.text()
msg = 'Are you sure you want to remove assignment ?'
reply = QMessageBox.question(QMessageBox(), 'Double check', msg)
示例5: javaScriptConfirm
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import question [as 别名]
def javaScriptConfirm(self, frame, msg):
return QMessageBox.question(self.view().parentWidget(), None, msg) == QMessageBox.Yes