本文整理汇总了Python中PyQt5.Qt.QMessageBox.exec_方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.exec_方法的具体用法?Python QMessageBox.exec_怎么用?Python QMessageBox.exec_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.exec_方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: msgbox
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import exec_ [as 别名]
def msgbox(cls, typename, text, button0, button1=None, button2=None, title=None, form=None):
if form:
logger.warn("MessageBox: Se intentó usar form, y no está implementado.")
icon = QMessageBox.NoIcon
if not title:
title = "Pineboo"
if typename == "question":
icon = QMessageBox.Question
if not title:
title = "Question"
elif typename == "information":
icon = QMessageBox.Information
if not title:
title = "Information"
elif typename == "warning":
icon = QMessageBox.Warning
if not title:
title = "Warning"
elif typename == "critical":
icon = QMessageBox.Critical
if not title:
title = "Critical"
# title = unicode(title,"UTF-8")
# text = unicode(text,"UTF-8")
msg = QMessageBox(icon, title, text)
msg.addButton(button0)
if button1:
msg.addButton(button1)
if button2:
msg.addButton(button2)
return msg.exec_()
示例2: _save_dialog
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import exec_ [as 别名]
def _save_dialog(self, parent, title, msg, det_msg=''):
d = QMessageBox(parent)
d.setWindowTitle(title)
d.setText(msg)
d.setStandardButtons(QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
return d.exec_()
示例3: step_dialog
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import exec_ [as 别名]
def step_dialog(parent, title, msg, det_msg=''):
d = QMessageBox(parent)
d.setWindowTitle(title)
d.setText(msg)
d.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
return d.exec_() & QMessageBox.Cancel