6
6
td.postheader { font-family: sans-serif }
7
7
tr.address { font-family: sans-serif }
8
8
body { background: #ffffff; color: black; }
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QMessageBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer. <a href="#details">More...</a></p>
10
<p>Inherits <a href="qdialog.html">QDialog</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a></b> { InvalidRole, AcceptRole, RejectRole, DestructiveRole, ..., ApplyRole }</li><li><div class="fn" />enum <b><a href="qmessagebox.html#Icon-enum">Icon</a></b> { NoIcon, Information, Warning, Critical, Question }</li><li><div class="fn" />enum <b><a href="qmessagebox.html#StandardButton-enum">StandardButton</a></b> { NoButton, Ok, Save, SaveAll, ..., ButtonMask }</li><li><div class="fn" />class <b><a href="qmessagebox-standardbuttons.html">StandardButtons</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmessagebox.html#QMessageBox">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qmessagebox.html#QMessageBox-2">__init__</a></b> (<i>self</i>, Icon, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.NoButton, QWidget <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</li><li><div class="fn" /><b><a href="qmessagebox.html#QMessageBox-3">__init__</a></b> (<i>self</i>, QString, QString, Icon, int, int, int, QWidget <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</li><li><div class="fn" /><b><a href="qmessagebox.html#addButton">addButton</a></b> (<i>self</i>, QAbstractButton, ButtonRole)</li><li><div class="fn" />QPushButton <b><a href="qmessagebox.html#addButton-2">addButton</a></b> (<i>self</i>, QString, ButtonRole)</li><li><div class="fn" />QPushButton <b><a href="qmessagebox.html#addButton-3">addButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" />QAbstractButton <b><a href="qmessagebox.html#button">button</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" />ButtonRole <b><a href="qmessagebox.html#buttonRole">buttonRole</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" />list-of-QAbstractButton <b><a href="qmessagebox.html#buttons">buttons</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#buttonText">buttonText</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qmessagebox.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />QAbstractButton <b><a href="qmessagebox.html#clickedButton">clickedButton</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmessagebox.html#closeEvent">closeEvent</a></b> (<i>self</i>, QCloseEvent)</li><li><div class="fn" />QPushButton <b><a href="qmessagebox.html#defaultButton">defaultButton</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#detailedText">detailedText</a></b> (<i>self</i>)</li><li><div class="fn" />QAbstractButton <b><a href="qmessagebox.html#escapeButton">escapeButton</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmessagebox.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />Icon <b><a href="qmessagebox.html#icon">icon</a></b> (<i>self</i>)</li><li><div class="fn" />QPixmap <b><a href="qmessagebox.html#iconPixmap">iconPixmap</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#informativeText">informativeText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmessagebox.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" /><b><a href="qmessagebox.html#open">open</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmessagebox.html#open-2">open</a></b> (<i>self</i>, QObject, SLOT()SLOT())</li><li><div class="fn" /><b><a href="qmessagebox.html#open-3">open</a></b> (<i>self</i>, callable)</li><li><div class="fn" /><b><a href="qmessagebox.html#removeButton">removeButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent)</li><li><div class="fn" /><b><a href="qmessagebox.html#setButtonText">setButtonText</a></b> (<i>self</i>, int, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setDefaultButton">setDefaultButton</a></b> (<i>self</i>, QPushButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setDefaultButton-2">setDefaultButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setDetailedText">setDetailedText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setEscapeButton">setEscapeButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setEscapeButton-2">setEscapeButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setIcon">setIcon</a></b> (<i>self</i>, Icon)</li><li><div class="fn" /><b><a href="qmessagebox.html#setIconPixmap">setIconPixmap</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" /><b><a href="qmessagebox.html#setInformativeText">setInformativeText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setStandardButtons">setStandardButtons</a></b> (<i>self</i>, StandardButtons)</li><li><div class="fn" /><b><a href="qmessagebox.html#setText">setText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setTextFormat">setTextFormat</a></b> (<i>self</i>, Qt.TextFormat)</li><li><div class="fn" /><b><a href="qmessagebox.html#setWindowModality">setWindowModality</a></b> (<i>self</i>, Qt.WindowModality)</li><li><div class="fn" /><b><a href="qmessagebox.html#setWindowTitle">setWindowTitle</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent)</li><li><div class="fn" />QSize <b><a href="qmessagebox.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#standardButton">standardButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" />StandardButtons <b><a href="qmessagebox.html#standardButtons">standardButtons</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#text">text</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextFormat <b><a href="qmessagebox.html#textFormat">textFormat</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" /><b><a href="qmessagebox.html#about">about</a></b> (QWidget, QString, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#aboutQt">aboutQt</a></b> (QWidget, QString <i>title</i> = QString())</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#critical">critical</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#critical-2">critical</a></b> (QWidget, QString, QString, int, int, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#critical-3">critical</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#information">information</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#information-2">information</a></b> (QWidget, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#information-3">information</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#question">question</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#question-2">question</a></b> (QWidget, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#question-3">question</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li><li><div class="fn" />QPixmap <b><a href="qmessagebox.html#standardIcon">standardIcon</a></b> (Icon)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#warning">warning</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#warning-2">warning</a></b> (QWidget, QString, QString, int, int, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#warning-3">warning</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qmessagebox.html#buttonClicked">buttonClicked</a></b> (QAbstractButton *)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer.</p>
11
<p>A message box displays a primary <a href="qmessagebox.html#text-prop">text</a> to alert the user to a situation, an <a href="qmessagebox.html#informativeText-prop">informative text</a> to further explain the alert or to ask the user a question, and an optional <a href="qmessagebox.html#detailedText-prop">detailed text</a> to provide even more data if the user requests it. A message box can also display an <a href="qmessagebox.html#icon-prop">icon</a> and <a href="qmessagebox.html#standardButtons-prop">standard buttons</a> for accepting a user response.</p>
12
<p>Two APIs for using QMessageBox are provided, the property-based API, and the static functions. Calling one of the static functions is the simpler approach, but it is less flexible than using the property-based API, and the result is less informative. Using the property-based API is recommended.</p>
13
<a name="the-property-based-api" />
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QMessageBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QMessageBox class provides a modal dialog for informing the
10
user or for asking the user a question and receiving an answer.
11
<a href="#details">More...</a></p>
13
<p>Inherits <a href="qdialog.html">QDialog</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a></b> { InvalidRole, AcceptRole, RejectRole, DestructiveRole, ..., ApplyRole }</li><li><div class="fn" />enum <b><a href="qmessagebox.html#Icon-enum">Icon</a></b> { NoIcon, Information, Warning, Critical, Question }</li><li><div class="fn" />enum <b><a href="qmessagebox.html#StandardButton-enum">StandardButton</a></b> { NoButton, Ok, Save, SaveAll, ..., ButtonMask }</li><li><div class="fn" />class <b><a href="qmessagebox-standardbuttons.html">StandardButtons</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmessagebox.html#QMessageBox">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qmessagebox.html#QMessageBox-2">__init__</a></b> (<i>self</i>, Icon, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.NoButton, QWidget <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</li><li><div class="fn" /><b><a href="qmessagebox.html#QMessageBox-3">__init__</a></b> (<i>self</i>, QString, QString, Icon, int, int, int, QWidget <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</li><li><div class="fn" /><b><a href="qmessagebox.html#addButton">addButton</a></b> (<i>self</i>, QAbstractButton, ButtonRole)</li><li><div class="fn" />QPushButton <b><a href="qmessagebox.html#addButton-2">addButton</a></b> (<i>self</i>, QString, ButtonRole)</li><li><div class="fn" />QPushButton <b><a href="qmessagebox.html#addButton-3">addButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" />QAbstractButton <b><a href="qmessagebox.html#button">button</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" />ButtonRole <b><a href="qmessagebox.html#buttonRole">buttonRole</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" />list-of-QAbstractButton <b><a href="qmessagebox.html#buttons">buttons</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#buttonText">buttonText</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qmessagebox.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />QAbstractButton <b><a href="qmessagebox.html#clickedButton">clickedButton</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmessagebox.html#closeEvent">closeEvent</a></b> (<i>self</i>, QCloseEvent)</li><li><div class="fn" />QPushButton <b><a href="qmessagebox.html#defaultButton">defaultButton</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#detailedText">detailedText</a></b> (<i>self</i>)</li><li><div class="fn" />QAbstractButton <b><a href="qmessagebox.html#escapeButton">escapeButton</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmessagebox.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" />Icon <b><a href="qmessagebox.html#icon">icon</a></b> (<i>self</i>)</li><li><div class="fn" />QPixmap <b><a href="qmessagebox.html#iconPixmap">iconPixmap</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#informativeText">informativeText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmessagebox.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent)</li><li><div class="fn" /><b><a href="qmessagebox.html#open">open</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmessagebox.html#open-2">open</a></b> (<i>self</i>, QObject, SLOT()SLOT())</li><li><div class="fn" /><b><a href="qmessagebox.html#open-3">open</a></b> (<i>self</i>, callable)</li><li><div class="fn" /><b><a href="qmessagebox.html#removeButton">removeButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent)</li><li><div class="fn" /><b><a href="qmessagebox.html#setButtonText">setButtonText</a></b> (<i>self</i>, int, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setDefaultButton">setDefaultButton</a></b> (<i>self</i>, QPushButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setDefaultButton-2">setDefaultButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setDetailedText">setDetailedText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setEscapeButton">setEscapeButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setEscapeButton-2">setEscapeButton</a></b> (<i>self</i>, StandardButton)</li><li><div class="fn" /><b><a href="qmessagebox.html#setIcon">setIcon</a></b> (<i>self</i>, Icon)</li><li><div class="fn" /><b><a href="qmessagebox.html#setIconPixmap">setIconPixmap</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" /><b><a href="qmessagebox.html#setInformativeText">setInformativeText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setStandardButtons">setStandardButtons</a></b> (<i>self</i>, StandardButtons)</li><li><div class="fn" /><b><a href="qmessagebox.html#setText">setText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#setTextFormat">setTextFormat</a></b> (<i>self</i>, Qt.TextFormat)</li><li><div class="fn" /><b><a href="qmessagebox.html#setWindowModality">setWindowModality</a></b> (<i>self</i>, Qt.WindowModality)</li><li><div class="fn" /><b><a href="qmessagebox.html#setWindowTitle">setWindowTitle</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent)</li><li><div class="fn" />QSize <b><a href="qmessagebox.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#standardButton">standardButton</a></b> (<i>self</i>, QAbstractButton)</li><li><div class="fn" />StandardButtons <b><a href="qmessagebox.html#standardButtons">standardButtons</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qmessagebox.html#text">text</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TextFormat <b><a href="qmessagebox.html#textFormat">textFormat</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" /><b><a href="qmessagebox.html#about">about</a></b> (QWidget, QString, QString)</li><li><div class="fn" /><b><a href="qmessagebox.html#aboutQt">aboutQt</a></b> (QWidget, QString <i>title</i> = QString())</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#critical">critical</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#critical-2">critical</a></b> (QWidget, QString, QString, int, int, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#critical-3">critical</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#information">information</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#information-2">information</a></b> (QWidget, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#information-3">information</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#question">question</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#question-2">question</a></b> (QWidget, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#question-3">question</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li><li><div class="fn" />QPixmap <b><a href="qmessagebox.html#standardIcon">standardIcon</a></b> (Icon)</li><li><div class="fn" />StandardButton <b><a href="qmessagebox.html#warning">warning</a></b> (QWidget, QString, QString, StandardButtons <i>buttons</i> = QMessageBox.Ok, StandardButton <i>defaultButton</i> = QMessageBox.NoButton)</li><li><div class="fn" />int <b><a href="qmessagebox.html#warning-2">warning</a></b> (QWidget, QString, QString, int, int, int <i>button2</i> = 0)</li><li><div class="fn" />int <b><a href="qmessagebox.html#warning-3">warning</a></b> (QWidget, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qmessagebox.html#buttonClicked">buttonClicked</a></b> (QAbstractButton *)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QMessageBox class provides a modal dialog for informing the
14
user or for asking the user a question and receiving an answer.</p>
15
<p>A message box displays a primary <a href="qmessagebox.html#text-prop">text</a> to alert the user to a
16
situation, an <a href="qmessagebox.html#informativeText-prop">informative text</a> to
17
further explain the alert or to ask the user a question, and an
18
optional <a href="qmessagebox.html#detailedText-prop">detailed
19
text</a> to provide even more data if the user requests it. A
20
message box can also display an <a href="qmessagebox.html#icon-prop">icon</a> and <a href="qmessagebox.html#standardButtons-prop">standard buttons</a> for
21
accepting a user response.</p>
22
<p>Two APIs for using QMessageBox are provided, the property-based
23
API, and the static functions. Calling one of the static functions
24
is the simpler approach, but it is less flexible than using the
25
property-based API, and the result is less informative. Using the
26
property-based API is recommended.</p>
27
<a id="the-property-based-api" name="the-property-based-api" />
14
28
<h3>The Property-based API</h3>
15
<p>To use the property-based API, construct an instance of QMessageBox, set the desired properties, and call <a href="qmessagebox.html#exec">exec_</a>() to show the message. The simplest configuration is to set only the <a href="qmessagebox.html#text-prop">message text</a> property.</p>
16
<pre> QMessageBox msgBox;
29
<p>To use the property-based API, construct an instance of
30
QMessageBox, set the desired properties, and call <a href="qmessagebox.html#exec">exec_</a>() to show the message. The
31
simplest configuration is to set only the <a href="qmessagebox.html#text-prop">message text</a> property.</p>
32
<pre class="highlightedCode brush: cpp">
17
34
msgBox.setText("The document has been modified.");
19
<p>The user must click the <b>OK</b> button to dismiss the message box. The rest of the GUI is blocked until the message box is dismissed.</p>
20
<p align="center"><img src="images/msgbox1.png" /></p><p>A better approach than just alerting the user to an event is to also ask the user what to do about it. Store the question in the <a href="qmessagebox.html#informativeText-prop">informative text</a> property, and set the <a href="qmessagebox.html#standardButtons-prop">standard buttons</a> property to the set of buttons you want as the set of user responses. The buttons are specified by combining values from <a href="qmessagebox.html#StandardButton-enum">StandardButtons</a> using the bitwise OR operator. The display order for the buttons is platform-dependent. For example, on Windows, <b>Save</b> is displayed to the left of <b>Cancel</b>, whereas on Mac OS, the order is reversed.</p>
37
<p>The user must click the <b>OK</b> button to dismiss the message
38
box. The rest of the GUI is blocked until the message box is
40
<p class="centerAlign"><img src="images/msgbox1.png" /></p>
41
<p>A better approach than just alerting the user to an event is to
42
also ask the user what to do about it. Store the question in the
43
<a href="qmessagebox.html#informativeText-prop">informative
44
text</a> property, and set the <a href="qmessagebox.html#standardButtons-prop">standard buttons</a>
45
property to the set of buttons you want as the set of user
46
responses. The buttons are specified by combining values from
47
<a href="qmessagebox.html#StandardButton-enum">StandardButtons</a>
48
using the bitwise OR operator. The display order for the buttons is
49
platform-dependent. For example, on Windows, <b>Save</b> is
50
displayed to the left of <b>Cancel</b>, whereas on Mac OS, the
51
order is reversed.</p>
21
52
<p>Mark one of your standard buttons to be your <a href="qmessagebox.html#defaultButton">default button</a>.</p>
22
<pre> QMessageBox msgBox;
53
<pre class="highlightedCode brush: cpp">
23
55
msgBox.setText("The document has been modified.");
24
56
msgBox.setInformativeText("Do you want to save your changes?");
25
57
msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel);
26
58
msgBox.setDefaultButton(QMessageBox.Save);
27
int ret = msgBox.exec();</pre>
28
<p>This is the approach recommended in the <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGWindows/chapter_18_section_7.html">Mac OS X Guidlines</a>. Similar guidlines apply for the other platforms, but note the different ways the <a href="qmessagebox.html#informativeText-prop">informative text</a> is handled for different platforms.</p>
29
<p align="center"><img src="images/msgbox2.png" /></p><p>The <a href="qmessagebox.html#exec">exec_</a>() slot returns the <a href="qmessagebox.html#StandardButton-enum">StandardButtons</a> value of the button that was clicked.</p>
59
int ret = msgBox.exec();
61
<p>This is the approach recommended in the <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGWindows/chapter_18_section_7.html">
62
Mac OS X Guidlines</a>. Similar guidlines apply for the other
63
platforms, but note the different ways the <a href="qmessagebox.html#informativeText-prop">informative text</a> is
64
handled for different platforms.</p>
65
<p class="centerAlign"><img src="images/msgbox2.png" /></p>
66
<p>The <a href="qmessagebox.html#exec">exec_</a>() slot returns the
67
<a href="qmessagebox.html#StandardButton-enum">StandardButtons</a>
68
value of the button that was clicked.</p>
69
<pre class="highlightedCode brush: cpp">
31
71
case QMessageBox.Save:
32
72
<span class="comment">// Save was clicked</span>
83
229
<span class="comment">// connect</span>
84
230
} else if (msgBox.clickedButton() == abortButton) {
85
231
<span class="comment">// abort</span>
87
<a name="default-and-escape-keys" />
234
<a id="default-and-escape-keys" name="default-and-escape-keys" />
88
235
<h3>Default and Escape Keys</h3>
89
<p>The default button (i.e., the button activated when <b>Enter</b> is pressed) can be specified using <a href="qmessagebox.html#setDefaultButton">setDefaultButton</a>(). If a default button is not specified, QMessageBox tries to find one based on the <a href="qmessagebox.html#ButtonRole-enum">button roles</a> of the buttons used in the message box.</p>
90
<p>The escape button (the button activated when <b>Esc</b> is pressed) can be specified using <a href="qmessagebox.html#setEscapeButton">setEscapeButton</a>(). If an escape button is not specified, QMessageBox tries to find one using these rules:</p>
236
<p>The default button (i.e., the button activated when <b>Enter</b>
237
is pressed) can be specified using <a href="qmessagebox.html#setDefaultButton">setDefaultButton</a>(). If a
238
default button is not specified, QMessageBox tries to find one
239
based on the <a href="qmessagebox.html#ButtonRole-enum">button
240
roles</a> of the buttons used in the message box.</p>
241
<p>The escape button (the button activated when <b>Esc</b> is
242
pressed) can be specified using <a href="qmessagebox.html#setEscapeButton">setEscapeButton</a>(). If an
243
escape button is not specified, QMessageBox tries to find one using
92
<li>If there is only one button, it is the button activated when <b>Esc</b> is pressed.</li>
93
<li>If there is a <a href="qmessagebox.html#StandardButton-enum">Cancel</a> button, it is the button activated when <b>Esc</b> is pressed.</li>
94
<li>If there is exactly one button having either <a href="qmessagebox.html#ButtonRole-enum">the Reject role</a> or the <a href="qmessagebox.html#ButtonRole-enum">the No role</a>, it is the button activated when <b>Esc</b> is pressed.</li>
246
<li>If there is only one button, it is the button activated when
247
<b>Esc</b> is pressed.</li>
248
<li>If there is a <a href="qmessagebox.html#StandardButton-enum">Cancel</a> button, it is the
249
button activated when <b>Esc</b> is pressed.</li>
250
<li>If there is exactly one button having either <a href="qmessagebox.html#ButtonRole-enum">the Reject role</a> or the
251
<a href="qmessagebox.html#ButtonRole-enum">the No role</a>, it is
252
the button activated when <b>Esc</b> is pressed.</li>
96
<p>When an escape button can't be determined using these rules, pressing <b>Esc</b> has no effect.</p>
97
<p>See also <a href="qdialogbuttonbox.html">QDialogButtonBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Message Box</a>, <a href="dialogs-standarddialogs.html">Standard Dialogs Example</a>, and <a href="mainwindows-application.html">Application Example</a>.</p>
98
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ButtonRole-enum" />QMessageBox.ButtonRole</h3><p>This enum describes the roles that can be used to describe buttons in the button box. Combinations of these roles are as flags used to describe different aspects of their behavior.</p>
99
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
100
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
101
<tr><td valign="top"><tt>QMessageBox.InvalidRole</tt></td><td align="center" valign="top"><tt>-1</tt></td><td valign="top">The button is invalid.</td></tr>
102
<tr><td valign="top"><tt>QMessageBox.AcceptRole</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Clicking the button causes the dialog to be accepted (e.g. OK).</td></tr>
103
<tr><td valign="top"><tt>QMessageBox.RejectRole</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Clicking the button causes the dialog to be rejected (e.g. Cancel).</td></tr>
104
<tr><td valign="top"><tt>QMessageBox.DestructiveRole</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Clicking the button causes a destructive change (e.g. for Discarding Changes) and closes the dialog.</td></tr>
105
<tr><td valign="top"><tt>QMessageBox.ActionRole</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Clicking the button causes changes to the elements within the dialog.</td></tr>
106
<tr><td valign="top"><tt>QMessageBox.HelpRole</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">The button can be clicked to request help.</td></tr>
107
<tr><td valign="top"><tt>QMessageBox.YesRole</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">The button is a "Yes"-like button.</td></tr>
108
<tr><td valign="top"><tt>QMessageBox.NoRole</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">The button is a "No"-like button.</td></tr>
109
<tr><td valign="top"><tt>QMessageBox.ApplyRole</tt></td><td align="center" valign="top"><tt>8</tt></td><td valign="top">The button applies current changes.</td></tr>
110
<tr><td valign="top"><tt>QMessageBox.ResetRole</tt></td><td align="center" valign="top"><tt>7</tt></td><td valign="top">The button resets the dialog's fields to default values.</td></tr>
254
<p>When an escape button can't be determined using these rules,
255
pressing <b>Esc</b> has no effect.</p>
256
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ButtonRole-enum" />QMessageBox.ButtonRole</h3><p>This enum describes the roles that can be used to describe
257
buttons in the button box. Combinations of these roles are as flags
258
used to describe different aspects of their behavior.</p>
259
<table class="valuelist">
264
<th class="tblConst">Constant</th>
265
<th class="tblval">Value</th>
266
<th class="tbldscr">Description</th>
269
<td class="topAlign"><tt>QMessageBox.InvalidRole</tt></td>
270
<td class=" topAlign"><tt>-1</tt></td>
271
<td class="topAlign">The button is invalid.</td>
274
<td class="topAlign"><tt>QMessageBox.AcceptRole</tt></td>
275
<td class=" topAlign"><tt>0</tt></td>
276
<td class="topAlign">Clicking the button causes the dialog to be
277
accepted (e.g. OK).</td>
280
<td class="topAlign"><tt>QMessageBox.RejectRole</tt></td>
281
<td class=" topAlign"><tt>1</tt></td>
282
<td class="topAlign">Clicking the button causes the dialog to be
283
rejected (e.g. Cancel).</td>
286
<td class="topAlign"><tt>QMessageBox.DestructiveRole</tt></td>
287
<td class=" topAlign"><tt>2</tt></td>
288
<td class="topAlign">Clicking the button causes a destructive
289
change (e.g. for Discarding Changes) and closes the dialog.</td>
292
<td class="topAlign"><tt>QMessageBox.ActionRole</tt></td>
293
<td class=" topAlign"><tt>3</tt></td>
294
<td class="topAlign">Clicking the button causes changes to the
295
elements within the dialog.</td>
298
<td class="topAlign"><tt>QMessageBox.HelpRole</tt></td>
299
<td class=" topAlign"><tt>4</tt></td>
300
<td class="topAlign">The button can be clicked to request
304
<td class="topAlign"><tt>QMessageBox.YesRole</tt></td>
305
<td class=" topAlign"><tt>5</tt></td>
306
<td class="topAlign">The button is a "Yes"-like button.</td>
309
<td class="topAlign"><tt>QMessageBox.NoRole</tt></td>
310
<td class=" topAlign"><tt>6</tt></td>
311
<td class="topAlign">The button is a "No"-like button.</td>
314
<td class="topAlign"><tt>QMessageBox.ApplyRole</tt></td>
315
<td class=" topAlign"><tt>8</tt></td>
316
<td class="topAlign">The button applies current changes.</td>
319
<td class="topAlign"><tt>QMessageBox.ResetRole</tt></td>
320
<td class=" topAlign"><tt>7</tt></td>
321
<td class="topAlign">The button resets the dialog's fields to
112
325
<p>See also <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>.</p>
113
<a name="//apple_ref/cpp/tag/QMessageBox/Icon" />
114
<a name="//apple_ref/cpp/econst/QMessageBox/NoIcon" />
115
<a name="//apple_ref/cpp/econst/QMessageBox/Question" />
116
<a name="//apple_ref/cpp/econst/QMessageBox/Information" />
117
<a name="//apple_ref/cpp/econst/QMessageBox/Warning" />
118
<a name="//apple_ref/cpp/econst/QMessageBox/Critical" />
119
328
<h3 class="fn"><a name="Icon-enum" />QMessageBox.Icon</h3><p>This enum has the following values:</p>
120
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
121
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
122
<tr><td valign="top"><tt>QMessageBox.NoIcon</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">the message box does not have any icon.</td></tr>
123
<tr><td valign="top"><tt>QMessageBox.Question</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">an icon indicating that the message is asking a question.</td></tr>
124
<tr><td valign="top"><tt>QMessageBox.Information</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">an icon indicating that the message is nothing out of the ordinary.</td></tr>
125
<tr><td valign="top"><tt>QMessageBox.Warning</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">an icon indicating that the message is a warning, but can be dealt with.</td></tr>
126
<tr><td valign="top"><tt>QMessageBox.Critical</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">an icon indicating that the message represents a critical problem.</td></tr>
128
<a name="//apple_ref/cpp/tag/QMessageBox/StandardButton" />
129
<a name="//apple_ref/cpp/econst/QMessageBox/Ok" />
130
<a name="//apple_ref/cpp/econst/QMessageBox/Open" />
131
<a name="//apple_ref/cpp/econst/QMessageBox/Save" />
132
<a name="//apple_ref/cpp/econst/QMessageBox/Cancel" />
133
<a name="//apple_ref/cpp/econst/QMessageBox/Close" />
134
<a name="//apple_ref/cpp/econst/QMessageBox/Discard" />
135
<a name="//apple_ref/cpp/econst/QMessageBox/Apply" />
136
<a name="//apple_ref/cpp/econst/QMessageBox/Reset" />
137
<a name="//apple_ref/cpp/econst/QMessageBox/RestoreDefaults" />
138
<a name="//apple_ref/cpp/econst/QMessageBox/Help" />
139
<a name="//apple_ref/cpp/econst/QMessageBox/SaveAll" />
140
<a name="//apple_ref/cpp/econst/QMessageBox/Yes" />
141
<a name="//apple_ref/cpp/econst/QMessageBox/YesToAll" />
142
<a name="//apple_ref/cpp/econst/QMessageBox/No" />
143
<a name="//apple_ref/cpp/econst/QMessageBox/NoToAll" />
144
<a name="//apple_ref/cpp/econst/QMessageBox/Abort" />
145
<a name="//apple_ref/cpp/econst/QMessageBox/Retry" />
146
<a name="//apple_ref/cpp/econst/QMessageBox/Ignore" />
147
<a name="//apple_ref/cpp/econst/QMessageBox/NoButton" />
148
<a name="//apple_ref/cpp/econst/QMessageBox/FirstButton" />
149
<a name="//apple_ref/cpp/econst/QMessageBox/LastButton" />
150
<a name="//apple_ref/cpp/econst/QMessageBox/YesAll" />
151
<a name="//apple_ref/cpp/econst/QMessageBox/NoAll" />
152
<a name="//apple_ref/cpp/econst/QMessageBox/Default" />
153
<a name="//apple_ref/cpp/econst/QMessageBox/Escape" />
154
<a name="//apple_ref/cpp/econst/QMessageBox/FlagMask" />
155
<a name="//apple_ref/cpp/econst/QMessageBox/ButtonMask" />
156
<a name="//apple_ref/cpp/tdef/QMessageBox/StandardButtons" />
157
<h3 class="fn"><a name="StandardButton-enum" />QMessageBox.StandardButton</h3><p>These enums describe flags for standard buttons. Each button has a defined <a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a>.</p>
158
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
159
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
160
<tr><td valign="top"><tt>QMessageBox.Ok</tt></td><td align="center" valign="top"><tt>0x00000400</tt></td><td valign="top">An "OK" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
161
<tr><td valign="top"><tt>QMessageBox.Open</tt></td><td align="center" valign="top"><tt>0x00002000</tt></td><td valign="top">A "Open" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
162
<tr><td valign="top"><tt>QMessageBox.Save</tt></td><td align="center" valign="top"><tt>0x00000800</tt></td><td valign="top">A "Save" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
163
<tr><td valign="top"><tt>QMessageBox.Cancel</tt></td><td align="center" valign="top"><tt>0x00400000</tt></td><td valign="top">A "Cancel" button defined with the <a href="qmessagebox.html#ButtonRole-enum">RejectRole</a>.</td></tr>
164
<tr><td valign="top"><tt>QMessageBox.Close</tt></td><td align="center" valign="top"><tt>0x00200000</tt></td><td valign="top">A "Close" button defined with the <a href="qmessagebox.html#ButtonRole-enum">RejectRole</a>.</td></tr>
165
<tr><td valign="top"><tt>QMessageBox.Discard</tt></td><td align="center" valign="top"><tt>0x00800000</tt></td><td valign="top">A "Discard" or "Don't Save" button, depending on the platform, defined with the <a href="qmessagebox.html#ButtonRole-enum">DestructiveRole</a>.</td></tr>
166
<tr><td valign="top"><tt>QMessageBox.Apply</tt></td><td align="center" valign="top"><tt>0x02000000</tt></td><td valign="top">An "Apply" button defined with the <a href="qmessagebox.html#ButtonRole-enum">ApplyRole</a>.</td></tr>
167
<tr><td valign="top"><tt>QMessageBox.Reset</tt></td><td align="center" valign="top"><tt>0x04000000</tt></td><td valign="top">A "Reset" button defined with the <a href="qmessagebox.html#ButtonRole-enum">ResetRole</a>.</td></tr>
168
<tr><td valign="top"><tt>QMessageBox.RestoreDefaults</tt></td><td align="center" valign="top"><tt>0x08000000</tt></td><td valign="top">A "Restore Defaults" button defined with the <a href="qmessagebox.html#ButtonRole-enum">ResetRole</a>.</td></tr>
169
<tr><td valign="top"><tt>QMessageBox.Help</tt></td><td align="center" valign="top"><tt>0x01000000</tt></td><td valign="top">A "Help" button defined with the <a href="qmessagebox.html#ButtonRole-enum">HelpRole</a>.</td></tr>
170
<tr><td valign="top"><tt>QMessageBox.SaveAll</tt></td><td align="center" valign="top"><tt>0x00001000</tt></td><td valign="top">A "Save All" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
171
<tr><td valign="top"><tt>QMessageBox.Yes</tt></td><td align="center" valign="top"><tt>0x00004000</tt></td><td valign="top">A "Yes" button defined with the <a href="qmessagebox.html#ButtonRole-enum">YesRole</a>.</td></tr>
172
<tr><td valign="top"><tt>QMessageBox.YesToAll</tt></td><td align="center" valign="top"><tt>0x00008000</tt></td><td valign="top">A "Yes to All" button defined with the <a href="qmessagebox.html#ButtonRole-enum">YesRole</a>.</td></tr>
173
<tr><td valign="top"><tt>QMessageBox.No</tt></td><td align="center" valign="top"><tt>0x00010000</tt></td><td valign="top">A "No" button defined with the <a href="qmessagebox.html#ButtonRole-enum">NoRole</a>.</td></tr>
174
<tr><td valign="top"><tt>QMessageBox.NoToAll</tt></td><td align="center" valign="top"><tt>0x00020000</tt></td><td valign="top">A "No to All" button defined with the <a href="qmessagebox.html#ButtonRole-enum">NoRole</a>.</td></tr>
175
<tr><td valign="top"><tt>QMessageBox.Abort</tt></td><td align="center" valign="top"><tt>0x00040000</tt></td><td valign="top">An "Abort" button defined with the <a href="qmessagebox.html#ButtonRole-enum">RejectRole</a>.</td></tr>
176
<tr><td valign="top"><tt>QMessageBox.Retry</tt></td><td align="center" valign="top"><tt>0x00080000</tt></td><td valign="top">A "Retry" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
177
<tr><td valign="top"><tt>QMessageBox.Ignore</tt></td><td align="center" valign="top"><tt>0x00100000</tt></td><td valign="top">An "Ignore" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td></tr>
178
<tr><td valign="top"><tt>QMessageBox.NoButton</tt></td><td align="center" valign="top"><tt>0x00000000</tt></td><td valign="top">An invalid button.</td></tr>
329
<table class="valuelist">
334
<th class="tblConst">Constant</th>
335
<th class="tblval">Value</th>
336
<th class="tbldscr">Description</th>
339
<td class="topAlign"><tt>QMessageBox.NoIcon</tt></td>
340
<td class=" topAlign"><tt>0</tt></td>
341
<td class="topAlign">the message box does not have any icon.</td>
344
<td class="topAlign"><tt>QMessageBox.Question</tt></td>
345
<td class=" topAlign"><tt>4</tt></td>
346
<td class="topAlign">an icon indicating that the message is asking
350
<td class="topAlign"><tt>QMessageBox.Information</tt></td>
351
<td class=" topAlign"><tt>1</tt></td>
352
<td class="topAlign">an icon indicating that the message is nothing
353
out of the ordinary.</td>
356
<td class="topAlign"><tt>QMessageBox.Warning</tt></td>
357
<td class=" topAlign"><tt>2</tt></td>
358
<td class="topAlign">an icon indicating that the message is a
359
warning, but can be dealt with.</td>
362
<td class="topAlign"><tt>QMessageBox.Critical</tt></td>
363
<td class=" topAlign"><tt>3</tt></td>
364
<td class="topAlign">an icon indicating that the message represents
365
a critical problem.</td>
370
<h3 class="fn"><a name="StandardButton-enum" />QMessageBox.StandardButton</h3><p>These enums describe flags for standard buttons. Each button has
371
a defined <a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a>.</p>
372
<table class="valuelist">
377
<th class="tblConst">Constant</th>
378
<th class="tblval">Value</th>
379
<th class="tbldscr">Description</th>
382
<td class="topAlign"><tt>QMessageBox.Ok</tt></td>
383
<td class=" topAlign"><tt>0x00000400</tt></td>
384
<td class="topAlign">An "OK" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td>
387
<td class="topAlign"><tt>QMessageBox.Open</tt></td>
388
<td class=" topAlign"><tt>0x00002000</tt></td>
389
<td class="topAlign">A "Open" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td>
392
<td class="topAlign"><tt>QMessageBox.Save</tt></td>
393
<td class=" topAlign"><tt>0x00000800</tt></td>
394
<td class="topAlign">A "Save" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td>
397
<td class="topAlign"><tt>QMessageBox.Cancel</tt></td>
398
<td class=" topAlign"><tt>0x00400000</tt></td>
399
<td class="topAlign">A "Cancel" button defined with the <a href="qmessagebox.html#ButtonRole-enum">RejectRole</a>.</td>
402
<td class="topAlign"><tt>QMessageBox.Close</tt></td>
403
<td class=" topAlign"><tt>0x00200000</tt></td>
404
<td class="topAlign">A "Close" button defined with the <a href="qmessagebox.html#ButtonRole-enum">RejectRole</a>.</td>
407
<td class="topAlign"><tt>QMessageBox.Discard</tt></td>
408
<td class=" topAlign"><tt>0x00800000</tt></td>
409
<td class="topAlign">A "Discard" or "Don't Save" button, depending
410
on the platform, defined with the <a href="qmessagebox.html#ButtonRole-enum">DestructiveRole</a>.</td>
413
<td class="topAlign"><tt>QMessageBox.Apply</tt></td>
414
<td class=" topAlign"><tt>0x02000000</tt></td>
415
<td class="topAlign">An "Apply" button defined with the <a href="qmessagebox.html#ButtonRole-enum">ApplyRole</a>.</td>
418
<td class="topAlign"><tt>QMessageBox.Reset</tt></td>
419
<td class=" topAlign"><tt>0x04000000</tt></td>
420
<td class="topAlign">A "Reset" button defined with the <a href="qmessagebox.html#ButtonRole-enum">ResetRole</a>.</td>
423
<td class="topAlign"><tt>QMessageBox.RestoreDefaults</tt></td>
424
<td class=" topAlign"><tt>0x08000000</tt></td>
425
<td class="topAlign">A "Restore Defaults" button defined with the
426
<a href="qmessagebox.html#ButtonRole-enum">ResetRole</a>.</td>
429
<td class="topAlign"><tt>QMessageBox.Help</tt></td>
430
<td class=" topAlign"><tt>0x01000000</tt></td>
431
<td class="topAlign">A "Help" button defined with the <a href="qmessagebox.html#ButtonRole-enum">HelpRole</a>.</td>
434
<td class="topAlign"><tt>QMessageBox.SaveAll</tt></td>
435
<td class=" topAlign"><tt>0x00001000</tt></td>
436
<td class="topAlign">A "Save All" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td>
439
<td class="topAlign"><tt>QMessageBox.Yes</tt></td>
440
<td class=" topAlign"><tt>0x00004000</tt></td>
441
<td class="topAlign">A "Yes" button defined with the <a href="qmessagebox.html#ButtonRole-enum">YesRole</a>.</td>
444
<td class="topAlign"><tt>QMessageBox.YesToAll</tt></td>
445
<td class=" topAlign"><tt>0x00008000</tt></td>
446
<td class="topAlign">A "Yes to All" button defined with the
447
<a href="qmessagebox.html#ButtonRole-enum">YesRole</a>.</td>
450
<td class="topAlign"><tt>QMessageBox.No</tt></td>
451
<td class=" topAlign"><tt>0x00010000</tt></td>
452
<td class="topAlign">A "No" button defined with the <a href="qmessagebox.html#ButtonRole-enum">NoRole</a>.</td>
455
<td class="topAlign"><tt>QMessageBox.NoToAll</tt></td>
456
<td class=" topAlign"><tt>0x00020000</tt></td>
457
<td class="topAlign">A "No to All" button defined with the <a href="qmessagebox.html#ButtonRole-enum">NoRole</a>.</td>
460
<td class="topAlign"><tt>QMessageBox.Abort</tt></td>
461
<td class=" topAlign"><tt>0x00040000</tt></td>
462
<td class="topAlign">An "Abort" button defined with the <a href="qmessagebox.html#ButtonRole-enum">RejectRole</a>.</td>
465
<td class="topAlign"><tt>QMessageBox.Retry</tt></td>
466
<td class=" topAlign"><tt>0x00080000</tt></td>
467
<td class="topAlign">A "Retry" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td>
470
<td class="topAlign"><tt>QMessageBox.Ignore</tt></td>
471
<td class=" topAlign"><tt>0x00100000</tt></td>
472
<td class="topAlign">An "Ignore" button defined with the <a href="qmessagebox.html#ButtonRole-enum">AcceptRole</a>.</td>
475
<td class="topAlign"><tt>QMessageBox.NoButton</tt></td>
476
<td class=" topAlign"><tt>0x00000000</tt></td>
477
<td class="topAlign">An invalid button.</td>
180
480
<p>The following values are obsolete:</p>
181
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
182
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
183
<tr><td valign="top"><tt>QMessageBox.YesAll</tt></td><td align="center" valign="top"><tt>YesToAll</tt></td><td valign="top">Use YesToAll instead.</td></tr>
184
<tr><td valign="top"><tt>QMessageBox.NoAll</tt></td><td align="center" valign="top"><tt>NoToAll</tt></td><td valign="top">Use NoToAll instead.</td></tr>
185
<tr><td valign="top"><tt>QMessageBox.Default</tt></td><td align="center" valign="top"><tt>0x00000100</tt></td><td valign="top">Use the <tt>defaultButton</tt> argument of <a href="qmessagebox.html#information">information</a>(), <a href="qmessagebox.html#warning">warning</a>(), etc. instead, or call <a href="qmessagebox.html#setDefaultButton">setDefaultButton</a>().</td></tr>
186
<tr><td valign="top"><tt>QMessageBox.Escape</tt></td><td align="center" valign="top"><tt>0x00000200</tt></td><td valign="top">Call <a href="qmessagebox.html#setEscapeButton">setEscapeButton</a>() instead.</td></tr>
187
<tr><td valign="top"><tt>QMessageBox.FlagMask</tt></td><td align="center" valign="top"><tt>0x00000300</tt></td><td valign="top"> </td></tr>
188
<tr><td valign="top"><tt>QMessageBox.ButtonMask</tt></td><td align="center" valign="top"><tt>~FlagMask</tt></td><td valign="top"> </td></tr>
481
<table class="valuelist">
486
<th class="tblConst">Constant</th>
487
<th class="tblval">Value</th>
488
<th class="tbldscr">Description</th>
491
<td class="topAlign"><tt>QMessageBox.YesAll</tt></td>
492
<td class=" topAlign"><tt>YesToAll</tt></td>
493
<td class="topAlign">Use YesToAll instead.</td>
496
<td class="topAlign"><tt>QMessageBox.NoAll</tt></td>
497
<td class=" topAlign"><tt>NoToAll</tt></td>
498
<td class="topAlign">Use NoToAll instead.</td>
501
<td class="topAlign"><tt>QMessageBox.Default</tt></td>
502
<td class=" topAlign"><tt>0x00000100</tt></td>
503
<td class="topAlign">Use the <tt>defaultButton</tt> argument of
504
<a href="qmessagebox.html#information">information</a>(), <a href="qmessagebox.html#warning">warning</a>(), etc. instead, or call
505
<a href="qmessagebox.html#setDefaultButton">setDefaultButton</a>().</td>
508
<td class="topAlign"><tt>QMessageBox.Escape</tt></td>
509
<td class=" topAlign"><tt>0x00000200</tt></td>
510
<td class="topAlign">Call <a href="qmessagebox.html#setEscapeButton">setEscapeButton</a>()
514
<td class="topAlign"><tt>QMessageBox.FlagMask</tt></td>
515
<td class=" topAlign"><tt>0x00000300</tt></td>
516
<td class="topAlign"> </td>
519
<td class="topAlign"><tt>QMessageBox.ButtonMask</tt></td>
520
<td class=" topAlign"><tt>~FlagMask</tt></td>
521
<td class="topAlign"> </td>
190
524
<p>This enum was introduced in Qt 4.2.</p>
191
<p>The StandardButtons type is a typedef for <a href="qflags.html">QFlags</a><StandardButton>. It stores an OR combination of StandardButton values.</p>
525
<p>The StandardButtons type is a typedef for <a href="qflags.html">QFlags</a><StandardButton>. It stores an OR
526
combination of StandardButton values.</p>
192
527
<p>See also <a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a> and <a href="qmessagebox.html#standardButtons-prop">standardButtons</a>.</p>
193
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMessageBox" />QMessageBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a message box with no text and no buttons. <i>parent</i> is passed to the <a href="qdialog.html">QDialog</a> constructor.</p>
194
<p>On Mac OS X, if you want your message box to appear as a <a href="qt.html#WindowType-enum">Qt.Sheet</a> of its <i>parent</i>, set the message box's <a href="qmessagebox.html#setWindowModality">window modality</a> to <a href="qt.html#WindowModality-enum">Qt.WindowModal</a> or use <a href="qmessagebox.html#open">open</a>(). Otherwise, the message box will be a standard dialog.</p>
195
<h3 class="fn"><a name="QMessageBox-2" />QMessageBox.__init__ (<i>self</i>, <a href="qmessagebox.html#Icon-enum">Icon</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.NoButton, <a href="qwidget.html">QWidget</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a message box with the given <i>icon</i>, <i>title</i>, <i>text</i>, and standard <i>buttons</i>. Standard or custom buttons can be added at any time using <a href="qmessagebox.html#addButton">addButton</a>(). The <i>parent</i> and <i>f</i> arguments are passed to the <a href="qdialog.html">QDialog</a> constructor.</p>
196
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If <i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to <i>parent</i>.</p>
197
<p>On Mac OS X, if <i>parent</i> is not 0 and you want your message box to appear as a <a href="qt.html#WindowType-enum">Qt.Sheet</a> of that parent, set the message box's <a href="qmessagebox.html#setWindowModality">window modality</a> to <a href="qt.html#WindowModality-enum">Qt.WindowModal</a> (default). Otherwise, the message box will be a standard dialog.</p>
528
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMessageBox" />QMessageBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a message box with no text and no buttons.
529
<i>parent</i> is passed to the <a href="qdialog.html">QDialog</a>
531
<p>On Mac OS X, if you want your message box to appear as a
532
<a href="qt.html#WindowType-enum">Qt.Sheet</a> of its
533
<i>parent</i>, set the message box's <a href="qmessagebox.html#setWindowModality">window modality</a> to
534
<a href="qt.html#WindowModality-enum">Qt.WindowModal</a> or use
535
<a href="qmessagebox.html#open">open</a>(). Otherwise, the message
536
box will be a standard dialog.</p>
539
<h3 class="fn"><a name="QMessageBox-2" />QMessageBox.__init__ (<i>self</i>, <a href="qmessagebox.html#Icon-enum">Icon</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.NoButton, <a href="qwidget.html">QWidget</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a message box with the given <i>icon</i>,
540
<i>title</i>, <i>text</i>, and standard <i>buttons</i>. Standard or
541
custom buttons can be added at any time using <a href="qmessagebox.html#addButton">addButton</a>(). The <i>parent</i> and
542
<i>f</i> arguments are passed to the <a href="qdialog.html">QDialog</a> constructor.</p>
543
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If
544
<i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to
546
<p>On Mac OS X, if <i>parent</i> is not 0 and you want your message
547
box to appear as a <a href="qt.html#WindowType-enum">Qt.Sheet</a>
548
of that parent, set the message box's <a href="qmessagebox.html#setWindowModality">window modality</a> to
549
<a href="qt.html#WindowModality-enum">Qt.WindowModal</a>
550
(default). Otherwise, the message box will be a standard
198
552
<p>See also <a href="qmessagebox.html#setWindowTitle">setWindowTitle</a>(), <a href="qmessagebox.html#text-prop">setText</a>(), <a href="qmessagebox.html#icon-prop">setIcon</a>(), and <a href="qmessagebox.html#standardButtons-prop">setStandardButtons</a>().</p>
199
<a name="//apple_ref/cpp/instm/QMessageBox/~QMessageBox" />
200
<h3 class="fn"><a name="QMessageBox-3" />QMessageBox.__init__ (<i>self</i>, QString, QString, <a href="qmessagebox.html#Icon-enum">Icon</a>, int, int, int, <a href="qwidget.html">QWidget</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><h3 class="fn"><a name="about" />QMessageBox.about (<a href="qwidget.html">QWidget</a>, QString, QString)</h3><p>Displays a simple about box with title <i>title</i> and text <i>text</i>. The about box's parent is <i>parent</i>.</p>
555
<h3 class="fn"><a name="QMessageBox-3" />QMessageBox.__init__ (<i>self</i>, QString, QString, <a href="qmessagebox.html#Icon-enum">Icon</a>, int, int, int, <a href="qwidget.html">QWidget</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = Qt.Dialog|Qt.MSWindowsFixedSizeDialogHint)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><h3 class="fn"><a name="about" />QMessageBox.about (<a href="qwidget.html">QWidget</a>, QString, QString)</h3><p>Displays a simple about box with title <i>title</i> and text
556
<i>text</i>. The about box's parent is <i>parent</i>.</p>
201
557
<p>about() looks for a suitable icon in four locations:</p>
203
<li>It prefers <a href="qwidget.html#windowIcon-prop">parent->icon()</a> if that exists.</li>
204
<li>If not, it tries the top-level widget containing <i>parent</i>.</li>
559
<li>It prefers <a href="qwidget.html#windowIcon-prop">parent->icon()</a> if that
561
<li>If not, it tries the top-level widget containing
205
563
<li>If that fails, it tries the <a href="qapplication.html#activeWindow">active window.</a></li>
206
564
<li>As a last resort it uses the Information icon.</li>
208
<p>The about box has a single button labelled "OK". On Mac OS X, the about box is popped up as a modeless window; on other platforms, it is currently a window modal.</p>
209
<p>See also <a href="qwidget.html#windowIcon-prop">QWidget.windowIcon</a>() and <a href="qapplication.html#activeWindow">QApplication.activeWindow</a>().</p>
210
<a name="//apple_ref/cpp/clm/QMessageBox/aboutQt" />
211
<h3 class="fn"><a name="aboutQt" />QMessageBox.aboutQt (<a href="qwidget.html">QWidget</a>, QString <i>title</i> = QString())</h3><p>Displays a simple message box about Qt, with the given <i>title</i> and centered over <i>parent</i> (if <i>parent</i> is not 0). The message includes the version number of Qt being used by the application.</p>
212
<p>This is useful for inclusion in the <b>Help</b> menu of an application, as shown in the <a href="mainwindows-menus.html">Menus</a> example.</p>
213
<p><a href="qapplication.html">QApplication</a> provides this functionality as a slot.</p>
214
<p>On Mac OS X, the about box is popped up as a modeless window; on other platforms, it is currently window modal.</p>
566
<p>The about box has a single button labelled "OK". On Mac OS X,
567
the about box is popped up as a modeless window; on other
568
platforms, it is currently a window modal.</p>
569
<p>See also <a href="qwidget.html#windowIcon-prop">QWidget.windowIcon</a>() and
570
<a href="qapplication.html#activeWindow">QApplication.activeWindow</a>().</p>
573
<h3 class="fn"><a name="aboutQt" />QMessageBox.aboutQt (<a href="qwidget.html">QWidget</a>, QString <i>title</i> = QString())</h3><p>Displays a simple message box about Qt, with the given
574
<i>title</i> and centered over <i>parent</i> (if <i>parent</i> is
575
not 0). The message includes the version number of Qt being used by
577
<p>This is useful for inclusion in the <b>Help</b> menu of an
578
application, as shown in the <a href="mainwindows-menus.html">Menus</a> example.</p>
579
<p><a href="qapplication.html">QApplication</a> provides this
580
functionality as a slot.</p>
581
<p>On Mac OS X, the about box is popped up as a modeless window; on
582
other platforms, it is currently window modal.</p>
215
583
<p>See also <a href="qapplication.html#aboutQt">QApplication.aboutQt</a>().</p>
216
<a name="//apple_ref/cpp/instm/QMessageBox/addButton" />
217
<h3 class="fn"><a name="addButton" />QMessageBox.addButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>, <a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a>)</h3><p>The <i>QAbstractButton</i> argument has it's ownership transferred to Qt.</p><p>Adds the given <i>button</i> to the message box with the specified <i>role</i>.</p>
586
<h3 class="fn"><a name="addButton" />QMessageBox.addButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>, <a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a>)</h3><p>The <i>QAbstractButton</i> argument has it's ownership transferred to Qt.</p><p>Adds the given <i>button</i> to the message box with the
587
specified <i>role</i>.</p>
218
588
<p>This function was introduced in Qt 4.2.</p>
219
589
<p>See also <a href="qmessagebox.html#removeButton">removeButton</a>(), <a href="qmessagebox.html#button">button</a>(), and <a href="qmessagebox.html#standardButtons-prop">setStandardButtons</a>().</p>
220
592
<h3 class="fn"><a name="addButton-2" /><a href="qpushbutton.html">QPushButton</a> QMessageBox.addButton (<i>self</i>, QString, <a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a>)</h3><p>This is an overloaded function.</p>
221
<p>Creates a button with the given <i>text</i>, adds it to the message box for the specified <i>role</i>, and returns it.</p>
593
<p>Creates a button with the given <i>text</i>, adds it to the
594
message box for the specified <i>role</i>, and returns it.</p>
222
595
<p>This function was introduced in Qt 4.2.</p>
223
598
<h3 class="fn"><a name="addButton-3" /><a href="qpushbutton.html">QPushButton</a> QMessageBox.addButton (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>This is an overloaded function.</p>
224
<p>Adds a standard <i>button</i> to the message box if it is valid to do so, and returns the push button.</p>
599
<p>Adds a standard <i>button</i> to the message box if it is valid
600
to do so, and returns the push button.</p>
225
601
<p>This function was introduced in Qt 4.2.</p>
226
602
<p>See also <a href="qmessagebox.html#standardButtons-prop">setStandardButtons</a>().</p>
227
<a name="//apple_ref/cpp/instm/QMessageBox/button" />
228
<h3 class="fn"><a name="button" /><a href="qabstractbutton.html">QAbstractButton</a> QMessageBox.button (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>Returns a pointer corresponding to the standard button <i>which</i>, or 0 if the standard button doesn't exist in this message box.</p>
605
<h3 class="fn"><a name="button" /><a href="qabstractbutton.html">QAbstractButton</a> QMessageBox.button (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>Returns a pointer corresponding to the standard button
606
<i>which</i>, or 0 if the standard button doesn't exist in this
229
608
<p>This function was introduced in Qt 4.2.</p>
230
<p>See also <a href="qmessagebox.html#standardButtons-prop">standardButtons</a> and <a href="qmessagebox.html#standardButton">standardButton</a>().</p>
231
<a name="//apple_ref/cpp/instm/QMessageBox/buttonClicked" />
232
<h3 class="fn"><a name="buttonRole" /><a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a> QMessageBox.buttonRole (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Returns the button role for the specified <i>button</i>. This function returns <a href="qmessagebox.html#ButtonRole-enum">InvalidRole</a> if <i>button</i> is 0 or has not been added to the message box.</p>
233
<p>This function was introduced in Qt 4.5.</p>
234
<p>See also <a href="qmessagebox.html#buttons">buttons</a>() and <a href="qmessagebox.html#addButton">addButton</a>().</p>
235
<a name="//apple_ref/cpp/instm/QMessageBox/buttons" />
236
<h3 class="fn"><a name="buttons" />list-of-QAbstractButton QMessageBox.buttons (<i>self</i>)</h3><p>Returns a list of all the buttons that have been added to the message box.</p>
237
<p>This function was introduced in Qt 4.5.</p>
238
<p>See also <a href="qmessagebox.html#buttonRole">buttonRole</a>(), <a href="qmessagebox.html#addButton">addButton</a>(), and <a href="qmessagebox.html#removeButton">removeButton</a>().</p>
239
<a name="//apple_ref/cpp/instm/QMessageBox/changeEvent" />
609
<p>See also <a href="qmessagebox.html#standardButtons-prop">standardButtons</a> and
610
<a href="qmessagebox.html#standardButton">standardButton</a>().</p>
613
<h3 class="fn"><a name="buttonRole" /><a href="qmessagebox.html#ButtonRole-enum">ButtonRole</a> QMessageBox.buttonRole (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Returns the button role for the specified <i>button</i>. This
614
function returns <a href="qmessagebox.html#ButtonRole-enum">InvalidRole</a> if <i>button</i>
615
is 0 or has not been added to the message box.</p>
616
<p>This function was introduced in Qt 4.5.</p>
617
<p>See also <a href="qmessagebox.html#buttons">buttons</a>() and
618
<a href="qmessagebox.html#addButton">addButton</a>().</p>
621
<h3 class="fn"><a name="buttons" />list-of-QAbstractButton QMessageBox.buttons (<i>self</i>)</h3><p>Returns a list of all the buttons that have been added to the
623
<p>This function was introduced in Qt 4.5.</p>
624
<p>See also <a href="qmessagebox.html#buttonRole">buttonRole</a>(),
625
<a href="qmessagebox.html#addButton">addButton</a>(), and <a href="qmessagebox.html#removeButton">removeButton</a>().</p>
240
628
<h3 class="fn"><a name="buttonText" />QString QMessageBox.buttonText (<i>self</i>, int)</h3><h3 class="fn"><a name="changeEvent" />QMessageBox.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>
241
<a name="//apple_ref/cpp/instm/QMessageBox/clickedButton" />
242
<h3 class="fn"><a name="clickedButton" /><a href="qabstractbutton.html">QAbstractButton</a> QMessageBox.clickedButton (<i>self</i>)</h3><p>Returns the button that was clicked by the user, or 0 if the user hit the <b>Esc</b> key and no <a href="qmessagebox.html#setEscapeButton">escape button</a> was set.</p>
243
<p>If <a href="qmessagebox.html#exec">exec_</a>() hasn't been called yet, returns 0.</p>
631
<h3 class="fn"><a name="clickedButton" /><a href="qabstractbutton.html">QAbstractButton</a> QMessageBox.clickedButton (<i>self</i>)</h3><p>Returns the button that was clicked by the user, or 0 if the
632
user hit the <b>Esc</b> key and no <a href="qmessagebox.html#setEscapeButton">escape button</a> was set.</p>
633
<p>If <a href="qmessagebox.html#exec">exec_</a>() hasn't been called
245
<pre> QMessageBox messageBox(this);
636
<pre class="highlightedCode brush: cpp">
637
QMessageBox messageBox(this);
246
638
QAbstractButton *disconnectButton =
247
639
messageBox.addButton(tr("Disconnect"), QMessageBox.ActionRole);
249
641
messageBox.exec();
250
642
if (messageBox.clickedButton() == disconnectButton) {
253
646
<p>This function was introduced in Qt 4.2.</p>
254
647
<p>See also <a href="qmessagebox.html#standardButton">standardButton</a>() and <a href="qmessagebox.html#button">button</a>().</p>
255
<a name="//apple_ref/cpp/instm/QMessageBox/closeEvent" />
256
650
<h3 class="fn"><a name="closeEvent" />QMessageBox.closeEvent (<i>self</i>, <a href="qcloseevent.html">QCloseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#closeEvent">QWidget.closeEvent</a>().</p>
257
<a name="//apple_ref/cpp/clm/QMessageBox/critical" />
258
<h3 class="fn"><a name="critical" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.critical (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens a critical message box with the specified <i>title</i> and <i>text</i>. The standard <i>buttons</i> are added to the message box. <i>defaultButton</i> specifies the button used when <b>Enter</b> is pressed. <i>defaultButton</i> must refer to a button that was given in <i>buttons</i>. If <i>defaultButton</i> is <a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>, <a href="qmessagebox.html">QMessageBox</a> chooses a suitable default automatically.</p>
259
<p>Returns the identity of the standard button that was clicked. If <b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is returned.</p>
260
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If <i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to <i>parent</i>.</p>
261
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the <a href="qmessagebox.html">QMessageBox</a> constructors.</p>
262
<p>This function was introduced in Qt 4.2.</p>
263
<p>See also <a href="qmessagebox.html#question">question</a>(), <a href="qmessagebox.html#warning">warning</a>(), and <a href="qmessagebox.html#information">information</a>().</p>
264
<a name="//apple_ref/cpp/instm/QMessageBox/defaultButton" />
265
<h3 class="fn"><a name="critical-2" />int QMessageBox.critical (<a href="qwidget.html">QWidget</a>, QString, QString, int, int, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="critical-3" />int QMessageBox.critical (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><h3 class="fn"><a name="defaultButton" /><a href="qpushbutton.html">QPushButton</a> QMessageBox.defaultButton (<i>self</i>)</h3><p>Returns the button that should be the message box's <a href="qpushbutton.html#default-prop">default button</a>. Returns 0 if no default button was set.</p>
266
<p>This function was introduced in Qt 4.2.</p>
267
<p>See also <a href="qmessagebox.html#setDefaultButton">setDefaultButton</a>(), <a href="qmessagebox.html#addButton">addButton</a>(), and <a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>().</p>
268
<a name="//apple_ref/cpp/instm/QMessageBox/escapeButton" />
653
<h3 class="fn"><a name="critical" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.critical (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens a critical message box with the specified <i>title</i> and
654
<i>text</i>. The standard <i>buttons</i> are added to the message
655
box. <i>defaultButton</i> specifies the button used when
656
<b>Enter</b> is pressed. <i>defaultButton</i> must refer to a
657
button that was given in <i>buttons</i>. If <i>defaultButton</i> is
658
<a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>,
659
<a href="qmessagebox.html">QMessageBox</a> chooses a suitable
660
default automatically.</p>
661
<p>Returns the identity of the standard button that was clicked. If
662
<b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is
664
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If
665
<i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to
667
<p><b>Warning:</b> Do not delete <i>parent</i> during the execution
668
of the dialog. If you want to do this, you should create the dialog
669
yourself using one of the <a href="qmessagebox.html">QMessageBox</a> constructors.</p>
670
<p>This function was introduced in Qt 4.2.</p>
671
<p>See also <a href="qmessagebox.html#question">question</a>(),
672
<a href="qmessagebox.html#warning">warning</a>(), and <a href="qmessagebox.html#information">information</a>().</p>
675
<h3 class="fn"><a name="critical-2" />int QMessageBox.critical (<a href="qwidget.html">QWidget</a>, QString, QString, int, int, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="critical-3" />int QMessageBox.critical (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><h3 class="fn"><a name="defaultButton" /><a href="qpushbutton.html">QPushButton</a> QMessageBox.defaultButton (<i>self</i>)</h3><p>Returns the button that should be the message box's <a href="qpushbutton.html#default-prop">default button</a>. Returns 0 if no
676
default button was set.</p>
677
<p>This function was introduced in Qt 4.2.</p>
678
<p>See also <a href="qmessagebox.html#setDefaultButton">setDefaultButton</a>(),
679
<a href="qmessagebox.html#addButton">addButton</a>(), and <a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>().</p>
269
682
<h3 class="fn"><a name="detailedText" />QString QMessageBox.detailedText (<i>self</i>)</h3><h3 class="fn"><a name="escapeButton" /><a href="qabstractbutton.html">QAbstractButton</a> QMessageBox.escapeButton (<i>self</i>)</h3><p>Returns the button that is activated when escape is pressed.</p>
270
<p>By default, <a href="qmessagebox.html">QMessageBox</a> attempts to automatically detect an escape button as follows:</p>
683
<p>By default, <a href="qmessagebox.html">QMessageBox</a> attempts
684
to automatically detect an escape button as follows:</p>
272
686
<li>If there is only one button, it is made the escape button.</li>
273
<li>If there is a <a href="qmessagebox.html#StandardButton-enum">Cancel</a> button, it is made the escape button.</li>
274
<li>On Mac OS X only, if there is exactly one button with the role <a href="qmessagebox.html#ButtonRole-enum">QMessageBox.RejectRole</a>, it is made the escape button.</li>
687
<li>If there is a <a href="qmessagebox.html#StandardButton-enum">Cancel</a> button, it is
688
made the escape button.</li>
689
<li>On Mac OS X only, if there is exactly one button with the role
690
<a href="qmessagebox.html#ButtonRole-enum">QMessageBox.RejectRole</a>, it
691
is made the escape button.</li>
276
<p>When an escape button could not be automatically detected, pressing <b>Esc</b> has no effect.</p>
693
<p>When an escape button could not be automatically detected,
694
pressing <b>Esc</b> has no effect.</p>
277
695
<p>This function was introduced in Qt 4.2.</p>
278
<p>See also <a href="qmessagebox.html#setEscapeButton">setEscapeButton</a>() and <a href="qmessagebox.html#addButton">addButton</a>().</p>
279
<a name="//apple_ref/cpp/instm/QMessageBox/event" />
696
<p>See also <a href="qmessagebox.html#setEscapeButton">setEscapeButton</a>() and
697
<a href="qmessagebox.html#addButton">addButton</a>().</p>
280
700
<h3 class="fn"><a name="event" />bool QMessageBox.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
281
<a name="//apple_ref/cpp/instm/QMessageBox/exec" />
282
<h3 class="fn"><a name="icon" /><a href="qmessagebox.html#Icon-enum">Icon</a> QMessageBox.icon (<i>self</i>)</h3><h3 class="fn"><a name="iconPixmap" /><a href="qpixmap.html">QPixmap</a> QMessageBox.iconPixmap (<i>self</i>)</h3><h3 class="fn"><a name="information" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.information (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens an information message box with the specified <i>title</i> and <i>text</i>. The standard <i>buttons</i> are added to the message box. <i>defaultButton</i> specifies the button used when <b>Enter</b> is pressed. <i>defaultButton</i> must refer to a button that was given in <i>buttons</i>. If <i>defaultButton</i> is <a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>, <a href="qmessagebox.html">QMessageBox</a> chooses a suitable default automatically.</p>
283
<p>Returns the identity of the standard button that was clicked. If <b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is returned.</p>
284
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If <i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to <i>parent</i>.</p>
703
<h3 class="fn"><a name="icon" /><a href="qmessagebox.html#Icon-enum">Icon</a> QMessageBox.icon (<i>self</i>)</h3><h3 class="fn"><a name="iconPixmap" /><a href="qpixmap.html">QPixmap</a> QMessageBox.iconPixmap (<i>self</i>)</h3><h3 class="fn"><a name="information" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.information (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens an information message box with the specified <i>title</i>
704
and <i>text</i>. The standard <i>buttons</i> are added to the
705
message box. <i>defaultButton</i> specifies the button used when
706
<b>Enter</b> is pressed. <i>defaultButton</i> must refer to a
707
button that was given in <i>buttons</i>. If <i>defaultButton</i> is
708
<a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>,
709
<a href="qmessagebox.html">QMessageBox</a> chooses a suitable
710
default automatically.</p>
711
<p>Returns the identity of the standard button that was clicked. If
712
<b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is
714
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If
715
<i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to
285
717
<p>This function was introduced in Qt 4.2.</p>
286
<p>See also <a href="qmessagebox.html#question">question</a>(), <a href="qmessagebox.html#warning">warning</a>(), and <a href="qmessagebox.html#critical">critical</a>().</p>
287
<a name="//apple_ref/cpp/instm/QMessageBox/keyPressEvent" />
718
<p>See also <a href="qmessagebox.html#question">question</a>(),
719
<a href="qmessagebox.html#warning">warning</a>(), and <a href="qmessagebox.html#critical">critical</a>().</p>
288
722
<h3 class="fn"><a name="information-2" />int QMessageBox.information (<a href="qwidget.html">QWidget</a>, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="information-3" />int QMessageBox.information (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><h3 class="fn"><a name="informativeText" />QString QMessageBox.informativeText (<i>self</i>)</h3><h3 class="fn"><a name="keyPressEvent" />QMessageBox.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget.keyPressEvent</a>().</p>
289
<a name="//apple_ref/cpp/instm/QMessageBox/open" />
290
725
<h3 class="fn"><a name="open" />QMessageBox.open (<i>self</i>)</h3><p>This is an overloaded function.</p>
291
<p>Opens the dialog and connects its <a href="qdialog.html#finished">finished</a>() or <a href="qmessagebox.html#buttonClicked">buttonClicked</a>() signal to the slot specified by <i>receiver</i> and <i>member</i>. If the slot in <i>member</i> has a pointer for its first parameter the connection is to <a href="qmessagebox.html#buttonClicked">buttonClicked</a>(), otherwise the connection is to <a href="qdialog.html#finished">finished</a>().</p>
292
<p>The signal will be disconnected from the slot when the dialog is closed.</p>
293
<a name="//apple_ref/cpp/clm/QMessageBox/question" />
294
<h3 class="fn"><a name="open-2" />QMessageBox.open (<i>self</i>, <a href="qobject.html">QObject</a>, SLOT()SLOT())</h3><h3 class="fn"><a name="open-3" />QMessageBox.open (<i>self</i>, callable)</h3><h3 class="fn"><a name="question" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.question (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens a question message box with the specified <i>title</i> and <i>text</i>. The standard <i>buttons</i> are added to the message box. <i>defaultButton</i> specifies the button used when <b>Enter</b> is pressed. <i>defaultButton</i> must refer to a button that was given in <i>buttons</i>. If <i>defaultButton</i> is <a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>, <a href="qmessagebox.html">QMessageBox</a> chooses a suitable default automatically.</p>
295
<p>Returns the identity of the standard button that was clicked. If <b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is returned.</p>
296
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If <i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to <i>parent</i>.</p>
726
<p>Opens the dialog and connects its <a href="qdialog.html#finished">finished</a>() or <a href="qmessagebox.html#buttonClicked">buttonClicked</a>() signal to the
727
slot specified by <i>receiver</i> and <i>member</i>. If the slot in
728
<i>member</i> has a pointer for its first parameter the connection
729
is to <a href="qmessagebox.html#buttonClicked">buttonClicked</a>(),
730
otherwise the connection is to <a href="qdialog.html#finished">finished</a>().</p>
731
<p>The signal will be disconnected from the slot when the dialog is
735
<h3 class="fn"><a name="open-2" />QMessageBox.open (<i>self</i>, <a href="qobject.html">QObject</a>, SLOT()SLOT())</h3><h3 class="fn"><a name="open-3" />QMessageBox.open (<i>self</i>, callable)</h3><h3 class="fn"><a name="question" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.question (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens a question message box with the specified <i>title</i> and
736
<i>text</i>. The standard <i>buttons</i> are added to the message
737
box. <i>defaultButton</i> specifies the button used when
738
<b>Enter</b> is pressed. <i>defaultButton</i> must refer to a
739
button that was given in <i>buttons</i>. If <i>defaultButton</i> is
740
<a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>,
741
<a href="qmessagebox.html">QMessageBox</a> chooses a suitable
742
default automatically.</p>
743
<p>Returns the identity of the standard button that was clicked. If
744
<b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is
746
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If
747
<i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to
297
749
<p>This function was introduced in Qt 4.2.</p>
298
750
<p>See also <a href="qmessagebox.html#information">information</a>(), <a href="qmessagebox.html#warning">warning</a>(), and <a href="qmessagebox.html#critical">critical</a>().</p>
299
<a name="//apple_ref/cpp/instm/QMessageBox/removeButton" />
300
<h3 class="fn"><a name="question-2" />int QMessageBox.question (<a href="qwidget.html">QWidget</a>, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="question-3" />int QMessageBox.question (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><h3 class="fn"><a name="removeButton" />QMessageBox.removeButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>The <i>QAbstractButton</i> argument</p><p>Removes <i>button</i> from the button box without deleting it.</p>
753
<h3 class="fn"><a name="question-2" />int QMessageBox.question (<a href="qwidget.html">QWidget</a>, QString, QString, int, int <i>button1</i> = 0, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="question-3" />int QMessageBox.question (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><h3 class="fn"><a name="removeButton" />QMessageBox.removeButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>The <i>QAbstractButton</i> argument</p><p>Removes <i>button</i> from the button box without deleting
301
755
<p>This function was introduced in Qt 4.2.</p>
302
<p>See also <a href="qmessagebox.html#addButton">addButton</a>() and <a href="qmessagebox.html#standardButtons-prop">setStandardButtons</a>().</p>
303
<a name="//apple_ref/cpp/instm/QMessageBox/resizeEvent" />
756
<p>See also <a href="qmessagebox.html#addButton">addButton</a>()
757
and <a href="qmessagebox.html#standardButtons-prop">setStandardButtons</a>().</p>
304
760
<h3 class="fn"><a name="resizeEvent" />QMessageBox.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>
305
<a name="//apple_ref/cpp/instm/QMessageBox/setDefaultButton" />
306
<h3 class="fn"><a name="setButtonText" />QMessageBox.setButtonText (<i>self</i>, int, QString)</h3><h3 class="fn"><a name="setDefaultButton" />QMessageBox.setDefaultButton (<i>self</i>, <a href="qpushbutton.html">QPushButton</a>)</h3><p>Sets the message box's <a href="qpushbutton.html#default-prop">default button</a> to <i>button</i>.</p>
763
<h3 class="fn"><a name="setButtonText" />QMessageBox.setButtonText (<i>self</i>, int, QString)</h3><h3 class="fn"><a name="setDefaultButton" />QMessageBox.setDefaultButton (<i>self</i>, <a href="qpushbutton.html">QPushButton</a>)</h3><p>Sets the message box's <a href="qpushbutton.html#default-prop">default button</a> to
307
765
<p>This function was introduced in Qt 4.2.</p>
308
766
<p>See also <a href="qmessagebox.html#defaultButton">defaultButton</a>(), <a href="qmessagebox.html#addButton">addButton</a>(), and <a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>().</p>
309
<h3 class="fn"><a name="setDefaultButton-2" />QMessageBox.setDefaultButton (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>Sets the message box's <a href="qpushbutton.html#default-prop">default button</a> to <i>button</i>.</p>
769
<h3 class="fn"><a name="setDefaultButton-2" />QMessageBox.setDefaultButton (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>Sets the message box's <a href="qpushbutton.html#default-prop">default button</a> to
310
771
<p>This function was introduced in Qt 4.3.</p>
311
<p>See also <a href="qmessagebox.html#addButton">addButton</a>() and <a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>().</p>
312
<a name="//apple_ref/cpp/instm/QMessageBox/setEscapeButton" />
313
<h3 class="fn"><a name="setDetailedText" />QMessageBox.setDetailedText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setEscapeButton" />QMessageBox.setEscapeButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Sets the button that gets activated when the <b>Escape</b> key is pressed to <i>button</i>.</p>
772
<p>See also <a href="qmessagebox.html#addButton">addButton</a>()
773
and <a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>().</p>
776
<h3 class="fn"><a name="setDetailedText" />QMessageBox.setDetailedText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setEscapeButton" />QMessageBox.setEscapeButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Sets the button that gets activated when the <b>Escape</b> key
777
is pressed to <i>button</i>.</p>
314
778
<p>This function was introduced in Qt 4.2.</p>
315
779
<p>See also <a href="qmessagebox.html#escapeButton">escapeButton</a>(), <a href="qmessagebox.html#addButton">addButton</a>(), and <a href="qmessagebox.html#clickedButton">clickedButton</a>().</p>
316
<h3 class="fn"><a name="setEscapeButton-2" />QMessageBox.setEscapeButton (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>Sets the buttons that gets activated when the <b>Escape</b> key is pressed to <i>button</i>.</p>
782
<h3 class="fn"><a name="setEscapeButton-2" />QMessageBox.setEscapeButton (<i>self</i>, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a>)</h3><p>Sets the buttons that gets activated when the <b>Escape</b> key
783
is pressed to <i>button</i>.</p>
317
784
<p>This function was introduced in Qt 4.3.</p>
318
<p>See also <a href="qmessagebox.html#addButton">addButton</a>() and <a href="qmessagebox.html#clickedButton">clickedButton</a>().</p>
319
<a name="//apple_ref/cpp/instm/QMessageBox/setVisible" />
785
<p>See also <a href="qmessagebox.html#addButton">addButton</a>()
786
and <a href="qmessagebox.html#clickedButton">clickedButton</a>().</p>
320
789
<h3 class="fn"><a name="setIcon" />QMessageBox.setIcon (<i>self</i>, <a href="qmessagebox.html#Icon-enum">Icon</a>)</h3><h3 class="fn"><a name="setIconPixmap" />QMessageBox.setIconPixmap (<i>self</i>, <a href="qpixmap.html">QPixmap</a>)</h3><h3 class="fn"><a name="setInformativeText" />QMessageBox.setInformativeText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setStandardButtons" />QMessageBox.setStandardButtons (<i>self</i>, <a href="qmessagebox-standardbuttons.html">StandardButtons</a>)</h3><h3 class="fn"><a name="setText" />QMessageBox.setText (<i>self</i>, QString)</h3><h3 class="fn"><a name="setTextFormat" />QMessageBox.setTextFormat (<i>self</i>, <a href="qt.html#TextFormat-enum">Qt.TextFormat</a>)</h3><h3 class="fn"><a name="setWindowModality" />QMessageBox.setWindowModality (<i>self</i>, <a href="qt.html#WindowModality-enum">Qt.WindowModality</a>)</h3><p>This function shadows <a href="qwidget.html#windowModality-prop">QWidget.setWindowModality</a>().</p>
321
<p>Sets the modality of the message box to <i>windowModality</i>.</p>
322
<p>On Mac OS X, if the modality is set to <a href="qt.html#WindowModality-enum">Qt.WindowModal</a> and the message box has a parent, then the message box will be a <a href="qt.html#WindowType-enum">Qt.Sheet</a>, otherwise the message box will be a standard dialog.</p>
790
<p>Sets the modality of the message box to
791
<i>windowModality</i>.</p>
792
<p>On Mac OS X, if the modality is set to <a href="qt.html#WindowModality-enum">Qt.WindowModal</a> and the message
793
box has a parent, then the message box will be a <a href="qt.html#WindowType-enum">Qt.Sheet</a>, otherwise the message box
794
will be a standard dialog.</p>
323
795
<p>This function was introduced in Qt 4.2.</p>
324
<a name="//apple_ref/cpp/instm/QMessageBox/setWindowTitle" />
325
798
<h3 class="fn"><a name="setWindowTitle" />QMessageBox.setWindowTitle (<i>self</i>, QString)</h3><p>This function shadows <a href="qwidget.html#windowTitle-prop">QWidget.setWindowTitle</a>().</p>
326
<p>Sets the title of the message box to <i>title</i>. On Mac OS X, the window title is ignored (as required by the Mac OS X Guidelines).</p>
799
<p>Sets the title of the message box to <i>title</i>. On Mac OS X,
800
the window title is ignored (as required by the Mac OS X
327
802
<p>This function was introduced in Qt 4.2.</p>
328
<a name="//apple_ref/cpp/instm/QMessageBox/showEvent" />
329
805
<h3 class="fn"><a name="showEvent" />QMessageBox.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#showEvent">QWidget.showEvent</a>().</p>
330
<a name="//apple_ref/cpp/instm/QMessageBox/standardButton" />
331
<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QMessageBox.sizeHint (<i>self</i>)</h3><h3 class="fn"><a name="standardButton" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.standardButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Returns the standard button enum value corresponding to the given <i>button</i>, or <a href="qmessagebox.html#StandardButton-enum">NoButton</a> if the given <i>button</i> isn't a standard button.</p>
332
<p>This function was introduced in Qt 4.2.</p>
333
<p>See also <a href="qmessagebox.html#button">button</a>() and <a href="qmessagebox.html#standardButtons-prop">standardButtons</a>().</p>
334
<a name="//apple_ref/cpp/clm/QMessageBox/warning" />
335
<h3 class="fn"><a name="standardButtons" /><a href="qmessagebox-standardbuttons.html">StandardButtons</a> QMessageBox.standardButtons (<i>self</i>)</h3><h3 class="fn"><a name="standardIcon" /><a href="qpixmap.html">QPixmap</a> QMessageBox.standardIcon (<a href="qmessagebox.html#Icon-enum">Icon</a>)</h3><h3 class="fn"><a name="text" />QString QMessageBox.text (<i>self</i>)</h3><h3 class="fn"><a name="textFormat" /><a href="qt.html#TextFormat-enum">Qt.TextFormat</a> QMessageBox.textFormat (<i>self</i>)</h3><h3 class="fn"><a name="warning" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.warning (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens a warning message box with the specified <i>title</i> and <i>text</i>. The standard <i>buttons</i> are added to the message box. <i>defaultButton</i> specifies the button used when <b>Enter</b> is pressed. <i>defaultButton</i> must refer to a button that was given in <i>buttons</i>. If <i>defaultButton</i> is <a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>, <a href="qmessagebox.html">QMessageBox</a> chooses a suitable default automatically.</p>
336
<p>Returns the identity of the standard button that was clicked. If <b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is returned.</p>
337
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If <i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to <i>parent</i>.</p>
338
<p>This function was introduced in Qt 4.2.</p>
339
<p>See also <a href="qmessagebox.html#question">question</a>(), <a href="qmessagebox.html#information">information</a>(), and <a href="qmessagebox.html#critical">critical</a>().</p>
340
<p /><h3 class="fn"><a name="warning-2" />int QMessageBox.warning (<a href="qwidget.html">QWidget</a>, QString, QString, int, int, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="warning-3" />int QMessageBox.warning (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="buttonClicked" />void buttonClicked (QAbstractButton *)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever a button is clicked inside the <a href="qmessagebox.html">QMessageBox</a>. The button that was clicked in returned in <i>button</i>.</p>
341
<a name="//apple_ref/cpp/instm/QMessageBox/buttonRole" />
342
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.7 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.3</td></tr></table></div></address></body></html>
b'\\ No newline at end of file'
808
<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QMessageBox.sizeHint (<i>self</i>)</h3><h3 class="fn"><a name="standardButton" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.standardButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>)</h3><p>Returns the standard button enum value corresponding to the
809
given <i>button</i>, or <a href="qmessagebox.html#StandardButton-enum">NoButton</a> if the given
810
<i>button</i> isn't a standard button.</p>
811
<p>This function was introduced in Qt 4.2.</p>
812
<p>See also <a href="qmessagebox.html#button">button</a>() and
813
<a href="qmessagebox.html#standardButtons-prop">standardButtons</a>().</p>
816
<h3 class="fn"><a name="standardButtons" /><a href="qmessagebox-standardbuttons.html">StandardButtons</a> QMessageBox.standardButtons (<i>self</i>)</h3><h3 class="fn"><a name="standardIcon" /><a href="qpixmap.html">QPixmap</a> QMessageBox.standardIcon (<a href="qmessagebox.html#Icon-enum">Icon</a>)</h3><h3 class="fn"><a name="text" />QString QMessageBox.text (<i>self</i>)</h3><h3 class="fn"><a name="textFormat" /><a href="qt.html#TextFormat-enum">Qt.TextFormat</a> QMessageBox.textFormat (<i>self</i>)</h3><h3 class="fn"><a name="warning" /><a href="qmessagebox.html#StandardButton-enum">StandardButton</a> QMessageBox.warning (<a href="qwidget.html">QWidget</a>, QString, QString, <a href="qmessagebox-standardbuttons.html">StandardButtons</a> <i>buttons</i> = QMessageBox.Ok, <a href="qmessagebox.html#StandardButton-enum">StandardButton</a> <i>defaultButton</i> = QMessageBox.NoButton)</h3><p>Opens a warning message box with the specified <i>title</i> and
817
<i>text</i>. The standard <i>buttons</i> are added to the message
818
box. <i>defaultButton</i> specifies the button used when
819
<b>Enter</b> is pressed. <i>defaultButton</i> must refer to a
820
button that was given in <i>buttons</i>. If <i>defaultButton</i> is
821
<a href="qmessagebox.html#StandardButton-enum">QMessageBox.NoButton</a>,
822
<a href="qmessagebox.html">QMessageBox</a> chooses a suitable
823
default automatically.</p>
824
<p>Returns the identity of the standard button that was clicked. If
825
<b>Esc</b> was pressed instead, the <a href="qmessagebox.html#default-and-escape-keys">escape button</a> is
827
<p>If <i>parent</i> is 0, the message box is an <a href="qt.html#WindowModality-enum">application modal</a> dialog box. If
828
<i>parent</i> is a widget, the message box is <a href="qt.html#WindowModality-enum">window modal</a> relative to
830
<p>This function was introduced in Qt 4.2.</p>
831
<p>See also <a href="qmessagebox.html#question">question</a>(),
832
<a href="qmessagebox.html#information">information</a>(), and
833
<a href="qmessagebox.html#critical">critical</a>().</p>
834
<h3 class="fn"><a name="warning-2" />int QMessageBox.warning (<a href="qwidget.html">QWidget</a>, QString, QString, int, int, int <i>button2</i> = 0)</h3><h3 class="fn"><a name="warning-3" />int QMessageBox.warning (<a href="qwidget.html">QWidget</a>, QString, QString, QString, QString <i>button1Text</i> = QString(), QString <i>button2Text</i> = QString(), int <i>defaultButtonNumber</i> = 0, int <i>escapeButtonNumber</i> = -1)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="buttonClicked" />void buttonClicked (QAbstractButton *)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever a button is clicked inside the
835
<a href="qmessagebox.html">QMessageBox</a>. The button that was
836
clicked in returned in <i>button</i>.</p>
839
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.8.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.7.0</td></tr></table></div></address></body></html>
b'\\ No newline at end of file'