-
Notifications
You must be signed in to change notification settings - Fork 1
/
MsgBoxEx.h
53 lines (41 loc) · 991 Bytes
/
MsgBoxEx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef MSGBOXEX_H
#define MSGBOXEX_H
#include <QMessageBox>
#include <QTimer>
#include <QIcon>
#include <QAbstractButton>
#include <QDebug>
#include <QPushButton>
enum MsgBoxMode {
MsgBoxMode_OnlyHint,
MsgBoxMode_Normal
};
enum MsgBoxBtnType {
MsgBoxBtnType_Ok,
MsgBoxBtnType_OkCancle
};
class MsgBoxEx : public QMessageBox
{
Q_OBJECT
public:
explicit MsgBoxEx(QWidget *parent = 0);
private:
MsgBoxMode m_msgBoxMode;
QString m_strTitle;
QString m_strContent;
int m_nDelayTime;
MsgBoxBtnType m_msgBoxBtnType;
QPushButton *m_pBtnOk;
QPushButton *m_pBtnCancel;
public:
void setMsgBoxMode(QString content, int delayTime=1500);
void setMsgBoxMode(QString content, QString title, MsgBoxBtnType btnType = MsgBoxBtnType::MsgBoxBtnType_Ok);
void updateMsgBoxMode();
signals:
void btnOkClicked();
void btnCancelClicked();
private slots:
void onOkClicked();
void onCancelClicked();
};
#endif // MSGBOXEX_H