#ifndef MESSAGE_H #define MESSAGE_H #include #include #include #include #include class Message : public QWidget { Q_OBJECT public: enum Level { Success, Error, Info, Warning }; explicit Message(QWidget* parent = 0); ~Message(); void success(QString content, int duration); void error(QString content, int duration); void info(QString content, int duration); void warning(QString content, int duration); private: Level level = Info; bool isShow = false; int count = 0; int maxCount = 5; QList> contentList; QString btnStyle; private: void showMessage(QString content, int duration, Level level); QPushButton* generateButton(QString content, Level level); }; #endif // MESSAGE_H