2 // C++ Interface: qtimermessagebox
4 // Author: Oliver Groß <z.o.gross@gmx.de>, (C) 2008
6 // Copyright: See COPYING file that comes with this distribution
8 #ifndef QTIMERMESSAGEBOX_H
9 #define QTIMERMESSAGEBOX_H
11 #include <QMessageBox>
14 @author Oliver Groß <z.o.gross@gmx.de>
16 class QTimerMessageBox
: public QMessageBox
{
22 QString m_DefaultButtonText
;
24 void timerEvent(QTimerEvent
* event
);
25 inline void markDefaultButton();
27 inline static QTimerMessageBox::StandardButton
messagebox(QWidget
* parent
, Icon icon
, const QString
& title
, const QString
& text
, int timeout
, StandardButtons buttons
, StandardButton defaultButton
);
29 QTimerMessageBox(QWidget
* parent
= 0);
30 QTimerMessageBox(Icon icon
, const QString
& title
, const QString
& text
, StandardButtons buttons
= NoButton
, QWidget
* parent
= 0, Qt::WindowFlags f
= Qt::Dialog
| Qt::MSWindowsFixedSizeDialogHint
);
33 int timeout() const { return m_Timeout
; }
34 inline void setTimeout(int timeout
);
36 static QMessageBox::StandardButton
critical(QWidget
* parent
, const QString
& title
, const QString
& text
, int timeout
= 10, StandardButtons buttons
= Ok
, StandardButton defaultButton
= Ok
);
37 static QMessageBox::StandardButton
information(QWidget
* parent
, const QString
& title
, const QString
& text
, int timeout
= 10, StandardButtons buttons
= Ok
, StandardButton defaultButton
= Ok
);
38 static QMessageBox::StandardButton
question(QWidget
* parent
, const QString
& title
, const QString
& text
, int timeout
= 10, StandardButtons buttons
= Ok
, StandardButton defaultButton
= Ok
);
39 static QMessageBox::StandardButton
warning(QWidget
* parent
, const QString
& title
, const QString
& text
, int timeout
= 10, StandardButtons buttons
= Ok
, StandardButton defaultButton
= Ok
);
41 int exec(int timeout
);
43 void aboutToTriggerTimeout();