qabstractbarseries.h
105 lines
| 3.3 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 | ** | ||
****************************************************************************/ | ||||
|
r2046 | #ifndef QABSTRACTBARSERIES_H | ||
#define QABSTRACTBARSERIES_H | ||||
|
r56 | |||
|
r2714 | #include <QtCharts/QAbstractSeries> | ||
#include <QtCore/QStringList> | ||||
|
r74 | |||
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
|
r56 | |||
|
r172 | class QBarSet; | ||
|
r1584 | class QAbstractBarSeriesPrivate; | ||
|
r172 | |||
|
r56 | // Container for series | ||
|
r2712 | class QT_CHARTS_EXPORT QAbstractBarSeries : public QAbstractSeries | ||
|
r56 | { | ||
|
r71 | Q_OBJECT | ||
|
r1487 | Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth) | ||
|
r1462 | Q_PROPERTY(int count READ count NOTIFY countChanged) | ||
|
r1429 | Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) | ||
|
r2692 | Q_PROPERTY(QString labelsFormat READ labelsFormat WRITE setLabelsFormat NOTIFY labelsFormatChanged) | ||
Q_PROPERTY(LabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged) | ||||
|
r2689 | Q_ENUMS(LabelsPosition) | ||
public: | ||||
enum LabelsPosition { | ||||
LabelsCenter = 0, | ||||
LabelsInsideEnd, | ||||
LabelsInsideBase, | ||||
LabelsOutsideEnd | ||||
}; | ||||
|
r1302 | |||
|
r1587 | public: | ||
|
r1584 | virtual ~QAbstractBarSeries(); | ||
|
r56 | |||
|
r1425 | void setBarWidth(qreal width); | ||
qreal barWidth() const; | ||||
|
r1283 | |||
|
r1208 | bool append(QBarSet *set); | ||
bool remove(QBarSet *set); | ||||
|
r1802 | bool take(QBarSet *set); | ||
|
r2104 | bool append(QList<QBarSet *> sets); | ||
|
r1362 | bool insert(int index, QBarSet *set); | ||
|
r1462 | int count() const; | ||
|
r2104 | QList<QBarSet *> barSets() const; | ||
|
r1295 | void clear(); | ||
|
r703 | |||
|
r820 | void setLabelsVisible(bool visible = true); | ||
|
r1362 | bool isLabelsVisible() const; | ||
|
r813 | |||
|
r2689 | void setLabelsFormat(const QString &format); | ||
QString labelsFormat() const; | ||||
void setLabelsPosition(QAbstractBarSeries::LabelsPosition position); | ||||
QAbstractBarSeries::LabelsPosition labelsPosition() const; | ||||
|
r943 | protected: | ||
|
r2097 | explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d, QObject *parent = 0); | ||
|
r943 | |||
|
r775 | Q_SIGNALS: | ||
|
r1563 | void clicked(int index, QBarSet *barset); | ||
|
r2600 | void hovered(bool status, int index, QBarSet *barset); | ||
|
r2739 | void pressed(int index, QBarSet *barset); | ||
void released(int index, QBarSet *barset); | ||||
void doubleClicked(int index, QBarSet *barset); | ||||
|
r1462 | void countChanged(); | ||
|
r1353 | void labelsVisibleChanged(); | ||
|
r2689 | void labelsFormatChanged(const QString &format); | ||
void labelsPositionChanged(QAbstractBarSeries::LabelsPosition position); | ||||
|
r1353 | |||
|
r2104 | void barsetsAdded(QList<QBarSet *> sets); | ||
void barsetsRemoved(QList<QBarSet *> sets); | ||||
|
r171 | |||
|
r281 | protected: | ||
|
r1584 | Q_DECLARE_PRIVATE(QAbstractBarSeries) | ||
|
r1674 | friend class AbstractBarChartItem; | ||
|
r962 | friend class PercentBarChartItem; | ||
friend class StackedBarChartItem; | ||||
|
r2548 | friend class BoxPlotChartItem; | ||
|
r1674 | friend class BarChartItem; | ||
|
r1681 | friend class HorizontalBarChartItem; | ||
|
r1685 | friend class HorizontalStackedBarChartItem; | ||
|
r1688 | friend class HorizontalPercentBarChartItem; | ||
|
r2519 | friend class BarSet; | ||
|
r56 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r56 | |||
|
r2046 | #endif // QABSTRACTBARSERIES_H | ||