| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef MESSAGEBOX_H
- #define MESSAGEBOX_H
- #include <QWidget>
- #include <QScopedPointer>
- class MessageBoxPrivate;
- class MessageBox : public QWidget
- {
- Q_OBJECT
- Q_DISABLE_COPY(MessageBox)
- public:
- enum Type {
- T_Show = 0,
- T_Hide = 1,
- };
- explicit MessageBox(QWidget *parent = NULL);
- ~MessageBox();
- void setText(const QString &text);
- void setAutoHide(const bool flag);
- void setBackgroundBmpPath(const QString& path);
- void setFontPointSize(const int pointSize);
- protected:
- void styleChange();
- void showEvent(QShowEvent *event);
- void hideEvent(QHideEvent *event);
- void paintEvent(QPaintEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- signals:
- void messageWidgetChange(const MessageBox::Type type);
- void messageShowTimeout();
- private slots:
- void onTimeOut();
- private:
- friend class MessageBoxPrivate;
- QScopedPointer<MessageBoxPrivate> m_Private;
- };
- #endif // MESSAGEBOX_H
|