1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Charts module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 or (at your option) any later version
20** approved by the KDE Free Qt Foundation. The licenses are as published by
21** the Free Software Foundation and appearing in the file LICENSE.GPL3
22** included in the packaging of this file. Please review the following
23** information to ensure the GNU General Public License requirements will
24** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25**
26** $QT_END_LICENSE$
27**
28****************************************************************************/
29
30// W A R N I N G
31// -------------
32//
33// This file is not part of the Qt Chart API. It exists purely as an
34// implementation detail. This header file may change from version to
35// version without notice, or even be removed.
36//
37// We mean it.
38
39#ifndef CHARTTHEME_H
40#define CHARTTHEME_H
41
42#include <private/chartthememanager_p.h>
43#include <QtGui/QColor>
44#include <QtGui/QGradientStops>
45#include <QtCharts/private/qchartglobal_p.h>
46
47QT_CHARTS_BEGIN_NAMESPACE
48
49class Q_CHARTS_PRIVATE_EXPORT ChartTheme
50{
51
52public:
53 enum BackgroundShadesMode {
54 BackgroundShadesNone = 0,
55 BackgroundShadesVertical,
56 BackgroundShadesHorizontal,
57 BackgroundShadesBoth
58 };
59
60protected:
61 explicit ChartTheme(QChart::ChartTheme id = QChart::ChartThemeLight):m_id(id),
62 m_backgroundShadesBrush(Qt::SolidPattern),
63 m_backgroundShades(BackgroundShadesNone),
64 m_backgroundDropShadowEnabled(false)
65 {};
66public:
67 QChart::ChartTheme id() const { return m_id; }
68 QList<QGradient> seriesGradients() const { return m_seriesGradients; }
69 QList<QColor> seriesColors() const { return m_seriesColors; }
70 QLinearGradient chartBackgroundGradient() const { return m_chartBackgroundGradient; }
71 QFont masterFont() const { return m_masterFont; }
72 QFont labelFont() const { return m_labelFont; }
73 QBrush labelBrush() const { return m_labelBrush; }
74 QPen axisLinePen() const { return m_axisLinePen; }
75 QPen backgroundShadesPen() const { return m_backgroundShadesPen; }
76 QPen outlinePen() const { return m_outlinePen; }
77 QBrush backgroundShadesBrush() const { return m_backgroundShadesBrush; }
78 BackgroundShadesMode backgroundShades() const { return m_backgroundShades; }
79 bool isBackgroundDropShadowEnabled() const { return m_backgroundDropShadowEnabled; }
80 QPen gridLinePen() const { return m_gridLinePen; }
81 QPen minorGridLinePen() const { return m_minorGridLinePen; }
82
83protected:
84 QChart::ChartTheme m_id;
85 QList<QColor> m_seriesColors;
86 QList<QGradient> m_seriesGradients;
87 QLinearGradient m_chartBackgroundGradient;
88
89 QFont m_masterFont;
90 QFont m_labelFont;
91 QBrush m_labelBrush;
92 QPen m_axisLinePen;
93 QPen m_backgroundShadesPen;
94 QPen m_outlinePen;
95 QBrush m_backgroundShadesBrush;
96 BackgroundShadesMode m_backgroundShades;
97 bool m_backgroundDropShadowEnabled;
98 QPen m_gridLinePen;
99 QPen m_minorGridLinePen;
100
101};
102
103QT_CHARTS_END_NAMESPACE
104
105#endif // CHARTTHEME_H
106

source code of qtcharts/src/charts/themes/charttheme_p.h