# QMessageBox Class Reference

### [com.trolltech.qt.gui package]

Inherits QDialog.

### Constructor

- void QMessageBox(Icon icon, String title, String text, StandardButtons buttons, QWidget parent, WindowFlags flags)
- void QMessageBox(QWidget parent)

### Constructor Properties

- prototype: The QMessageBox prototype object
- void about(QWidget parent, String title, String text)
- void aboutQt(QWidget parent, String title)
- StandardButton critical(QWidget parent, String title, String text, StandardButtons buttons, StandardButton defaultButton)
- StandardButton information(QWidget parent, String title, String text, StandardButtons buttons, StandardButton defaultButton)
- StandardButton question(QWidget parent, String title, String text, StandardButtons buttons, StandardButton defaultButton)
- StandardButton warning(QWidget parent, String title, String text, StandardButtons buttons, StandardButton defaultButton)
- InvalidRole = -1
- AcceptRole
- RejectRole
- DestructiveRole
- ActionRole
- HelpRole
- YesRole
- NoRole
- ResetRole
- ApplyRole
- NRoles
- ButtonRole( value )
- NoButton = 0x00000000
- Default = 0x00000100
- Escape = 0x00000200
- FlagMask = 0x00000300
- ButtonMask = ~FlagMask
- Ok = 0x00000400
- Save = 0x00000800
- SaveAll = 0x00001000
- Open = 0x00002000
- Yes = 0x00004000
- YesToAll = 0x00008000
- No = 0x00010000
- NoToAll = 0x00020000
- Abort = 0x00040000
- Retry = 0x00080000
- Ignore = 0x00100000
- Close = 0x00200000
- Cancel = 0x00400000
- Discard = 0x00800000
- Help = 0x01000000
- Apply = 0x02000000
- Reset = 0x04000000
- RestoreDefaults = 0x08000000
- StandardButton( value )
- StandardButtons( value1, value2, ... )
- NoIcon = 0
- Information = 1
- Warning = 2
- Critical = 3
- Question = 4
- Icon( value )

### Prototype Object Properties

The QMessageBox prototype object inherits properties from the QDialog prototype object and also has the following properties.

- void addButton(QAbstractButton button, ButtonRole role)
- QAbstractButton button(StandardButton which)
- ButtonRole buttonRole(QAbstractButton button)
- List buttons()
- QAbstractButton clickedButton()
- QPushButton defaultButton()
- QAbstractButton escapeButton()
- void open(QObject receiver, char member)
- void removeButton(QAbstractButton button)
- void setDefaultButton(StandardButton button)
- void setEscapeButton(QAbstractButton button)
- StandardButton standardButton(QAbstractButton button)

### Instance Properties

QMessageBox objects inherit properties from the QMessageBox prototype object and also have the following properties.

- text
- icon
- iconPixmap
- textFormat
- standardButtons
- detailedText
- informativeText