renderarea.h Example File
painting/painterpaths/renderarea.h
#ifndef RENDERAREA_H
#define RENDERAREA_H
#include <QPainterPath>
#include <QWidget>
class RenderArea : public QWidget
{
Q_OBJECT
public:
explicit RenderArea(const QPainterPath &path, QWidget *parent = 0);
QSize minimumSizeHint() const override;
QSize sizeHint() const override;
public slots:
void setFillRule(Qt::FillRule rule);
void setFillGradient(const QColor &color1, const QColor &color2);
void setPenWidth(int width);
void setPenColor(const QColor &color);
void setRotationAngle(int degrees);
protected:
void paintEvent(QPaintEvent *event) override;
private:
QPainterPath path;
QColor fillColor1;
QColor fillColor2;
int penWidth;
QColor penColor;
int rotationAngle;
};
#endif // RENDERAREA_H