本文整理汇总了Python中PyQt5.Qt.QMessageBox.setInformativeText方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.setInformativeText方法的具体用法?Python QMessageBox.setInformativeText怎么用?Python QMessageBox.setInformativeText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.setInformativeText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QuestionDialog
# 需要导入模块: from PyQt5.Qt import QMessageBox [as 别名]
# 或者: from PyQt5.Qt.QMessageBox import setInformativeText [as 别名]
def QuestionDialog(title, text, info = None, dontAsk = False):
msgBox = QMessageBox()
buttonYes = msgBox.addButton(_("Yes"), QMessageBox.ActionRole)
buttonNo = msgBox.addButton(_("No"), QMessageBox.ActionRole)
answers = {buttonYes:"yes",
buttonNo :"no"}
if dontAsk:
buttonDontAsk = msgBox.addButton(_("Don't ask again"), QMessageBox.ActionRole)
answers[buttonDontAsk] = "dontask"
msgBox.setText(text)
if not info:
info = _("Do you want to continue?")
msgBox.setInformativeText(info)
dialog = Dialog(_(title), msgBox, closeButton = False, isDialog = True, icon="question")
dialog.resize(300,120)
dialog.exec_()
ctx.mainScreen.processEvents()
if msgBox.clickedButton() in answers.keys():
return answers[msgBox.clickedButton()]
return "no"