KD Chart API Documentation  3.1
KDChartPieAttributes.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 "KDChartPieAttributes.h"
12 #include "KDChartPieAttributes_p.h"
13 
14 #include <QDebug>
15 
16 #include <KDABLibFakes>
17 
18 #define d d_func()
19 
20 using namespace KDChart;
21 
22 PieAttributes::Private::Private()
23 {
24 }
25 
27  : _d(new Private())
28 {
29 }
30 
32  : _d(new Private(*r.d))
33 {
34 }
35 
37 {
38  if (this == &r)
39  return *this;
40 
41  *d = *r.d;
42 
43  return *this;
44 }
45 
47 {
48  delete _d;
49  _d = nullptr;
50 }
51 
53 {
54  return explodeFactor() == r.explodeFactor() && gapFactor(true) == r.gapFactor(true) && gapFactor(false) == r.gapFactor(false);
55 }
56 
57 void PieAttributes::init()
58 {
59 }
60 
61 void PieAttributes::setExplode(bool enabled)
62 {
63  d->explodeFactor = (enabled ? 0.1 : 0.0);
64 }
65 
67 {
68  return (d->explodeFactor != 0.0);
69 }
70 
72 {
73  d->explodeFactor = factor;
74 }
75 
77 {
78  return d->explodeFactor;
79 }
80 
81 void PieAttributes::setGapFactor(bool circular, qreal factor)
82 {
83  if (circular)
84  d->tangentialGapFactor = factor;
85  else
86  d->radialGapFactor = factor;
87 }
88 
89 qreal PieAttributes::gapFactor(bool circular) const
90 {
91  return circular ? d->tangentialGapFactor : d->radialGapFactor;
92 }
93 
94 #if !defined(QT_NO_DEBUG_STREAM)
95 QDebug operator<<(QDebug dbg, const KDChart::PieAttributes &a)
96 {
97  dbg << "KDChart::PieAttributes(";
98  dbg << "explodeFactor=" << a.explodeFactor() << ")";
99  return dbg;
100 }
101 #endif /* QT_NO_DEBUG_STREAM */
#define d
A set of attributes controlling the appearance of pie charts.
qreal gapFactor(bool circular) const
PieAttributes & operator=(const PieAttributes &)
void setGapFactor(bool circular, qreal factor)
void setExplodeFactor(qreal factor)
bool operator==(const PieAttributes &) const
void setExplode(bool explode)
Enable or disable exploding the respective pie piece(s).
QDebug operator<<(QDebug stream, const DataDimension &r)

© 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