qabstractbarseries.h
121 lines
| 4.2 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 | |||
|
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) | ||||
|
r2802 | Q_PROPERTY(qreal labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) | ||
|
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; | ||||
|
r2802 | void setLabelsAngle(qreal angle); | ||
qreal labelsAngle() const; | ||||
|
r2689 | void setLabelsPosition(QAbstractBarSeries::LabelsPosition position); | ||
QAbstractBarSeries::LabelsPosition labelsPosition() const; | ||||
|
r943 | protected: | ||
|
r2871 | explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d, QObject *parent = Q_NULLPTR); | ||
|
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); | ||||
|
r2802 | void labelsAngleChanged(qreal angle); | ||
|
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 | ||