comparison moreinformationdialog.h @ 290:c0c254f67346 more_information_dialog

Make our own message box with a more useful "more information" section than the Qt one
author Chris Cannam
date Mon, 21 Feb 2011 14:23:02 +0000
parents 1244dc3107cb
children
comparison
equal deleted inserted replaced
275:1244dc3107cb 290:c0c254f67346
17 17
18 #ifndef MORE_INFORMATION_DIALOG_H 18 #ifndef MORE_INFORMATION_DIALOG_H
19 #define MORE_INFORMATION_DIALOG_H 19 #define MORE_INFORMATION_DIALOG_H
20 20
21 #include <QString> 21 #include <QString>
22 #include <QDialog>
22 23
23 class QWidget; 24 class QLabel;
25 class QTextEdit;
26 class QPushButton;
24 27
25 /** 28 /**
26 * Provide methods like the QMessageBox static methods, to call up 29 * Provide methods like the QMessageBox static methods, to call up
27 * dialogs with "More information" buttons in them 30 * dialogs with "More information" buttons in them. QMessageBox does
31 * have an optional additional-details field, but it doesn't behave
32 * quite as we'd like with regard to layout
28 */ 33 */
29 34
30 class MoreInformationDialog 35 class MoreInformationDialog : public QDialog
31 { 36 {
37 Q_OBJECT
38
32 public: 39 public:
33 static void critical(QWidget *parent, QString title, QString text, QString more); 40 MoreInformationDialog(QString title,
34 static void information(QWidget *parent, QString title, QString text, QString more); 41 QString head,
35 static void warning(QWidget *parent, QString title, QString text, QString more); 42 QString text,
43 QString more,
44 QWidget *parent = 0);
45
46 ~MoreInformationDialog();
47
48 void setIcon(QIcon);
49
50 static void critical(QWidget *parent, QString title, QString head, QString text, QString more);
51 static void information(QWidget *parent, QString title, QString head, QString text, QString more);
52 static void warning(QWidget *parent, QString title, QString head, QString text, QString more);
53
54 private slots:
55 void moreClicked();
56
57 private:
58 QLabel *m_iconLabel;
59 QPushButton *m_moreButton;
60 QTextEdit *m_moreText;
36 }; 61 };
37 62
38 #endif 63 #endif