Classes - Annotated - Tree - Functions - Home - Structure

QErrorMessage Class Reference

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

#include <qerrormessage.h>

Inherits QDialog.

List of all member functions.

Public Members

Public Slots

Static Public Members

Protected Members


Detailed Description

The QErrorMessage class provides an error message display dialog.

This is basically a QLabel and a "show this message again" checkbox and a memory of what not to show.

There are two ways to use this class: In production applications, it can productively be used to display messages such that the user doesn't need to look at all of them all the time. To use QErrorMessage like this, you create the dialog in the usual way and call the message() slot, or connect signals to it.

The other way is intended for developers: The static qtHandler() installs a message handler using qInstallMsgHandler() and creates a QErrorMessage that displays the qDebug()/qWarning()/qFatal() messages.

In both cases will QErrorMessage queue up pending messages, and display them (or not) in order, as soon as the user presses Enter or clicks OK after seeing each message.

See also QMessageBox and QStatusBar::message().


Member Function Documentation

QErrorMessage::QErrorMessage ( QWidget * parent, const char * name = 0 )

Constructs and installs an error handler window. The parent parent and name name are passed on to the QDialog constructor

QErrorMessage::~QErrorMessage ()

Destroys the object and frees any allocated resources. Notably, the list of "do not show again" messages is deleted.

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

Shows m and returns immediately. If the user has requested that m not be shown, this function does nothing.

Normally, m is shown at once, but if there are pending messages already m is queued for later display, not shown immediately.

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.

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.


Copyright © 2000 TrolltechTrademarks
Qt version main-beta1