KD Chart API Documentation  3.1
KDChartBarAttributes.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 
11 #include "KDChartBarAttributes.h"
12 #include <qglobal.h>
13 
14 #include <KDABLibFakes>
15 
16 #define d d_func()
17 
18 using namespace KDChart;
19 
20 class BarAttributes::Private
21 {
22  friend class BarAttributes;
23 
24 public:
25  Private();
26 
27 private:
28  qreal datasetGap = 6;
29  bool useFixedDatasetGap = false;
30  qreal valueBlockGap = 24;
31  bool useFixedValueBlockGap = false;
32  qreal barWidth = -1;
33  bool useFixedBarWidth = false;
34  bool drawSolidExcessArrows = false;
35  qreal groupGapFactor = 2.0;
36  qreal barGapFactor = 0.4;
37 };
38 
39 BarAttributes::Private::Private()
40 {
41 }
42 
44  : _d(new Private())
45 {
46 }
47 
49  : _d(new Private(*r.d))
50 {
51 }
52 
54 {
55  if (this == &r)
56  return *this;
57 
58  *d = *r.d;
59 
60  return *this;
61 }
62 
64 {
65  delete _d;
66  _d = nullptr;
67 }
68 
70 {
72  return true;
73  else
74  return false;
75 }
76 
78 {
79  d->datasetGap = gap;
80 }
81 
83 {
84  return d->datasetGap;
85 }
86 
88 {
89  d->useFixedDatasetGap = gapIsFixed;
90 }
91 
93 {
94  return d->useFixedDatasetGap;
95 }
96 
98 {
99  d->valueBlockGap = gap;
100 }
101 
103 {
104  return d->valueBlockGap;
105 }
106 
108 {
109  d->useFixedValueBlockGap = gapIsFixed;
110 }
111 
113 {
114  return d->useFixedValueBlockGap;
115 }
116 
118 {
119  d->barWidth = width;
120 }
121 
123 {
124  return d->barWidth;
125 }
126 
127 void BarAttributes::setUseFixedBarWidth(bool useFixedBarWidth)
128 {
129  d->useFixedBarWidth = useFixedBarWidth;
130 }
131 
133 {
134  return d->useFixedBarWidth;
135 }
136 
137 void BarAttributes::setGroupGapFactor(qreal gapFactor)
138 {
139  d->groupGapFactor = gapFactor;
140 }
141 
143 {
144  return d->groupGapFactor;
145 }
146 
147 void BarAttributes::setBarGapFactor(qreal gapFactor)
148 {
149  d->barGapFactor = gapFactor;
150 }
151 
153 {
154  return d->barGapFactor;
155 }
156 
158 {
159  d->drawSolidExcessArrows = solidArrows;
160 }
161 
163 {
164  return d->drawSolidExcessArrows;
165 }
#define d
Set of attributes for changing the appearance of bar charts.
void setBarGapFactor(qreal gapFactor)
void setUseFixedDataValueGap(bool gapIsFixed)
BarAttributes & operator=(const BarAttributes &)
void setFixedValueBlockGap(qreal gap)
bool operator==(const BarAttributes &) const
void setUseFixedBarWidth(bool useFixedBarWidth)
void setFixedBarWidth(qreal width)
void setFixedDataValueGap(qreal gap)
void setDrawSolidExcessArrows(bool solidArrows)
void setUseFixedValueBlockGap(bool gapIsFixed)
void setGroupGapFactor(qreal gapFactor)

© 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