qcategoryaxis.h
91 lines
| 2.9 KiB
| text/x-c
|
CLexer
|
r2854 | /**************************************************************************** | ||
|
r1540 | ** | ||
|
r2854 | ** Copyright (C) 2016 The Qt Company Ltd. | ||
** Contact: https://www.qt.io/licensing/ | ||||
|
r1540 | ** | ||
|
r2854 | ** This file is part of the Qt Charts module of the Qt Toolkit. | ||
|
r1540 | ** | ||
|
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. | ||||
|
r1540 | ** | ||
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
|
r2854 | ****************************************************************************/ | ||
|
r1540 | |||
|
r1935 | #ifndef QCATEGORYAXIS_H | ||
#define QCATEGORYAXIS_H | ||||
|
r1540 | |||
|
r2714 | #include <QtCharts/QAbstractAxis> | ||
#include <QtCharts/QValueAxis> | ||||
|
r1540 | |||
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
|
r1540 | |||
|
r1816 | class QCategoryAxisPrivate; | ||
|
r1540 | |||
|
r2712 | class QT_CHARTS_EXPORT QCategoryAxis : public QValueAxis | ||
|
r1540 | { | ||
Q_OBJECT | ||||
|
r1834 | Q_PROPERTY(qreal startValue READ startValue WRITE setStartValue) | ||
|
r2244 | Q_PROPERTY(int count READ count) | ||
Q_PROPERTY(QStringList categoriesLabels READ categoriesLabels) | ||||
|
r2780 | Q_PROPERTY(AxisLabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged) | ||
Q_ENUMS(AxisLabelsPosition) | ||||
|
r1540 | |||
public: | ||||
|
r2780 | |||
enum AxisLabelsPosition { | ||||
AxisLabelsPositionCenter = 0x0, | ||||
AxisLabelsPositionOnValue = 0x1 | ||||
}; | ||||
|
r1816 | explicit QCategoryAxis(QObject *parent = 0); | ||
~QCategoryAxis(); | ||||
|
r1540 | |||
protected: | ||||
|
r2097 | QCategoryAxis(QCategoryAxisPrivate &d, QObject *parent = 0); | ||
|
r1540 | |||
public: | ||||
AxisType type() const; | ||||
|
r1613 | |||
|
r2104 | void append(const QString &label, qreal categoryEndValue); | ||
void remove(const QString &label); | ||||
void replaceLabel(const QString &oldLabel, const QString &newLabel); | ||||
|
r1613 | |||
|
r2104 | qreal startValue(const QString &categoryLabel = QString()) const; | ||
|
r1829 | void setStartValue(qreal min); | ||
|
r1613 | |||
|
r2104 | qreal endValue(const QString &categoryLabel) const; | ||
|
r1613 | |||
|
r1829 | QStringList categoriesLabels(); | ||
|
r1541 | int count() const; | ||
|
r1578 | |||
|
r2780 | QCategoryAxis::AxisLabelsPosition labelsPosition() const; | ||
void setLabelsPosition(QCategoryAxis::AxisLabelsPosition position); | ||||
|
r2483 | Q_SIGNALS: | ||
void categoriesChanged(); | ||||
|
r2780 | void labelsPositionChanged(QCategoryAxis::AxisLabelsPosition position); | ||
|
r2483 | |||
|
r1540 | private: | ||
|
r1816 | Q_DECLARE_PRIVATE(QCategoryAxis) | ||
Q_DISABLE_COPY(QCategoryAxis) | ||||
|
r1540 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r1540 | |||
|
r1935 | #endif // QCATEGORYAXIS_H | ||