From 50adc3e1f496246e0d91a831eebd4fbb730dff1c Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 24 Mar 2005 13:07:30 +0000 Subject: Added icon support for the MessageBox. --- src/messagebox.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/messagebox.h') diff --git a/src/messagebox.h b/src/messagebox.h index 11a1c05..28b06a8 100644 --- a/src/messagebox.h +++ b/src/messagebox.h @@ -32,6 +32,16 @@ #include #include #include +#include + +typedef enum { + ICON_NONE, // No icon is used + ICON_DEFAULT, // An icon matching the buttons is used + ICON_INFO, // An info icon (matching the ok button) + ICON_WARN, // An warning icon (matching the ok/cancel button) + ICON_ERROR, // An critical error icon + ICON_QUESTION // An question icon (matching the yes/no and yes/no/cancel buttons) +} msg_icon; typedef enum { MSG_YES, @@ -51,7 +61,12 @@ class MessageBox : public QDialog { Q_OBJECT public: - MessageBox(QWidget* parent = 0, const char* name = "", const char* text = "", msg_type type = TYPE_OK); + MessageBox(QWidget* parent = 0, + const char* name = "", + const char* text = "", + msg_type type = TYPE_OK, + msg_icon icon = ICON_DEFAULT); + ~MessageBox(); public slots: void bok_clicked(); @@ -60,6 +75,7 @@ public slots: void bno_clicked(); private: + QPixmap *pix_icon; QPushButton *createButton(QWidget *parent, const char *text); }; -- cgit v1.2.3