50 lines
782 B
C++
50 lines
782 B
C++
#ifndef MESSAGEBOX_H
|
|
#define MESSAGEBOX_H
|
|
|
|
#include <QDialog>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class messageDialog;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
enum MessageBoxType
|
|
{
|
|
t_information = 0,
|
|
t_question,
|
|
t_warning
|
|
};
|
|
|
|
// enum MessageBoxBtn
|
|
// {
|
|
// btn_Null = 0,
|
|
// btn_Yes,
|
|
// btn_No
|
|
// };
|
|
//extern MessageBoxBtn g_msgBoxBtn;
|
|
|
|
class MessageBox : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MessageBox(QWidget *parent = nullptr);
|
|
~MessageBox();
|
|
|
|
static int show(MessageBoxType,const QString&,const QString&);
|
|
|
|
public slots:
|
|
void onBtnClicked_confirm();
|
|
void onBtnClicked_yes();
|
|
void onBtnClicked_no();
|
|
|
|
private:
|
|
void setType(MessageBoxType);
|
|
void setMessage(MessageBoxType,const QString&,const QString&);
|
|
|
|
Ui::messageDialog* ui;
|
|
};
|
|
|
|
#endif
|