KD Chart 2  [rev.2.7]
KDChartFrameAttributes.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #include "KDChartFrameAttributes.h"
24 
25 #include <KDABLibFakes>
26 
27 #define d d_func()
28 
29 using namespace KDChart;
30 
31 class FrameAttributes::Private
32 {
33  friend class FrameAttributes;
34 public:
35  Private();
36 private:
37  bool visible;
38  QPen pen;
39  qreal cornerRadius;
40  int padding;
41 };
42 
43 FrameAttributes::Private::Private() :
44  visible( false ),
45  cornerRadius( 0 ),
46  padding( 0 )
47 {
48 }
49 
50 
52  : _d( new Private() )
53 {
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; _d = 0;
74 }
75 
76 
78 {
79  return ( isVisible() == r.isVisible() &&
80  pen() == r.pen() &&
81  cornerRadius() == r.cornerRadius() &&
82  padding() == r.padding() );
83 }
84 
85 
86 
87 
88 void FrameAttributes::setVisible( bool visible )
89 {
90  d->visible = visible;
91 }
92 
94 {
95  return d->visible;
96 }
97 
98 void FrameAttributes::setPen( const QPen & pen )
99 {
100  d->pen = pen;
101 }
102 
104 {
105  return d->pen;
106 }
107 
109 {
110  d->cornerRadius = radius;
111 }
112 
114 {
115  return d->cornerRadius;
116 }
117 
119 {
120  d->padding = padding;
121 }
122 
124 {
125  return d->padding;
126 }
127 
128 #if !defined(QT_NO_DEBUG_STREAM)
129 QDebug operator<<(QDebug dbg, const KDChart::FrameAttributes& fa)
130 {
131  dbg << "KDChart::FrameAttributes("
132  << "visible="<<fa.isVisible()
133  << "pen="<<fa.pen()
134  << "cornerRadius="<<fa.cornerRadius()
135  << "padding="<<fa.padding()
136  << ")";
137  return dbg;
138 }
139 #endif /* QT_NO_DEBUG_STREAM */
FrameAttributes & operator=(const FrameAttributes &)
A set of attributes for frames around items.
#define d
QDebug operator<<(QDebug stream, const DataDimension &r)
bool operator==(const FrameAttributes &) const

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/