qlegend_p.h
99 lines
| 2.6 KiB
| text/x-c
|
CLexer
|
r950 | /**************************************************************************** | ||
** | ||||
|
r2776 | ** Copyright (C) 2015 The Qt Company Ltd | ||
|
r950 | ** All rights reserved. | ||
|
r2776 | ** For any questions to The Qt Company, please use contact form at http://qt.io | ||
|
r950 | ** | ||
|
r2740 | ** This file is part of the Qt Charts module. | ||
|
r950 | ** | ||
|
r2740 | ** Licensees holding valid commercial license for Qt may use this file in | ||
** accordance with the Qt License Agreement provided with the Software | ||||
** or, alternatively, in accordance with the terms contained in a written | ||||
|
r2776 | ** agreement between you and The Qt Company. | ||
|
r950 | ** | ||
** If you have questions regarding the use of this file, please use | ||||
|
r2740 | ** contact form at http://qt.io | ||
|
r950 | ** | ||
****************************************************************************/ | ||||
// W A R N I N G | ||||
// ------------- | ||||
// | ||||
|
r2807 | // This file is not part of the Qt Chart API. It exists purely as an | ||
|
r950 | // implementation detail. This header file may change from version to | ||
// version without notice, or even be removed. | ||||
// | ||||
// We mean it. | ||||
|
r969 | #ifndef QLEGEND_P_H | ||
#define QLEGEND_P_H | ||||
|
r950 | |||
|
r2714 | #include <QtCharts/QLegend> | ||
|
r950 | |||
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
|
r950 | |||
|
r1300 | class QChart; | ||
|
r950 | class ChartPresenter; | ||
|
r988 | class QAbstractSeries; | ||
|
r1534 | class LegendLayout; | ||
|
r2161 | class QLegendMarker; | ||
|
r950 | |||
|
r2197 | class QLegendPrivate : public QObject | ||
|
r950 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r1300 | QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q); | ||
|
r950 | ~QLegendPrivate(); | ||
|
r2189 | void setOffset(const QPointF &offset); | ||
|
r1458 | QPointF offset() const; | ||
|
r1453 | int roundness(qreal size); | ||
|
r1534 | |||
|
r2160 | QGraphicsItemGroup* items() { return m_items; } | ||
|
r2193 | QList<QLegendMarker*> markers(QAbstractSeries *series = 0); | ||
|
r950 | |||
public Q_SLOTS: | ||||
|
r2173 | void handleSeriesAdded(QAbstractSeries *series); | ||
|
r988 | void handleSeriesRemoved(QAbstractSeries *series); | ||
|
r1459 | void handleSeriesVisibleChanged(); | ||
|
r2085 | void handleCountChanged(); | ||
|
r950 | |||
|
r2182 | private: | ||
// Internal helpers | ||||
void addMarkers(QList<QLegendMarker *> markers); | ||||
void removeMarkers(QList<QLegendMarker *> markers); | ||||
void decorateMarkers(QList<QLegendMarker *> markers); | ||||
|
r950 | private: | ||
QLegend *q_ptr; | ||||
ChartPresenter *m_presenter; | ||||
|
r1534 | LegendLayout *m_layout; | ||
|
r2193 | QChart *m_chart; | ||
QGraphicsItemGroup *m_items; | ||||
|
r1357 | Qt::Alignment m_alignment; | ||
|
r950 | QBrush m_brush; | ||
QPen m_pen; | ||||
|
r1522 | QFont m_font; | ||
|
r1527 | QBrush m_labelBrush; | ||
|
r1534 | |||
|
r1453 | qreal m_diameter; | ||
|
r950 | bool m_attachedToChart; | ||
bool m_backgroundVisible; | ||||
|
r2676 | bool m_reverseMarkers; | ||
|
r950 | |||
|
r2193 | QList<QLegendMarker *> m_markers; | ||
QList<QAbstractSeries *> m_series; | ||||
|
r2160 | |||
|
r2197 | QHash<QGraphicsItem *, QLegendMarker *> m_markerHash; | ||
|
r2183 | friend class QLegend; | ||
friend class LegendMarkerItem; | ||||
|
r2193 | friend class LegendLayout; | ||
|
r2194 | friend class QLegendMarkerPrivate; | ||
|
r2197 | friend class LegendScroller; | ||
|
r950 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r950 | |||
#endif | ||||