barchartitem_p.h
88 lines
| 2.4 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
** 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$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r1248 | // 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. | ||||
|
r666 | #ifndef BARCHARTITEM_H | ||
#define BARCHARTITEM_H | ||||
|
r126 | |||
#include "chartitem_p.h" | ||||
|
r338 | #include "qbarseries.h" | ||
|
r183 | #include <QPen> | ||
#include <QBrush> | ||||
|
r126 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r256 | class Bar; | ||
|
r1032 | class QAxisCategories; | ||
|
r487 | class QChart; | ||
|
r256 | |||
|
r679 | class BarChartItem : public ChartItem | ||
|
r126 | { | ||
|
r139 | Q_OBJECT | ||
|
r126 | public: | ||
|
r677 | BarChartItem(QBarSeries *series, ChartPresenter *presenter); | ||
|
r666 | virtual ~BarChartItem(); | ||
|
r126 | |||
|
r175 | public: | ||
|
r126 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||
QRectF boundingRect() const; | ||||
|
r694 | virtual QVector<QRectF> calculateLayout(); | ||
|
r1426 | virtual void applyLayout(const QVector<QRectF> &layout); | ||
|
r681 | void setLayout(const QVector<QRectF> &layout); | ||
void updateLayout(const QVector<QRectF> &layout); | ||||
|
r671 | |||
|
r679 | QRectF geometry() const { return m_rect;} | ||
|
r775 | public Q_SLOTS: | ||
|
r611 | void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | ||
|
r737 | void handleGeometryChanged(const QRectF &size); | ||
|
r671 | void handleLayoutChanged(); | ||
|
r1339 | void handleLabelsVisibleChanged(bool visible); | ||
void handleDataStructureChanged(); // structure of of series has changed, recreate graphic items | ||||
|
r139 | |||
|
r126 | protected: | ||
|
r763 | qreal m_domainMinX; | ||
qreal m_domainMaxX; | ||||
qreal m_domainMinY; | ||||
qreal m_domainMaxY; | ||||
|
r674 | |||
|
r679 | QRectF m_rect; | ||
|
r763 | QVector<QRectF> m_layout; | ||
|
r288 | |||
|
r256 | // Not owned. | ||
|
r763 | QBarSeries *m_series; | ||
QList<Bar *> m_bars; | ||||
|
r1246 | QList<QGraphicsSimpleTextItem *> m_labels; | ||
|
r126 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r666 | #endif // BARCHARTITEM_H | ||