#ifndef RECTANGLE_H #define RECTANGLE_H #include class Rectangle : public QQuickPaintedItem { Q_OBJECT QML_ELEMENT Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QList 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 radius() const; void setRadius(const QList &radius); signals: void colorChanged(); void radiusChanged(); private: QColor m_color; QList m_radius; }; #endif // RECTANGLE_H