KD Chart 2
[rev.2.5.1]
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
src
KDChart
KDChartFrameAttributes.cpp
Go to the documentation of this file.
1
/****************************************************************************
2
** Copyright (C) 2001-2013 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
51
FrameAttributes::FrameAttributes()
52
: _d( new Private() )
53
{
54
}
55
56
FrameAttributes::FrameAttributes
(
const
FrameAttributes
& r )
57
: _d( new Private( *r.
d
) )
58
{
59
}
60
61
FrameAttributes
&
FrameAttributes::operator=
(
const
FrameAttributes
& r )
62
{
63
if
(
this
== &r )
64
return
*
this
;
65
66
*
d
= *r.d;
67
68
return
*
this
;
69
}
70
71
FrameAttributes::~FrameAttributes
()
72
{
73
delete
_d; _d = 0;
74
}
75
76
77
bool
FrameAttributes::operator==
(
const
FrameAttributes
& r )
const
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
93
bool
FrameAttributes::isVisible
()
const
94
{
95
return
d
->visible;
96
}
97
98
void
FrameAttributes::setPen
(
const
QPen & pen )
99
{
100
d
->pen =
pen
;
101
}
102
103
QPen
FrameAttributes::pen
()
const
104
{
105
return
d
->pen;
106
}
107
108
void
FrameAttributes::setCornerRadius
(qreal radius)
109
{
110
d
->cornerRadius = radius;
111
}
112
113
qreal
FrameAttributes::cornerRadius
()
const
114
{
115
return
d
->cornerRadius;
116
}
117
118
void
FrameAttributes::setPadding
(
int
padding )
119
{
120
d
->padding =
padding
;
121
}
122
123
int
FrameAttributes::padding
()
const
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 */
Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/