本文整理匯總了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