qabstractbarseries.h
113 lines
| 3.6 KiB
| text/x-c
|
CLexer
Titta Heikkala
|
r2845 | /****************************************************************************** | ||
Jani Honkonen
|
r794 | ** | ||
Titta Heikkala
|
r2845 | ** Copyright (C) 2015 The Qt Company Ltd. | ||
** Contact: http://www.qt.io/licensing/ | ||||
Jani Honkonen
|
r794 | ** | ||
Titta Heikkala
|
r2740 | ** This file is part of the Qt Charts module. | ||
Jani Honkonen
|
r794 | ** | ||
Titta Heikkala
|
r2845 | ** $QT_BEGIN_LICENSE:COMM$ | ||
Jani Honkonen
|
r794 | ** | ||
Titta Heikkala
|
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 | ||||
** and conditions see http://www.qt.io/terms-conditions. For further | ||||
** information use the contact form at http://www.qt.io/contact-us. | ||||
Jani Honkonen
|
r794 | ** | ||
Titta Heikkala
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
******************************************************************************/ | ||||
Jani Honkonen
|
r794 | |||
Jani Honkonen
|
r2046 | #ifndef QABSTRACTBARSERIES_H | ||
#define QABSTRACTBARSERIES_H | ||||
sauimone
|
r56 | |||
Titta Heikkala
|
r2714 | #include <QtCharts/QAbstractSeries> | ||
#include <QtCore/QStringList> | ||||
sauimone
|
r74 | |||
Titta Heikkala
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
sauimone
|
r56 | |||
sauimone
|
r172 | class QBarSet; | ||
sauimone
|
r1584 | class QAbstractBarSeriesPrivate; | ||
sauimone
|
r172 | |||
sauimone
|
r56 | // Container for series | ||
Titta Heikkala
|
r2712 | class QT_CHARTS_EXPORT QAbstractBarSeries : public QAbstractSeries | ||
sauimone
|
r56 | { | ||
sauimone
|
r71 | Q_OBJECT | ||
Tero Ahola
|
r1487 | Q_PROPERTY(qreal barWidth READ barWidth WRITE setBarWidth) | ||
Tero Ahola
|
r1462 | Q_PROPERTY(int count READ count NOTIFY countChanged) | ||
sauimone
|
r1429 | Q_PROPERTY(bool labelsVisible READ isLabelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) | ||
Titta Heikkala
|
r2692 | Q_PROPERTY(QString labelsFormat READ labelsFormat WRITE setLabelsFormat NOTIFY labelsFormatChanged) | ||
Q_PROPERTY(LabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged) | ||||
Miikka Heikkinen
|
r2802 | Q_PROPERTY(qreal labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) | ||
Titta Heikkala
|
r2689 | Q_ENUMS(LabelsPosition) | ||
public: | ||||
enum LabelsPosition { | ||||
LabelsCenter = 0, | ||||
LabelsInsideEnd, | ||||
LabelsInsideBase, | ||||
LabelsOutsideEnd | ||||
}; | ||||
Tero Ahola
|
r1302 | |||
sauimone
|
r1587 | public: | ||
sauimone
|
r1584 | virtual ~QAbstractBarSeries(); | ||
sauimone
|
r56 | |||
sauimone
|
r1425 | void setBarWidth(qreal width); | ||
qreal barWidth() const; | ||||
sauimone
|
r1283 | |||
sauimone
|
r1208 | bool append(QBarSet *set); | ||
bool remove(QBarSet *set); | ||||
sauimone
|
r1802 | bool take(QBarSet *set); | ||
Jani Honkonen
|
r2104 | bool append(QList<QBarSet *> sets); | ||
Marek Rosa
|
r1362 | bool insert(int index, QBarSet *set); | ||
Tero Ahola
|
r1462 | int count() const; | ||
Jani Honkonen
|
r2104 | QList<QBarSet *> barSets() const; | ||
Marek Rosa
|
r1295 | void clear(); | ||
Michal Klocek
|
r703 | |||
sauimone
|
r820 | void setLabelsVisible(bool visible = true); | ||
Marek Rosa
|
r1362 | bool isLabelsVisible() const; | ||
sauimone
|
r813 | |||
Titta Heikkala
|
r2689 | void setLabelsFormat(const QString &format); | ||
QString labelsFormat() const; | ||||
Miikka Heikkinen
|
r2802 | void setLabelsAngle(qreal angle); | ||
qreal labelsAngle() const; | ||||
Titta Heikkala
|
r2689 | void setLabelsPosition(QAbstractBarSeries::LabelsPosition position); | ||
QAbstractBarSeries::LabelsPosition labelsPosition() const; | ||||
Michal Klocek
|
r943 | protected: | ||
Jani Honkonen
|
r2097 | explicit QAbstractBarSeries(QAbstractBarSeriesPrivate &d, QObject *parent = 0); | ||
Michal Klocek
|
r943 | |||
sauimone
|
r775 | Q_SIGNALS: | ||
sauimone
|
r1563 | void clicked(int index, QBarSet *barset); | ||
Titta Heikkala
|
r2600 | void hovered(bool status, int index, QBarSet *barset); | ||
Titta Heikkala
|
r2739 | void pressed(int index, QBarSet *barset); | ||
void released(int index, QBarSet *barset); | ||||
void doubleClicked(int index, QBarSet *barset); | ||||
Tero Ahola
|
r1462 | void countChanged(); | ||
sauimone
|
r1353 | void labelsVisibleChanged(); | ||
Titta Heikkala
|
r2689 | void labelsFormatChanged(const QString &format); | ||
void labelsPositionChanged(QAbstractBarSeries::LabelsPosition position); | ||||
Miikka Heikkinen
|
r2802 | void labelsAngleChanged(qreal angle); | ||
sauimone
|
r1353 | |||
Jani Honkonen
|
r2104 | void barsetsAdded(QList<QBarSet *> sets); | ||
void barsetsRemoved(QList<QBarSet *> sets); | ||||
sauimone
|
r171 | |||
sauimone
|
r281 | protected: | ||
sauimone
|
r1584 | Q_DECLARE_PRIVATE(QAbstractBarSeries) | ||
sauimone
|
r1674 | friend class AbstractBarChartItem; | ||
sauimone
|
r962 | friend class PercentBarChartItem; | ||
friend class StackedBarChartItem; | ||||
Mika Salmela
|
r2548 | friend class BoxPlotChartItem; | ||
sauimone
|
r1674 | friend class BarChartItem; | ||
sauimone
|
r1681 | friend class HorizontalBarChartItem; | ||
sauimone
|
r1685 | friend class HorizontalStackedBarChartItem; | ||
sauimone
|
r1688 | friend class HorizontalPercentBarChartItem; | ||
Miikka Heikkinen
|
r2519 | friend class BarSet; | ||
sauimone
|
r56 | }; | ||
Titta Heikkala
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
sauimone
|
r56 | |||
Jani Honkonen
|
r2046 | #endif // QABSTRACTBARSERIES_H | ||