#ifndef _MESSAGEBOX_H
|
#define _MESSAGEBOX_H
|
|
#include <QMessageBox>
|
#include <QDialogButtonBox>
|
#include <QGridLayout>
|
#include <QToolButton>
|
#include <QLabel>
|
#include <QPushButton>
|
#include <QCheckBox>
|
#include <QHBoxLayout>
|
#include <QEvent>
|
#include <QApplication>
|
#include <QStyle>
|
#include <QtGui/QMouseEvent>
|
#include "work_thread.h"
|
#include "custom.h"
|
|
class MessageBox : public customDialog
|
{
|
Q_OBJECT
|
|
public:
|
explicit MessageBox(QWidget *parent = 0,
|
QMessageBox::Icon icon = QMessageBox::NoIcon,
|
const QString &title = tr("Tip"),
|
const QString &text = "",
|
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
QMessageBox::StandardButton defaultButton = QMessageBox::Cancel,
|
Work_Thread *thread = 0);
|
~MessageBox();
|
QAbstractButton *clickedButton() const;
|
QMessageBox::StandardButton standardButton(QAbstractButton *button) const;
|
|
void setDefaultButton(QPushButton *button);
|
void setDefaultButton(QMessageBox::StandardButton button);
|
void setText(const QString & str);
|
void set_yes_btn_text(bool,QString);
|
|
protected:
|
void changeEvent(QEvent *event);
|
|
private slots:
|
void onButtonClicked(QAbstractButton *button);
|
void btn_beep(void);
|
|
void UpdateInterface(int interface);
|
|
private:
|
void translateUI();
|
void setQlabelMinimumWidth(QLabel *Label, QString &text);
|
int execReturnCode(QAbstractButton *button);
|
//virtual void mousePressEvent(QMouseEvent *event);
|
//virtual void mouseMoveEvent(QMouseEvent *event);
|
//virtual void mouseReleaseEvent(QMouseEvent *event);
|
//virtual void resizeEvent(QResizeEvent * pe);
|
|
private:
|
QLabel *m_pIconLabel;
|
QLabel *m_pLabel;
|
|
Work_Thread *work_thread;
|
|
QGridLayout *m_pGridLayout;
|
QDialogButtonBox *m_pButtonBox;
|
QAbstractButton *m_pClickedButton;
|
QAbstractButton *m_pDefaultButton;
|
QLabel *titleLabel;
|
QToolButton *closeButton;
|
|
bool mMoveing;
|
QPoint mMovePosition;
|
};
|
|
#endif // MESSAGEBOX_H
|