qsplineseries.h
67 lines
| 1.9 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$ | ||||
** | ||||
****************************************************************************/ | ||||
Marek Rosa
|
r295 | #ifndef QSPLINESERIES_H | ||
#define QSPLINESERIES_H | ||||
Jani Honkonen
|
r697 | #include <qchartglobal.h> | ||
#include <qlineseries.h> | ||||
Marek Rosa
|
r401 | #include <QList> | ||
#include <QPointF> | ||||
sauimone
|
r743 | #include <QtGlobal> | ||
Marek Rosa
|
r295 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Michal Klocek
|
r470 | class QTCOMMERCIALCHART_EXPORT QSplineSeries : public QLineSeries | ||
Marek Rosa
|
r295 | { | ||
Q_OBJECT | ||||
Michal Klocek
|
r467 | public: | ||
Marek Rosa
|
r305 | |||
QSplineSeries(QObject *parent = 0); | ||||
Michal Klocek
|
r467 | QSeriesType type() const {return QSeries::SeriesTypeSpline;} | ||
Marek Rosa
|
r401 | |||
Marek Rosa
|
r433 | // int count() const { return m_x.size(); } | ||
Michal Klocek
|
r467 | QPointF controlPoint(int index) const {return m_controlPoints[index];} | ||
sauimone
|
r743 | bool setModel(QAbstractItemModel *model); | ||
Marek Rosa
|
r305 | |||
Marek Rosa
|
r527 | void setModelMapping(int modelX, int modelY, Qt::Orientation orientation = Qt::Vertical); | ||
Marek Rosa
|
r734 | void setModelMappingShift(int first, int count); | ||
Marek Rosa
|
r527 | |||
Marek Rosa
|
r434 | // TODO: allow the user to set custom control points | ||
// void setCustomControlPoints(QList<QPointsF> controlPoints); | ||||
// bool calculateControlPointsAutomatically(); | ||||
// void setCalculateControlPointsAutomatically(); | ||||
Michal Klocek
|
r467 | |||
private: | ||||
Marek Rosa
|
r431 | void calculateControlPoints(); | ||
QList<qreal> getFirstControlPoints(QList<qreal> rhs); | ||||
sauimone
|
r775 | private Q_SLOTS: | ||
Marek Rosa
|
r431 | void updateControlPoints(); | ||
Marek Rosa
|
r305 | |||
Michal Klocek
|
r467 | private: | ||
Marek Rosa
|
r318 | QList<QPointF> m_controlPoints; | ||
Michal Klocek
|
r467 | |||
Marek Rosa
|
r295 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QSPLINESERIES_H | ||||