linechartitem_p.h
86 lines
| 2.4 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
r794 | /**************************************************************************** | ||
** | ||||
Miikka Heikkinen
|
r2432 | ** Copyright (C) 2013 Digia Plc | ||
Jani Honkonen
|
r794 | ** 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$ | ||||
** | ||||
****************************************************************************/ | ||||
unknown
|
r1366 | // 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. | ||||
Michal Klocek
|
r144 | #ifndef LINECHARTITEM_H | ||
#define LINECHARTITEM_H | ||||
Michal Klocek
|
r21 | |||
Tero Ahola
|
r30 | #include "qchartglobal.h" | ||
Michal Klocek
|
r1218 | #include "xychart_p.h" | ||
Miikka Heikkinen
|
r2483 | #include "qchart.h" | ||
Michal Klocek
|
r139 | #include <QPen> | ||
Michal Klocek
|
r21 | |||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
Michal Klocek
|
r21 | |||
Michal Klocek
|
r349 | class QLineSeries; | ||
Michal Klocek
|
r677 | class ChartPresenter; | ||
Michal Klocek
|
r21 | |||
Michal Klocek
|
r2273 | class LineChartItem : public XYChart | ||
Michal Klocek
|
r21 | { | ||
Jani Honkonen
|
r2097 | Q_OBJECT | ||
Q_INTERFACES(QGraphicsItem) | ||||
Michal Klocek
|
r21 | public: | ||
Miikka Heikkinen
|
r2483 | explicit LineChartItem(QLineSeries *series, QGraphicsItem *item = 0); | ||
Tero Ahola
|
r1791 | ~LineChartItem() {} | ||
Michal Klocek
|
r21 | |||
//from QGraphicsItem | ||||
Michal Klocek
|
r67 | QRectF boundingRect() const; | ||
Tero Ahola
|
r108 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||
Michal Klocek
|
r131 | QPainterPath shape() const; | ||
Michal Klocek
|
r139 | |||
Miikka Heikkinen
|
r2483 | QPainterPath path() const { return m_fullPath; } | ||
Tero Ahola
|
r1792 | |||
sauimone
|
r775 | public Q_SLOTS: | ||
Michal Klocek
|
r392 | void handleUpdated(); | ||
Tero Ahola
|
r1792 | |||
Michal Klocek
|
r464 | protected: | ||
Michal Klocek
|
r1217 | void updateGeometry(); | ||
Michal Klocek
|
r1218 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | ||
Marek Rosa
|
r2255 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | ||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | ||||
Miikka Heikkinen
|
r2452 | void suppressPoints() { m_pointsVisible = false; } | ||
Miikka Heikkinen
|
r2483 | void forceChartType(QChart::ChartType chartType) { m_chartType = chartType; } | ||
Michal Klocek
|
r464 | |||
Michal Klocek
|
r465 | private: | ||
Jani Honkonen
|
r2104 | QLineSeries *m_series; | ||
Michal Klocek
|
r1819 | QPainterPath m_linePath; | ||
Miikka Heikkinen
|
r2483 | QPainterPath m_linePathPolarRight; | ||
QPainterPath m_linePathPolarLeft; | ||||
QPainterPath m_fullPath; | ||||
QPainterPath m_shapePath; | ||||
Michal Klocek
|
r1819 | QVector<QPointF> m_points; | ||
Michal Klocek
|
r465 | QRectF m_rect; | ||
Michal Klocek
|
r544 | QPen m_linePen; | ||
bool m_pointsVisible; | ||||
Miikka Heikkinen
|
r2483 | QChart::ChartType m_chartType; | ||
Michal Klocek
|
r21 | }; | ||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
Michal Klocek
|
r21 | |||
#endif | ||||