Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

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

  • 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 setIconPixmap ( const QPixmap & pixmap ) = 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
  • 5 public functions inherited from QDialog
  • 206 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 14 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 )
  • 4 static public members inherited from QWidget
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 2 properties inherited from QDialog
  • 57 properties inherited from QWidget
  • 1 property inherited from QObject
  • 4 public slots inherited from QDialog
  • 19 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
  • 38 protected functions inherited from QWidget
  • 7 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

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.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web