qxyseries.h
144 lines
| 5.1 KiB
| text/x-c
|
CLexer
|
r2854 | /**************************************************************************** | ||
|
r794 | ** | ||
|
r2854 | ** Copyright (C) 2016 The Qt Company Ltd. | ||
** Contact: https://www.qt.io/licensing/ | ||||
|
r794 | ** | ||
|
r2854 | ** This file is part of the Qt Charts module of the Qt Toolkit. | ||
|
r794 | ** | ||
|
r2854 | ** $QT_BEGIN_LICENSE:GPL$ | ||
|
r2845 | ** Commercial License Usage | ||
** Licensees holding valid commercial Qt licenses may use this file in | ||||
** accordance with the commercial license agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and The Qt Company. For licensing terms | ||||
|
r2854 | ** and conditions see https://www.qt.io/terms-conditions. For further | ||
** information use the contact form at https://www.qt.io/contact-us. | ||||
** | ||||
** GNU General Public License Usage | ||||
** Alternatively, this file may be used under the terms of the GNU | ||||
** General Public License version 3 or (at your option) any later version | ||||
** approved by the KDE Free Qt Foundation. The licenses are as published by | ||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||||
** included in the packaging of this file. Please review the following | ||||
** information to ensure the GNU General Public License requirements will | ||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||||
|
r794 | ** | ||
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
|
r2854 | ****************************************************************************/ | ||
|
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 | ||