Kylin/Fluent/Rectangle.h
2024-08-21 23:26:43 +08:00

32 lines
716 B
C++

#ifndef RECTANGLE_H
#define RECTANGLE_H
#include <QQuickPaintedItem>
class Rectangle : public QQuickPaintedItem {
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QList<int> radius READ radius WRITE setRadius NOTIFY radiusChanged)
public:
Rectangle(QQuickItem *parent = nullptr);
void paint(QPainter *painter) final;
QColor color() const;
void setColor(const QColor &color);
QList<int> radius() const;
void setRadius(const QList<int> &radius);
signals:
void colorChanged();
void radiusChanged();
private:
QColor m_color;
QList<int> m_radius;
};
#endif // RECTANGLE_H