qlegend_p.h
101 lines
| 2.6 KiB
| text/x-c
|
CLexer
|
r950 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
// W A R N I N G | ||||
// ------------- | ||||
// | ||||
// This file is not part of the QtCommercial Chart API. It exists purely as an | ||||
// 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 | |||
#include "qlegend.h" | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r1300 | class QChart; | ||
|
r950 | class ChartPresenter; | ||
|
r988 | class QAbstractSeries; | ||
|
r1534 | class LegendLayout; | ||
|
r1936 | class Domain; | ||
|
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; | ||||
|
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 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||