1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef PIERENDERER_H
5#define PIERENDERER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the QtGraphs API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16
17#include <QQuickItem>
18#include <QtGui/qpainterpath.h>
19
20QT_BEGIN_NAMESPACE
21
22class QGraphsView;
23class QPieSeries;
24class QPieSlice;
25class QQuickShape;
26class QAbstractSeries;
27
28class PieRenderer : public QQuickItem
29{
30 Q_OBJECT
31public:
32 PieRenderer(QGraphsView *graph);
33 ~PieRenderer() override;
34
35 void handlePolish(QPieSeries *series);
36 void afterPolish(QList<QAbstractSeries *> &cleanupSeries);
37 void updateSeries(QPieSeries *series);
38 void afterUpdate(QList<QAbstractSeries *> &cleanupSeries);
39 void markedDeleted(QList<QPieSlice *> deleted);
40
41 void setSize(QSizeF size);
42
43private:
44 struct SliceData
45 {
46 bool initialized;
47 };
48
49 QGraphsView *m_graph;
50 QQuickShape *m_shape;
51 QHash<QPieSlice *, SliceData> m_activeSlices;
52
53 QPainterPath m_painterPath;
54 qsizetype m_colorIndex = -1;
55};
56
57QT_END_NAMESPACE
58
59#endif // QPIERENDERER_H
60

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtgraphs/src/graphs2d/qsgrenderer/pierenderer_p.h