58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
#ifndef MSGBOX_H
|
|
#define MSGBOX_H
|
|
|
|
#include <QDialog>
|
|
#include <QMessageBox>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QResizeEvent>
|
|
#include <QPaintEvent>
|
|
#include <QStyleOption>
|
|
#include <QPainter>
|
|
|
|
#if _MSC_VER >= 1600
|
|
#pragma execution_character_set("utf-8")
|
|
#endif
|
|
|
|
QMessageBox::StandardButton MyMsgBox(QMessageBox::Icon icon, const QString &title = "Tip",
|
|
const QString &text = "Success", QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
|
QMessageBox::StandardButton defaultButton = QMessageBox::Ok,QWidget *parent = 0);
|
|
|
|
|
|
class MsgBox : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MsgBox(QMessageBox::Icon icon,const QString &title, const QString &text,
|
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton,QWidget *parent = 0);
|
|
~MsgBox();
|
|
|
|
QMessageBox *m_MsgBox;
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *);
|
|
void resizeEvent(QResizeEvent *Size);
|
|
void mouseMoveEvent(QMouseEvent *event);
|
|
void mousePressEvent(QMouseEvent *event);
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
|
|
|
private:
|
|
QLabel *m_Frame;
|
|
QLabel *m_Logo;
|
|
QLabel *m_Title;
|
|
QPushButton *m_BtnClose;
|
|
|
|
|
|
|
|
QPoint m_dPos;
|
|
bool m_MouseLButtonPressed;
|
|
|
|
QMessageBox::StandardButton standardButton(QAbstractButton *button) const;
|
|
|
|
private slots:
|
|
void onButtonClicked(QAbstractButton *button);
|
|
};
|
|
|
|
#endif // MSGBOX_H
|