KD Chart 2
[rev.2.7]
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
KDChart
KDChartGlobal.h
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
**********************************************************************/
27
#ifndef __KDCHARTGLOBAL_H__
28
#define __KDCHARTGLOBAL_H__
29
30
#include <qglobal.h>
31
32
#include "kdchart_export.h"
33
34
#ifndef KDAB_SET_OBJECT_NAME
35
template
<
typename
T>
36
inline
T &
__kdab__dereference_for_methodcall
( T & o ) {
37
return
o;
38
}
39
40
template
<
typename
T>
41
inline
T &
__kdab__dereference_for_methodcall
( T * o ) {
42
return
*o;
43
}
44
45
#define KDAB_SET_OBJECT_NAME( x ) __kdab__dereference_for_methodcall( x ).setObjectName( QLatin1String( #x ) )
46
#endif
47
48
#define KDCHART_DECLARE_PRIVATE_DERIVED( X ) \
49
public: \
50
class Private; \
51
protected: \
52
inline Private * d_func(); \
53
inline const Private * d_func() const; \
54
explicit inline X( Private * ); \
55
private: \
56
void init();
57
58
#define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( X, ParentType ) \
59
public: \
60
class Private; \
61
protected: \
62
inline Private * d_func(); \
63
inline const Private * d_func() const; \
64
explicit inline X( Private *, ParentType ); \
65
private: \
66
void init();
67
68
#define KDCHART_DECLARE_PRIVATE_DERIVED_QWIDGET( X ) \
69
KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( X, QWidget* )
70
71
#define KDCHART_DECLARE_PRIVATE_BASE_VALUE( X ) \
72
public: \
73
inline void swap( X & other ) { qSwap( _d, other._d ); } \
74
protected: \
75
class Private; \
76
Private * d_func() { return _d; } \
77
const Private * d_func() const { return _d; } \
78
private: \
79
void init(); \
80
Private * _d;
81
82
#define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC( X ) \
83
public: \
84
class Private; \
85
protected: \
86
Private * d_func() { return _d; } \
87
const Private * d_func() const { return _d; } \
88
explicit inline X( Private * ); \
89
private: \
90
void init(); \
91
Private * _d;
92
93
#define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET( X ) \
94
public: \
95
class Private; \
96
protected: \
97
Private * d_func() { return _d; } \
98
const Private * d_func() const { return _d; } \
99
explicit inline X( Private *, QWidget* ); \
100
private: \
101
void init(); \
102
Private * _d;
103
104
#define KDCHART_DERIVED_PRIVATE_FOOTER( CLASS, PARENT ) \
105
inline CLASS::CLASS( Private * p ) \
106
: PARENT( p ) { init(); } \
107
inline CLASS::Private * CLASS::d_func() \
108
{ return static_cast<Private*>( PARENT::d_func() ); } \
109
inline const CLASS::Private * CLASS::d_func() const \
110
{ return static_cast<const Private*>( PARENT::d_func() ); }
111
112
113
#define KDCHART_DECLARE_DERIVED_DIAGRAM( X, PLANE ) \
114
public: \
115
class Private; \
116
protected: \
117
inline Private * d_func(); \
118
inline const Private * d_func() const; \
119
explicit inline X( Private * ); \
120
explicit inline X( Private *, QWidget *, PLANE * ); \
121
private: \
122
void init();
123
124
#define KDCHART_IMPL_DERIVED_DIAGRAM( CLASS, PARENT, PLANE ) \
125
inline CLASS::CLASS( Private * p ) \
126
: PARENT( p ) { init(); } \
127
inline CLASS::CLASS( \
128
Private * p, QWidget* parent, PLANE * plane ) \
129
: PARENT( p, parent, plane ) { init(); } \
130
inline CLASS::Private * CLASS::d_func() \
131
{ return static_cast<Private *>( PARENT::d_func() ); } \
132
inline const CLASS::Private * CLASS::d_func() const \
133
{ return static_cast<const Private *>( PARENT::d_func() ); }
134
135
136
#define KDCHART_IMPL_DERIVED_PLANE( CLASS, BASEPLANE ) \
137
inline CLASS::CLASS( Private * p, Chart* parent ) \
138
: BASEPLANE( p, parent ) { init(); } \
139
inline CLASS::Private * CLASS::d_func() \
140
{ return static_cast<Private *>( BASEPLANE::d_func() ); } \
141
inline const CLASS::Private * CLASS::d_func() const \
142
{ return static_cast<const Private *>( BASEPLANE::d_func() ); }
143
144
145
#include <QtAlgorithms>
// qSwap
146
#ifndef QT_NO_STL
147
#include <algorithm>
148
#define KDCHART_DECLARE_SWAP_SPECIALISATION( X ) \
149
QT_BEGIN_NAMESPACE \
150
template <> inline void qSwap<X>( X & lhs, X & rhs ) \
151
{ lhs.swap( rhs ); } \
152
QT_END_NAMESPACE \
153
namespace std { \
154
template <> inline void swap<X>( X & lhs, X & rhs ) \
155
{ lhs.swap( rhs ); } \
156
}
157
#else
158
#define KDCHART_DECLARE_SWAP_SPECIALISATION( X ) \
159
QT_BEGIN_NAMESPACE \
160
template <> inline void qSwap<X>( X & lhs, X & rhs ) \
161
{ lhs.swap( rhs ); } \
162
QT_END_NAMESPACE
163
#endif
164
165
#define KDCHART_DECLARE_SWAP_SPECIALISATION_DERIVED( X ) \
166
KDCHART_DECLARE_SWAP_SPECIALISATION( X )
167
168
#define KDCHART_DECLARE_SWAP_BASE( X ) \
169
protected: \
170
void doSwap( X& other ) \
171
{ qSwap( _d, other._d); }
172
173
#define KDCHART_DECLARE_SWAP_DERIVED( X ) \
174
void swap( X& other ) { doSwap( other ); }
175
176
#if defined(Q_OS_WIN) && defined(QT_DLL)
177
#if defined(_MSC_VER) && _MSC_VER >= 1300
178
// workaround old msvc bug 309801 (link under support.microsoft.com no longer exists
179
#include <QPointF>
180
#include <QVector>
181
template
class
Q_DECL_IMPORT
QVector<QPointF>
;
182
#endif
183
#endif
184
185
#include <Qt>
186
187
namespace
KDChart
{
188
189
enum
DisplayRoles
{
190
DatasetPenRole
= 0x0A79EF95,
191
DatasetBrushRole
,
192
DataValueLabelAttributesRole
,
193
ThreeDAttributesRole
,
194
LineAttributesRole
,
195
ThreeDLineAttributesRole
,
196
BarAttributesRole
,
197
StockBarAttributesRole
,
198
ThreeDBarAttributesRole
,
199
PieAttributesRole
,
200
ThreeDPieAttributesRole
,
201
DataHiddenRole
,
202
ValueTrackerAttributesRole
,
203
CommentRole
204
};
205
}
206
207
#endif // __KDCHARTGLOBAL_H__
KDChart::CommentRole
Definition:
KDChartGlobal.h:203
__kdab__dereference_for_methodcall
T & __kdab__dereference_for_methodcall(T &o)
Definition:
KDChartGlobal.h:36
KDChart::ThreeDBarAttributesRole
Definition:
KDChartGlobal.h:198
KDChart::LineAttributesRole
Definition:
KDChartGlobal.h:194
KDChart::StockBarAttributesRole
Definition:
KDChartGlobal.h:197
KDChart::DataValueLabelAttributesRole
Definition:
KDChartGlobal.h:192
KDChart::BarAttributesRole
Definition:
KDChartGlobal.h:196
KDChart
Definition:
KDChartAbstractCartesianDiagram.h:30
KDChart::ThreeDAttributesRole
Definition:
KDChartGlobal.h:193
KDChart::DatasetPenRole
Definition:
KDChartGlobal.h:190
KDChart::DisplayRoles
DisplayRoles
Definition:
KDChartGlobal.h:189
KDChart::PieAttributesRole
Definition:
KDChartGlobal.h:199
KDChart::ValueTrackerAttributesRole
Definition:
KDChartGlobal.h:202
KDChart::DatasetBrushRole
Definition:
KDChartGlobal.h:191
KDChart::ThreeDLineAttributesRole
Definition:
KDChartGlobal.h:195
KDChart::DataHiddenRole
Definition:
KDChartGlobal.h:201
KDChart::ThreeDPieAttributesRole
Definition:
KDChartGlobal.h:200
QVector
Definition:
KDChartWidget.h:34
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/