Paste #U-dFXLIpR

#ifndef INFORMATIVEPOPUP_H
#define INFORMATIVEPOPUP_H

#include <QWidget>
#include <QTimer>
#include <QPropertyAnimation>
#include <QGraphicsOpacityEffect>

namespace Ui {
    class InformativePopup;
}

typedef struct {
    QObject *sender;
    QString title;
    QString message;
} PopMessage;
class InformativePopup : public QWidget
{
    Q_OBJECT
public:
    explicit InformativePopup(QWidget *parent = 0);
    ~InformativePopup();

    void reposition();

public Q_SLOTS:
    // if we have 1 msg, and messages is Q_EMITed with a different one rotate fails...
    void statusMessages(const QStringList &messages);
    void warningMessage(const QString &warning, const QString &title = QString());

private Q_SLOTS:
    void startRotate();
    void rotate();

protected:
    virtual void enterEvent(QEvent *event);
    virtual void leaveEvent(QEvent *event);
    virtual void mousePressEvent(QMouseEvent *);
    virtual void resizeEvent(QResizeEvent *event);

private:
    void appendMessage(const PopMessage &pop);

    Ui::InformativePopup *ui;
    int m_currentMsg;
    QGraphicsOpacityEffect *m_opacityEffect;
    QPropertyAnimation *m_opacityAnimation;
    QVector<PopMessage> m_blacklistV;
    QVector<PopMessage> m_messagesV;
    QTimer *m_rotateTimer;
    bool m_removeCurrent;
};

#endif // INFORMATIVEPOPUP_H