KD Chart API Documentation 3.0
Loading...
Searching...
No Matches
KDChartGlobal.h
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****************************************************************************/
15#ifndef __KDCHARTGLOBAL_H__
16#define __KDCHARTGLOBAL_H__
17
18#include <qglobal.h>
19
20#include "kdchart_export.h"
21
22#ifndef KDAB_SET_OBJECT_NAME
23template<typename T>
25{
26 return o;
27}
28
29template<typename T>
31{
32 return *o;
33}
34
35#define KDAB_SET_OBJECT_NAME(x) __kdab__dereference_for_methodcall(x).setObjectName(QLatin1String(#x))
36#endif
37
38#define KDCHART_DECLARE_PRIVATE_DERIVED(X) \
39public: \
40 class Private; \
41 \
42protected: \
43 inline Private *d_func(); \
44 inline const Private *d_func() const; \
45 explicit inline X(Private *); \
46 \
47private: \
48 void init();
49
50#define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType) \
51public: \
52 class Private; \
53 \
54protected: \
55 inline Private *d_func(); \
56 inline const Private *d_func() const; \
57 explicit inline X(Private *, ParentType); \
58 \
59private: \
60 void init();
61
62#define KDCHART_DECLARE_PRIVATE_DERIVED_QWIDGET(X) \
63 KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, QWidget *)
64
65#define KDCHART_DECLARE_PRIVATE_BASE_VALUE(X) \
66public: \
67 inline void swap(X &other) \
68 { \
69 qSwap(_d, other._d); \
70 } \
71 \
72protected: \
73 class Private; \
74 Private *d_func() \
75 { \
76 return _d; \
77 } \
78 const Private *d_func() const \
79 { \
80 return _d; \
81 } \
82 \
83private: \
84 void init(); \
85 Private *_d;
86
87#define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC(X) \
88public: \
89 class Private; \
90 \
91protected: \
92 Private *d_func() \
93 { \
94 return _d; \
95 } \
96 const Private *d_func() const \
97 { \
98 return _d; \
99 } \
100 explicit inline X(Private *); \
101 \
102private: \
103 void init(); \
104 Private *_d;
105
106#define KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET(X) \
107public: \
108 class Private; \
109 \
110protected: \
111 Private *d_func() \
112 { \
113 return _d; \
114 } \
115 const Private *d_func() const \
116 { \
117 return _d; \
118 } \
119 explicit inline X(Private *, QWidget *); \
120 \
121private: \
122 void init(); \
123 Private *_d;
124
125#define KDCHART_DERIVED_PRIVATE_FOOTER(CLASS, PARENT) \
126 inline CLASS::CLASS(Private *p) \
127 : PARENT(p) \
128 { \
129 init(); \
130 } \
131 inline CLASS::Private *CLASS::d_func() \
132 { \
133 return static_cast<Private *>(PARENT::d_func()); \
134 } \
135 inline const CLASS::Private *CLASS::d_func() const \
136 { \
137 return static_cast<const Private *>(PARENT::d_func()); \
138 }
139
140#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE) \
141public: \
142 class Private; \
143 \
144protected: \
145 inline Private *d_func(); \
146 inline const Private *d_func() const; \
147 explicit inline X(Private *); \
148 explicit inline X(Private *, QWidget *, PLANE *); \
149 \
150private: \
151 void init();
152
153#define KDCHART_IMPL_DERIVED_DIAGRAM(CLASS, PARENT, PLANE) \
154 inline CLASS::CLASS(Private *p) \
155 : PARENT(p) \
156 { \
157 init(); \
158 } \
159 inline CLASS::CLASS( \
160 Private *p, QWidget *parent, PLANE *plane) \
161 : PARENT(p, parent, plane) \
162 { \
163 init(); \
164 } \
165 inline CLASS::Private *CLASS::d_func() \
166 { \
167 return static_cast<Private *>(PARENT::d_func()); \
168 } \
169 inline const CLASS::Private *CLASS::d_func() const \
170 { \
171 return static_cast<const Private *>(PARENT::d_func()); \
172 }
173
174#define KDCHART_IMPL_DERIVED_PLANE(CLASS, BASEPLANE) \
175 inline CLASS::CLASS(Private *p, Chart *parent) \
176 : BASEPLANE(p, parent) \
177 { \
178 init(); \
179 } \
180 inline CLASS::Private *CLASS::d_func() \
181 { \
182 return static_cast<Private *>(BASEPLANE::d_func()); \
183 } \
184 inline const CLASS::Private *CLASS::d_func() const \
185 { \
186 return static_cast<const Private *>(BASEPLANE::d_func()); \
187 }
188
189#include <QtAlgorithms> // qSwap
190#ifndef QT_NO_STL
191#include <algorithm>
192#define KDCHART_DECLARE_SWAP_SPECIALISATION(X) \
193 QT_BEGIN_NAMESPACE \
194 template<> \
195 inline void qSwap<X>(X & lhs, X & rhs) \
196 { \
197 lhs.swap(rhs); \
198 } \
199 QT_END_NAMESPACE \
200 namespace std { \
201 template<> \
202 inline void swap<X>(X & lhs, X &rhs) \
203 { \
204 lhs.swap(rhs); \
205 } \
206 }
207#else
208#define KDCHART_DECLARE_SWAP_SPECIALISATION(X) \
209 QT_BEGIN_NAMESPACE \
210 template<> \
211 inline void qSwap<X>(X & lhs, X & rhs) \
212 { \
213 lhs.swap(rhs); \
214 } \
215 QT_END_NAMESPACE
216#endif
217
218#define KDCHART_DECLARE_SWAP_SPECIALISATION_DERIVED(X) \
219 KDCHART_DECLARE_SWAP_SPECIALISATION(X)
220
221#define KDCHART_DECLARE_SWAP_BASE(X) \
222protected: \
223 void doSwap(X &other) \
224 { \
225 qSwap(_d, other._d); \
226 }
227
228#define KDCHART_DECLARE_SWAP_DERIVED(X) \
229 void swap(X &other) \
230 { \
231 doSwap(other); \
232 }
233
234#if defined(Q_OS_WIN) && defined(QT_DLL)
235#if defined(_MSC_VER) && _MSC_VER >= 1300
236// workaround old msvc bug 309801 (link under support.microsoft.com no longer exists
237#include <QPointF>
238#include <QVector>
239template class Q_DECL_IMPORT QVector<QPointF>;
240#endif
241#endif
242
243#include <Qt>
244
245namespace KDChart {
246
264}
265
266#endif // __KDCHARTGLOBAL_H__
T & __kdab__dereference_for_methodcall(T &o)
@ DataValueLabelAttributesRole
@ LineAttributesRole
@ ThreeDLineAttributesRole
@ ThreeDBarAttributesRole
@ ThreeDPieAttributesRole
@ ThreeDAttributesRole
@ StockBarAttributesRole
@ PieAttributesRole
@ BarAttributesRole
@ ValueTrackerAttributesRole

© 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 on Fri Feb 23 2024 00:02:58 for KD Chart API Documentation by doxygen 1.9.8