mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2024-11-27 14:38:28 +08:00
44 lines
921 B
C
44 lines
921 B
C
|
// Copyright (C) 2016 The Qt Company Ltd.
|
||
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||
|
|
||
|
#ifndef RENDERAREA_H
|
||
|
#define RENDERAREA_H
|
||
|
|
||
|
#include <QPainterPath>
|
||
|
#include <QWidget>
|
||
|
|
||
|
//! [0]
|
||
|
class RenderArea : public QWidget
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
explicit RenderArea(const QPainterPath &path, QWidget *parent = nullptr);
|
||
|
|
||
|
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;
|
||
|
//! [0]
|
||
|
|
||
|
//! [1]
|
||
|
private:
|
||
|
QPainterPath path;
|
||
|
QColor fillColor1;
|
||
|
QColor fillColor2;
|
||
|
int penWidth;
|
||
|
QColor penColor;
|
||
|
int rotationAngle;
|
||
|
};
|
||
|
//! [1]
|
||
|
|
||
|
#endif // RENDERAREA_H
|