KD Chart API Documentation  3.1
KDChartLeveyJenningsGridAttributes.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Chart library.
4 **
5 ** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
12 
13 #include <QBrush>
14 #include <QMap>
15 #include <QPen>
16 
17 #include <KDABLibFakes>
18 
19 #define d d_func()
20 
21 using namespace KDChart;
22 
23 class LeveyJenningsGridAttributes::Private
24 {
25  friend class LeveyJenningsGridAttributes;
26 
27 public:
28  Private();
29 
30 private:
31  QMap<GridType, bool> visible;
34 };
35 
36 LeveyJenningsGridAttributes::Private::Private()
37 {
38  pens[Calculated].setCapStyle(Qt::FlatCap);
39  pens[Calculated].setColor(Qt::blue);
40  pens[Expected].setCapStyle(Qt::FlatCap);
41  pens[Expected].setColor(Qt::black);
42 
43  visible[Calculated] = true;
44  visible[Expected] = true;
45 
46  rangeBrushes[LeveyJenningsGridAttributes::CriticalRange] = QBrush(QColor(255, 255, 192));
47  rangeBrushes[LeveyJenningsGridAttributes::OutOfRange] = QBrush(QColor(255, 128, 128));
48 }
49 
51  : _d(new Private())
52 {
53  // this block left empty intentionally
54 }
55 
57  : _d(new Private(*r.d))
58 {
59 }
60 
62 {
63  if (this == &r)
64  return *this;
65 
66  *d = *r.d;
67 
68  return *this;
69 }
70 
72 {
73  delete _d;
74  _d = nullptr;
75 }
76 
78 {
80 }
81 
82 void LeveyJenningsGridAttributes::setRangeBrush(Range range, const QBrush &brush)
83 {
84  d->rangeBrushes[range] = brush;
85 }
86 
88 {
89  return d->rangeBrushes[range];
90 }
91 
93 {
94  d->visible[type] = visible;
95 }
96 
98 {
99  return d->visible[type];
100 }
101 
103 {
104  d->pens[type] = pen;
105  d->pens[type].setCapStyle(Qt::FlatCap);
106 }
107 
109 {
110  return d->pens[type];
111 }
A set of attributes controlling the appearance of grids.
LeveyJenningsGridAttributes & operator=(const LeveyJenningsGridAttributes &)
bool operator==(const LeveyJenningsGridAttributes &) const
void setRangeBrush(Range range, const QBrush &brush)

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated by doxygen 1.9.1