qxyseries.h
133 lines
| 4.5 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
|
r2776 | ** Copyright (C) 2015 The Qt Company Ltd | ||
|
r794 | ** All rights reserved. | ||
|
r2776 | ** For any questions to The Qt Company, please use contact form at http://qt.io | ||
|
r794 | ** | ||
|
r2740 | ** This file is part of the Qt Charts module. | ||
|
r794 | ** | ||
|
r2740 | ** Licensees holding valid commercial license for Qt may use this file in | ||
** accordance with the Qt License Agreement provided with the Software | ||||
** or, alternatively, in accordance with the terms contained in a written | ||||
|
r2776 | ** agreement between you and The Qt Company. | ||
|
r794 | ** | ||
** If you have questions regarding the use of this file, please use | ||||
|
r2740 | ** contact form at http://qt.io | ||
|
r794 | ** | ||
****************************************************************************/ | ||||
|
r969 | #ifndef QXYSERIES_H | ||
#define QXYSERIES_H | ||||
|
r466 | |||
|
r2714 | #include <QtCharts/QChartGlobal> | ||
#include <QtCharts/QAbstractSeries> | ||||
#include <QtGui/QPen> | ||||
#include <QtGui/QBrush> | ||||
|
r466 | |||
|
r2774 | QT_BEGIN_NAMESPACE | ||
|
r877 | class QModelIndex; | ||
|
r2774 | QT_END_NAMESPACE | ||
|
r877 | |||
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
|
r466 | |||
|
r938 | class QXYSeriesPrivate; | ||
|
r1164 | class QXYModelMapper; | ||
|
r938 | |||
|
r2712 | class QT_CHARTS_EXPORT QXYSeries : public QAbstractSeries | ||
|
r466 | { | ||
|
r491 | Q_OBJECT | ||
|
r1481 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) | ||
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | ||||
|
r2692 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) | ||
Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) | ||||
Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) | ||||
Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) | ||||
|
r2815 | Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged) | ||
|
r1169 | |||
|
r470 | protected: | ||
|
r2097 | explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = 0); | ||
|
r466 | |||
public: | ||||
|
r1268 | ~QXYSeries(); | ||
|
r796 | void append(qreal x, qreal y); | ||
void append(const QPointF &point); | ||||
|
r1057 | void append(const QList<QPointF> &points); | ||
|
r2097 | void replace(qreal oldX, qreal oldY, qreal newX, qreal newY); | ||
void replace(const QPointF &oldPoint, const QPointF &newPoint); | ||||
|
r2496 | void replace(int index, qreal newX, qreal newY); | ||
void replace(int index, const QPointF &newPoint); | ||||
|
r541 | void remove(qreal x, qreal y); | ||
|
r743 | void remove(const QPointF &point); | ||
|
r2496 | void remove(int index); | ||
|
r2805 | void removePoints(int index, int count); | ||
|
r1256 | void insert(int index, const QPointF &point); | ||
void clear(); | ||||
|
r491 | |||
int count() const; | ||||
|
r1057 | QList<QPointF> points() const; | ||
|
r2820 | QVector<QPointF> pointsVector() const; | ||
|
r2491 | const QPointF &at(int index) const; | ||
|
r491 | |||
|
r2104 | QXYSeries &operator << (const QPointF &point); | ||
QXYSeries &operator << (const QList<QPointF> &points); | ||||
|
r491 | |||
|
r1537 | virtual void setPen(const QPen &pen); | ||
|
r938 | QPen pen() const; | ||
|
r1537 | virtual void setBrush(const QBrush &brush); | ||
|
r938 | QBrush brush() const; | ||
|
r1481 | virtual void setColor(const QColor &color); | ||
virtual QColor color() const; | ||||
|
r987 | void setPointsVisible(bool visible = true); | ||
|
r938 | bool pointsVisible() const; | ||
|
r467 | |||
|
r2689 | void setPointLabelsFormat(const QString &format); | ||
QString pointLabelsFormat() const; | ||||
void setPointLabelsVisible(bool visible = true); | ||||
bool pointLabelsVisible() const; | ||||
void setPointLabelsFont(const QFont &font); | ||||
QFont pointLabelsFont() const; | ||||
void setPointLabelsColor(const QColor &color); | ||||
QColor pointLabelsColor() const; | ||||
|
r2815 | void setPointLabelsClipping(bool enabled = true); | ||
bool pointLabelsClipping() const; | ||||
|
r1783 | void replace(QList<QPointF> points); | ||
|
r2798 | void replace(QVector<QPointF> points); | ||
|
r1783 | |||
|
r775 | Q_SIGNALS: | ||
|
r743 | void clicked(const QPointF &point); | ||
|
r2255 | void hovered(const QPointF &point, bool state); | ||
|
r2739 | void pressed(const QPointF &point); | ||
void released(const QPointF &point); | ||||
void doubleClicked(const QPointF &point); | ||||
|
r1262 | void pointReplaced(int index); | ||
void pointRemoved(int index); | ||||
void pointAdded(int index); | ||||
|
r1481 | void colorChanged(QColor color); | ||
|
r1783 | void pointsReplaced(); | ||
|
r2689 | void pointLabelsFormatChanged(const QString &format); | ||
void pointLabelsVisibilityChanged(bool visible); | ||||
void pointLabelsFontChanged(const QFont &font); | ||||
void pointLabelsColorChanged(const QColor &color); | ||||
|
r2815 | void pointLabelsClippingChanged(bool clipping); | ||
|
r2805 | void pointsRemoved(int index, int count); | ||
|
r2820 | void penChanged(const QPen &pen); | ||
|
r466 | |||
|
r938 | private: | ||
|
r1222 | Q_DECLARE_PRIVATE(QXYSeries) | ||
Q_DISABLE_COPY(QXYSeries) | ||||
|
r2175 | friend class QXYLegendMarkerPrivate; | ||
|
r938 | friend class XYLegendMarker; | ||
|
r1218 | friend class XYChart; | ||
|
r466 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r466 | |||
|
r2046 | #endif // QXYSERIES_H | ||