本文整理汇总了Python中AnyQt.QtWidgets.QMessageBox.setInformativeText方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.setInformativeText方法的具体用法?Python QMessageBox.setInformativeText怎么用?Python QMessageBox.setInformativeText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtWidgets.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.setInformativeText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: message
# 需要导入模块: from AnyQt.QtWidgets import QMessageBox [as 别名]
# 或者: from AnyQt.QtWidgets.QMessageBox import setInformativeText [as 别名]
def message(icon, text, title=None, informative_text=None, details=None,
buttons=None, default_button=None, exc_info=False, parent=None):
"""Show a message helper function.
"""
if title is None:
title = "Message"
if not text:
text = "I am neither a postman nor a doctor."
if buttons is None:
buttons = QMessageBox.Ok
if details is None and exc_info:
details = traceback.format_exc(limit=20)
mbox = QMessageBox(icon, title, text, buttons, parent)
if informative_text:
mbox.setInformativeText(informative_text)
if details:
mbox.setDetailedText(details)
if default_button is not None:
mbox.setDefaultButton(default_button)
return mbox.exec_()
示例2: message_restart
# 需要导入模块: from AnyQt.QtWidgets import QMessageBox [as 别名]
# 或者: from AnyQt.QtWidgets.QMessageBox import setInformativeText [as 别名]
def message_restart(parent):
icon = QMessageBox.Information
buttons = QMessageBox.Ok | QMessageBox.Cancel
title = 'Information'
text = 'Orange needs to be restarted for the changes to take effect.'
msg_box = QMessageBox(icon, title, text, buttons, parent)
msg_box.setDefaultButton(QMessageBox.Ok)
msg_box.setInformativeText('Press OK to close Orange now.')
msg_box.button(QMessageBox.Cancel).setText('Close later')
return msg_box.exec_()