#ifndef MULTYMESSAGEDIALOG_H #define MULTYMESSAGEDIALOG_H #include #include #include #include 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