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