gcc 4.4 build fix
[qbat.git] / qtimermessagebox.h
blobe5aacc87c51b842303ed6d8a18b0d7529cbca1ab
1 //
2 // C++ Interface: qtimermessagebox
3 //
4 // Author: Oliver Groß <z.o.gross@gmx.de>, (C) 2008
5 //
6 // Copyright: See COPYING file that comes with this distribution
7 //
8 #ifndef QTIMERMESSAGEBOX_H
9 #define QTIMERMESSAGEBOX_H
11 #include <QMessageBox>
13 /**
14 @author Oliver Groß <z.o.gross@gmx.de>
16 class QTimerMessageBox : public QMessageBox {
17 Q_OBJECT
18 private:
19 int m_TimerID;
20 int m_Timeout;
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);
28 public:
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);
31 ~QTimerMessageBox();
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);
40 public slots:
41 int exec(int timeout);
42 signals:
43 void aboutToTriggerTimeout();
46 #endif