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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QErrorMessage Class

The QErrorMessage class provides an error message display dialog. More...

 #include <QErrorMessage>

Inherits: QDialog.

Public Types

enum PaintDeviceMetric { PdmWidth, PdmHeight, PdmWidthMM, PdmHeightMM, ..., PdmPhysicalDpiY }

Public Functions

QErrorMessage(QWidget * parent = 0)
~QErrorMessage()
virtual ~QPaintDevice()
int colorCount() const
int depth() const
int height() const
int heightMM() const
int logicalDpiX() const
int logicalDpiY() const
virtual QPaintEngine * paintEngine() const = 0
bool paintingActive() const
int physicalDpiX() const
int physicalDpiY() const
int width() const
int widthMM() const
  • 8 public functions inherited from QDialog
  • 215 public functions inherited from QWidget
  • 31 public functions inherited from QObject

Public Slots

void showMessage(const QString & message)
void showMessage(const QString & message, const QString & type)
  • 5 public slots inherited from QDialog
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject

Static Public Members

QErrorMessage * qtHandler()
  • 4 static public members inherited from QWidget
  • 11 static public members inherited from QObject

Protected Functions

QPaintDevice()
virtual void init(QPainter * painter) const
virtual int metric(PaintDeviceMetric metric) const
virtual QPaintDevice * redirected(QPoint * offset) const
virtual QPainter * sharedPainter() const

Reimplemented Protected Functions

virtual void changeEvent(QEvent * e)
virtual void done(int a)
  • 7 protected functions inherited from QDialog
  • 37 protected functions inherited from QWidget
  • 9 protected functions inherited from QObject

Additional Inherited Members

Detailed Description

The QErrorMessage class provides an error message display dialog.

An error message widget consists of a text label and a checkbox. The checkbox lets the user control whether the same error message will be displayed again in the future, typically displaying the text, "Show this message again" translated into the appropriate local language.

For production applications, the class can be used to display messages which the user only needs to see once. To use QErrorMessage like this, you create the dialog in the usual way, and show it by calling the showMessage() slot or connecting signals to it.

The static qtHandler() function installs a message handler using qInstallMsgHandler() and creates a QErrorMessage that displays qDebug(), qWarning() and qFatal() messages. This is most useful in environments where no console is available to display warnings and error messages.

In both cases QErrorMessage will queue pending messages and display them in order, with each new message being shown as soon as the user has accepted the previous message. Once the user has specified that a message is not to be shown again it is automatically skipped, and the dialog will show the next appropriate message in the queue.

The Standard Dialogs example shows how to use QErrorMessage as well as other built-in Qt dialogs.

See also QMessageBox, QStatusBar::showMessage(), and Standard Dialogs Example.

Member Function Documentation

QErrorMessage::QErrorMessage(QWidget * parent = 0)

Constructs and installs an error handler window with the given parent.

QErrorMessage::~QErrorMessage()

Destroys the error message dialog.

void QErrorMessage::changeEvent(QEvent * e) [virtual protected]

Reimplemented from QWidget::changeEvent().

void QErrorMessage::done(int a) [virtual protected]

Reimplemented from QDialog::done().

QErrorMessage * QErrorMessage::qtHandler() [static]

Returns a pointer to a QErrorMessage object that outputs the default Qt messages. This function creates such an object, if there isn't one already.

void QErrorMessage::showMessage(const QString & message) [slot]

Shows the given message, message, and returns immediately. If the user has requested for the message not to be shown again, this function does nothing.

Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.

void QErrorMessage::showMessage(const QString & message, const QString & type) [slot]

This is an overloaded function.

Shows the given message, message, and returns immediately. If the user has requested for messages of type, type, not to be shown again, this function does nothing.

Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.

This function was introduced in Qt 4.5.

See also showMessage().

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 5.0-snapshot
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