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