qbarset.h
118 lines
| 3.6 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
|
r2432 | ** Copyright (C) 2013 Digia Plc | ||
|
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$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r169 | #ifndef QBARSET_H | ||
#define QBARSET_H | ||||
|
r276 | #include <qchartglobal.h> | ||
|
r183 | #include <QPen> | ||
#include <QBrush> | ||||
|
r820 | #include <QFont> | ||
|
r169 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r934 | class QBarSetPrivate; | ||
|
r169 | |||
|
r239 | class QTCOMMERCIALCHART_EXPORT QBarSet : public QObject | ||
|
r169 | { | ||
|
r240 | Q_OBJECT | ||
|
r1429 | Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged) | ||
Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged) | ||||
Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged) | ||||
Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged) | ||||
Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged) | ||||
|
r1465 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | ||
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) | ||||
Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged) | ||||
|
r938 | |||
|
r169 | public: | ||
|
r1429 | explicit QBarSet(const QString label, QObject *parent = 0); | ||
|
r980 | virtual ~QBarSet(); | ||
|
r169 | |||
|
r1429 | void setLabel(const QString label); | ||
QString label() const; | ||||
|
r1159 | |||
|
r1246 | void append(const qreal value); | ||
|
r1500 | void append(const QList<qreal> &values); | ||
|
r1159 | |||
|
r2104 | QBarSet &operator << (const qreal &value); | ||
|
r1159 | |||
|
r1246 | void insert(const int index, const qreal value); | ||
|
r1514 | void remove(const int index, const int count = 1); | ||
|
r993 | void replace(const int index, const qreal value); | ||
|
r1580 | qreal at(const int index) const; | ||
|
r2097 | qreal operator [](const int index) const; | ||
|
r993 | int count() const; | ||
qreal sum() const; | ||||
|
r430 | |||
|
r763 | void setPen(const QPen &pen); | ||
|
r473 | QPen pen() const; | ||
|
r214 | |||
|
r763 | void setBrush(const QBrush &brush); | ||
|
r473 | QBrush brush() const; | ||
|
r214 | |||
|
r820 | void setLabelBrush(const QBrush &brush); | ||
QBrush labelBrush() const; | ||||
void setLabelFont(const QFont &font); | ||||
QFont labelFont() const; | ||||
|
r1465 | QColor color(); | ||
void setColor(QColor color); | ||||
QColor borderColor(); | ||||
void setBorderColor(QColor color); | ||||
QColor labelColor(); | ||||
void setLabelColor(QColor color); | ||||
|
r1353 | Q_SIGNALS: | ||
|
r1490 | void clicked(int index); | ||
void hovered(bool status); | ||||
|
r1353 | void penChanged(); | ||
void brushChanged(); | ||||
void labelChanged(); | ||||
void labelBrushChanged(); | ||||
void labelFontChanged(); | ||||
|
r1465 | void colorChanged(QColor color); | ||
void borderColorChanged(QColor color); | ||||
void labelColorChanged(QColor color); | ||||
|
r1353 | |||
void valuesAdded(int index, int count); | ||||
void valuesRemoved(int index, int count); | ||||
void valueChanged(int index); | ||||
|
r171 | private: | ||
|
r938 | QScopedPointer<QBarSetPrivate> d_ptr; | ||
|
r934 | Q_DISABLE_COPY(QBarSet) | ||
|
r1586 | friend class QAbstractBarSeries; | ||
|
r953 | friend class BarLegendMarker; | ||
|
r1674 | friend class AbstractBarChartItem; | ||
|
r1584 | friend class QAbstractBarSeriesPrivate; | ||
|
r1580 | friend class StackedBarChartItem; | ||
friend class PercentBarChartItem; | ||||
|
r1674 | friend class BarChartItem; | ||
|
r1681 | friend class HorizontalBarChartItem; | ||
|
r1685 | friend class HorizontalStackedBarChartItem; | ||
|
r1688 | friend class HorizontalPercentBarChartItem; | ||
|
r169 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QBARSET_H | ||||