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

QTerminationHandler Class Reference
[QtBaseModule]

The QTerminationHandler class allows an application to instruct the system on how to handle an abnormal termination. More...

    #include <QTerminationHandler>

Inherits QObject.

Public Functions

Additional Inherited Members


Detailed Description

The QTerminationHandler class allows an application to instruct the system on how to handle an abnormal termination.

While the abnormal termination - ie. crash - of an application is undesirable, sometimes it is unavoidable. By default, Qt Extended displays a generic notification when this occurs that gives no information to the end user as to what caused the crash, and how they could potentially avoid it reoccuring.

The QTerminationHandler class allows an application to register expanded information for display to the user if it crashes. To use the QTerminationHandler class, an application only has to construct it prior to commencing the potentially dangerous operation and destroy it when the termination information is no longer valid.

An application may register as many termination handlers as required, however only the most recently installed termination handler will be used in the case an abnormal termination.


Member Function Documentation

QTerminationHandler::QTerminationHandler ( const QString & text, const QString & buttonText = QString(), const QString & buttonIcon = QString(), const QtopiaServiceRequest & action = QtopiaServiceRequest(), QObject * parent = 0 )

Constructs a QTerminationHandler. If a crash occurs, text will be presented to the user in a theme dictated manner. Additionally, if action is valid, and if either buttonText or buttonIcon are valid the user will have the option of activating a button that causes action to occur.

The QTerminationHandler is a QObject with the given parent.

For example,

    QTerminationHandler * myTermHandler = new QTerminationHandler(tr("The message you tried to read caused Acme EMail to crash.  Please try viewing the mail in text only mode.", "Restart", ":icon/acmeemail", QtopiaServiceRequest("AcmeEmail", "viewMail()"));

    // Open mail

    delete myTermHandler;

QTerminationHandler::QTerminationHandler ( const QtopiaServiceRequest & action, QObject * parent = 0 )

Constructs a QTerminationHandler. If a crash occurs, action will occur.

For example,

    QTerminationHandler * myTermHandler = new QTerminationHandler(QtopiaServiceRequest("AcmeEmail", "showCrashScreen()"));

    // Open mail

    delete myTermHandler;

QTerminationHandler::~QTerminationHandler ()

Destroys the QTerminationHandler instance. This automatically unregisters the handler from the system.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3