#ifndef ROTATINGLABEL_H
#define ROTATINGLABEL_H

#include <QLabel>
#include <QPainter>
#include <QPixmap>
#include <QPropertyAnimation>
#include <QTransform>

class RotatingLabel : public QLabel {
    Q_OBJECT
    Q_PROPERTY(int rotationAngle READ rotationAngle WRITE setRotationAngle)
public:
    explicit RotatingLabel(QWidget *parent = nullptr);

    void setPixmapWithAnimation(const QPixmap &pix, int durationMs = 2000);

    int rotationAngle() const { return m_angle; }
    void setRotationAngle(int angle);

private:
    void updatePixmap();

    QPixmap m_pixmap;
    int m_angle;
};

#endif // ROTATINGLABEL_H
