2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef RENDERAREA_H
|
|
|
|
#define RENDERAREA_H
|
|
|
|
|
|
|
|
#include <QPainterPath>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class RenderArea : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-09-06 21:24:56 +00:00
|
|
|
explicit RenderArea(const QPainterPath &path, QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-06-15 08:12:35 +00:00
|
|
|
QSize minimumSizeHint() const override;
|
|
|
|
QSize sizeHint() const override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
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:
|
2016-06-15 08:12:35 +00:00
|
|
|
void paintEvent(QPaintEvent *event) override;
|
2011-04-27 10:05:43 +00:00
|
|
|
//! [0]
|
|
|
|
|
|
|
|
//! [1]
|
|
|
|
private:
|
|
|
|
QPainterPath path;
|
|
|
|
QColor fillColor1;
|
|
|
|
QColor fillColor2;
|
|
|
|
int penWidth;
|
|
|
|
QColor penColor;
|
|
|
|
int rotationAngle;
|
|
|
|
};
|
|
|
|
//! [1]
|
|
|
|
|
2012-11-23 10:52:51 +00:00
|
|
|
#endif // RENDERAREA_H
|