1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4// W A R N I N G
5// -------------
6//
7// This file is not part of the Qt Chart API. It exists purely as an
8// implementation detail. This header file may change from version to
9// version without notice, or even be removed.
10//
11// We mean it.
12
13#ifndef QLEGENDMARKERPRIVATE_H
14#define QLEGENDMARKERPRIVATE_H
15
16#include <QtCharts/QChartGlobal>
17#include <QGraphicsObject>
18#include <QtGui/QBrush>
19#include <QtGui/QPen>
20#include <QtWidgets/QGraphicsLayoutItem>
21#include <QtCharts/private/qchartglobal_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QAbstractSeries;
26class QLegend;
27
28class QLegendMarker;
29class LegendMarkerItem;
30
31class Q_CHARTS_PRIVATE_EXPORT QLegendMarkerPrivate : public QObject
32{
33 Q_OBJECT
34public:
35 explicit QLegendMarkerPrivate(QLegendMarker *q, QLegend *legend);
36 virtual ~QLegendMarkerPrivate();
37
38 // Helper for now. (or declare LegendLayout as friend)
39 LegendMarkerItem* item() const { return m_item; }
40
41 virtual QAbstractSeries* series() = 0;
42 virtual QObject* relatedObject() = 0;
43
44 void invalidateLegend();
45 void invalidateAllItems();
46
47public Q_SLOTS:
48 virtual void updated() = 0;
49 void handleShapeChange();
50
51protected:
52 LegendMarkerItem *m_item;
53 QLegend *m_legend;
54 bool m_customLabel;
55 bool m_customBrush;
56 bool m_customPen;
57
58private:
59 QLegendMarker *q_ptr;
60
61 friend class QLegendPrivate;
62 friend class LegendMarkerItem;
63 Q_DECLARE_PUBLIC(QLegendMarker)
64};
65
66QT_END_NAMESPACE
67
68#endif // QLEGENDMARKERPRIVATE_H
69

source code of qtcharts/src/charts/legend/qlegendmarker_p.h