Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QAbstractMessageBox Class Reference
[QtBaseModule]

The QAbstractMessageBox class allows developers to replace the message box portion of the Qt Extended server UI. More...

    #include <QAbstractMessageBox>

Inherits QDialog.

Inherited by PhoneMessageBox and SlideInMessageBox.

Public Types

Public Functions

Static Public Members

Additional Inherited Members


Detailed Description

The QAbstractMessageBox class allows developers to replace the message box portion of the Qt Extended server UI.

The abstract message box is part of the server widgets framework and represents the portion of the Qt Extended 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.

This class is part of the Qt Extended server and cannot be used by other Qt Extended applications.


Member Type Documentation

enum QAbstractMessageBox::Button

Represents a standard button that may be displayed on the message box.

ConstantValueDescription
QAbstractMessageBox::NoButton0An empty button. This indicates that no button is required.
QAbstractMessageBox::Ok11An Ok button.
QAbstractMessageBox::Cancel12A cancel button.
QAbstractMessageBox::Yes13A yes button.
QAbstractMessageBox::No14A no button.

enum QAbstractMessageBox::Icon

Represents the icon to show in the message box.

ConstantValueDescription
QAbstractMessageBox::NoIcon0No icon will be shown.
QAbstractMessageBox::Question1A question icon will be shown.
QAbstractMessageBox::Information2An information icon will be shown.
QAbstractMessageBox::Warning3A warning icon will be shown.
QAbstractMessageBox::Critical4A 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. If the icon was set via setIconPixmap() this function returns QAbstractMessageBox::NoIcon.

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::setIconPixmap ( const QPixmap & pixmap )   [pure virtual]

Sets the icon to be used by the message box to pixmap.

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.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3