56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#ifndef MULTYMESSAGEDIALOG_H
|
|
#define MULTYMESSAGEDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QTimer>
|
|
#include <QLabel>
|
|
#include <QPropertyAnimation>
|
|
|
|
enum MessageLevel:unsigned int
|
|
{
|
|
Info = 0,
|
|
Warning,
|
|
Error,
|
|
Sucess,
|
|
};
|
|
|
|
class MultyMessageDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
MultyMessageDialog(const QString& aMessage = "",MessageLevel aMessageLevel = MessageLevel::Info,QWidget* aParent = nullptr);
|
|
~MultyMessageDialog() override;
|
|
void setAutoDisappearTime(int aAutoDisappearTime);
|
|
void setMessage(const QString& aMessage);
|
|
void stopShowAnimation();
|
|
|
|
signals:
|
|
void dialogDestroyed();
|
|
|
|
public slots:
|
|
void hideDialog();
|
|
void startHideAnimation();
|
|
|
|
protected:
|
|
void showEvent(QShowEvent* aEvent) override;
|
|
|
|
private:
|
|
void initializeAnimation();
|
|
void initializeIcon();
|
|
|
|
private:
|
|
int mAutoDisappearTime;
|
|
QTimer* mTimer;
|
|
QSize mSize;
|
|
QPropertyAnimation* mDisappearAnimation;
|
|
QPropertyAnimation* mShowAnimation;
|
|
QLabel* mMessage;
|
|
QLabel* mIcon;
|
|
MessageLevel mLevel;
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif // MULTYMESSAGEDIALOG_H
|