QAbstractMessageBox Class Reference
The QAbstractMessageBox class allows developers to replace the message box portion of the Qtopia server UI. More...
#include <QAbstractMessageBox>
Inherits QDialog.
Inherited by PhoneMessageBox.
Public Types
- enum Button { NoButton, Ok, Cancel, Yes, No }
- enum Icon { NoIcon, Question, Information, Warning, Critical }
Public Functions
- QAbstractMessageBox ( QWidget * parent = 0, Qt::WFlags flags = 0 )
- virtual Icon icon () const = 0
- virtual void setButtons ( Button button1, Button button2 ) = 0
- virtual void setButtons ( const QString & button0Text, const QString & button1Text, const QString & button2Text, int defaultButtonNumber, int escapeButtonNumber ) = 0
- virtual void setIcon ( Icon icon ) = 0
- virtual void setText ( const QString & text ) = 0
- virtual void setTimeout ( int timeoutMs, Button button )
- virtual void setTitle ( const QString & title ) = 0
- virtual QString text () const = 0
- virtual QString title () const = 0
- 9 public functions inherited from QDialog
- 258 public functions inherited from QWidget
- 37 public functions inherited from QObject
- 20 public functions inherited from QPaintDevice
Static Public Members
- int critical ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton )
- int information ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton )
- QAbstractMessageBox * messageBox ( QWidget * parent, const QString & title, const QString & text, Icon icon, Button button0 = QAbstractMessageBox::Ok, Button button1 = QAbstractMessageBox::NoButton )
- QAbstractMessageBox * messageBoxCustomButton ( QWidget * parent, const QString & title, const QString & text, Icon icon, const QString & button0Text = QString(), const QString & button1Text = QString(), const QString & button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1 )
- int question ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton )
- int warning ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton )
- 5 static public members inherited from QWidget
- 4 static public members inherited from QObject
- 13 static public members inherited from QPaintDevice
Additional Inherited Members
- 2 properties inherited from QDialog
- 55 properties inherited from QWidget
- 1 property inherited from QObject
- 5 public slots inherited from QDialog
- 20 public slots inherited from QWidget
- 1 public slot inherited from QObject
- 3 signals inherited from QDialog
- 1 signal inherited from QWidget
- 1 signal inherited from QObject
- 1 public type inherited from QObject
- 39 protected functions inherited from QWidget
- 8 protected functions inherited from QObject
- 1 protected function inherited from QPaintDevice
- 1 protected slot inherited from QWidget
- 2 protected variables inherited from QObject
- 1 protected type inherited from QPaintDevice
- 1 static protected member inherited from QObject
Detailed Description
The QAbstractMessageBox class allows developers to replace the message box portion of the Qtopia server UI.
The abstract message box is part of the server widgets framework and represents the portion of the Qtopia server UI that is shown to users when a message box is needed.
A small tutorial on how to develop new server widgets using one of the abstract widgets as base can be found in QAbstractServerInterface class documentation.
The QAbstractMessageBox API is intentionally designed to be similar to the QMessageBox API to facilitate easily replacing one with the other.
Member Type Documentation
enum QAbstractMessageBox::Button
Represents a standard button that may be displayed on the message box.
| Constant | Value | Description |
| QAbstractMessageBox::NoButton | 0 | An empty button. This indicates that no button is required. |
| QAbstractMessageBox::Ok | 11 | An Ok button. |
| QAbstractMessageBox::Cancel | 12 | A cancel button. |
| QAbstractMessageBox::Yes | 13 | A yes button. |
| QAbstractMessageBox::No | 14 | A no button. |
enum QAbstractMessageBox::Icon
Represents the icon to show in the message box.
| Constant | Value | Description |
| QAbstractMessageBox::NoIcon | 0 | No icon will be shown. |
| QAbstractMessageBox::Question | 1 | A question icon will be shown. |
| QAbstractMessageBox::Information | 2 | An information icon will be shown. |
| QAbstractMessageBox::Warning | 3 | A warning icon will be shown. |
| QAbstractMessageBox::Critical | 4 | A critical condition icon will be shown. |
Member Function Documentation
QAbstractMessageBox::QAbstractMessageBox ( QWidget * parent = 0, Qt::WFlags flags = 0 )
Constructs a new QAbstractMessageBox instance, with the specified parent and widget flags.
int QAbstractMessageBox::critical ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton ) [static]
Opens a critical message box with the title and text. The standard buttons button1 and button2 are added to the message box.
Returns the identity of the standard button that was activated.
If parent is 0, the message box becomes an application-global message box. If parent is a widget, the message box becomes modal relative to parent.
Icon QAbstractMessageBox::icon () const [pure virtual]
Returns the message box icon.
See also setIcon().
int QAbstractMessageBox::information ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton ) [static]
Opens an informational message box with the title and text. The standard buttons button1 and button2 are added to the message box.
Returns the identity of the standard button that was activated.
If parent is 0, the message box becomes an application-global message box. If parent is a widget, the message box becomes modal relative to parent.
QAbstractMessageBox * QAbstractMessageBox::messageBox ( QWidget * parent, const QString & title, const QString & text, Icon icon, Button button0 = QAbstractMessageBox::Ok, Button button1 = QAbstractMessageBox::NoButton ) [static]
Returns a new message box instance with the specified parent, title, text, icon and standard buttons button0 and button1.
QAbstractMessageBox * QAbstractMessageBox::messageBoxCustomButton ( QWidget * parent, const QString & title, const QString & text, Icon icon, const QString & button0Text = QString(), const QString & button1Text = QString(), const QString & button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1 ) [static]
Returns a new custom message box instance with the specified parent, title, text and icon.
Up to three custom buttons may be specified with button0Text, button1Text and button2Text which are mapped to keys in a system specific way. The exec() return value for each of these buttons will be 0, 1 or 2 repspectively.
The defaultButtonNumber id is returned from exec if the dialog is simply "accepted" - usually by pressing the select key. Likewise the escapeButtonNumber is returned if the dialog is dismissed.
int QAbstractMessageBox::question ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton ) [static]
Opens a question message box with the title and text. The standard buttons button1 and button2 are added to the message box.
Returns the identity of the standard button that was activated.
If parent is 0, the message box becomes an application-global message box. If parent is a widget, the message box becomes modal relative to parent.
void QAbstractMessageBox::setButtons ( Button button1, Button button2 ) [pure virtual]
Sets the buttons on the message box to the standard buttons button1 and button2.
void QAbstractMessageBox::setButtons ( const QString & button0Text, const QString & button1Text, const QString & button2Text, int defaultButtonNumber, int escapeButtonNumber ) [pure virtual]
This is an overloaded member function, provided for convenience.
Sets the buttons on the message box to custom buttons.
Up to three custom buttons may be specified with button0Text, button1Text and button2Text which are mapped to keys in a system specific way. The exec() return value for each of these buttons will be 0, 1 or 2 repspectively.
The defaultButtonNumber id is returned from exec if the dialog is simply "accepted" - usually by pressing the select key. Likewise the escapeButtonNumber is returned if the dialog is dismissed.
void QAbstractMessageBox::setIcon ( Icon icon ) [pure virtual]
Sets the message box icon.
See also icon().
void QAbstractMessageBox::setText ( const QString & text ) [pure virtual]
Sets the message box text.
See also text().
void QAbstractMessageBox::setTimeout ( int timeoutMs, Button button ) [virtual]
Set an auto timeout value of timeoutMs milliseconds. The dialog will be automatically accepted as though the user pressed the button key after this time.
void QAbstractMessageBox::setTitle ( const QString & title ) [pure virtual]
Sets the title text of the message box.
See also title().
QString QAbstractMessageBox::text () const [pure virtual]
Returns the message box text.
See also setText().
QString QAbstractMessageBox::title () const [pure virtual]
Returns the title text of the message box.
See also setTitle().
int QAbstractMessageBox::warning ( QWidget * parent, const QString & title, const QString & text, Button button1 = NoButton, Button button2 = NoButton ) [static]
Opens a warning message box with the title and text. The standard buttons button1 and button2 are added to the message box.
Returns the identity of the standard button that was activated.
If parent is 0, the message box becomes an application-global message box. If parent is a widget, the message box becomes modal relative to parent.