KD Chart API Documentation 3.0
Loading...
Searching...
No Matches
KDChartMarkerAttributes.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
12#include <QColor>
13#include <QDebug>
14#include <QMap>
15#include <QPainterPath>
16#include <QPen>
17#include <QSizeF>
18#include <qglobal.h>
19
20#include <KDABLibFakes>
21
22using namespace KDChart;
23
24class MarkerAttributes::Private
25{
26 friend class ::KDChart::MarkerAttributes;
27
28public:
29 Private();
30
31private:
32 bool visible = false;
33 bool threeD = false;
34 QMap<uint, uint> markerStylesMap;
35 uint markerStyle = MarkerSquare;
36 QSizeF markerSize;
37 QColor markerColor;
38 QPainterPath customMarkerPath;
39 QPen markerPen;
40};
41
42MarkerAttributes::Private::Private()
43 : markerSize(10, 10)
44 , markerPen(Qt::black)
45{
46}
47
49 : _d(new Private)
50{
51}
52
54 : _d(new Private(*r._d))
55{
56}
57
59{
60 MarkerAttributes copy(r);
61 copy.swap(*this);
62 return *this;
63}
64
66{
67 delete _d;
68 _d = nullptr;
69}
70
71#define d d_func()
72
74{
75 /*
76 qDebug() << "MarkerAttributes::operator== finds"
77 << "b" << (isVisible() == r.isVisible())
78 << "c" << (markerStylesMap() == r.markerStylesMap())
79 << "d" << (markerStyle() == r.markerStyle()) << markerStyle() <<r.markerStyle()
80 << "e" << (markerSize() == r.markerSize())
81 << "f" << (markerColor() == r.markerColor())
82 << "p" << (customMarkerPath() == r.customMarkerPath())
83 << "g" << (pen() == r.pen())
84 << "h" << (markerColor() == r.markerColor()) << markerColor() << r.markerColor();
85 */
86 return (isVisible() == r.isVisible() && markerStylesMap() == r.markerStylesMap() && markerStyle() == r.markerStyle() && markerSize() == r.markerSize() && markerColor() == r.markerColor() && customMarkerPath() == r.customMarkerPath() && pen() == r.pen());
87}
88
90{
91 d->visible = visible;
92}
93
95{
96 return d->visible;
97}
98
100{
101 d->threeD = value;
102}
103
105{
106 return d->threeD;
107}
108
110{
111 d->markerStylesMap = map;
112}
113
115{
116 return d->markerStylesMap;
117}
118
120{
121 d->markerStyle = style;
122}
123
125{
126 return d->markerStyle;
127}
128
130{
131 d->markerSize = size;
132}
133
135{
136 return d->markerSize;
137}
138
140{
141 d->markerColor = color;
142}
143
145{
146 return d->markerColor;
147}
148
150{
151 d->customMarkerPath = path;
152}
153
155{
156 return d->customMarkerPath;
157}
158
160{
161 d->markerPen = pen;
162}
163
165{
166 return d->markerPen;
167}
168
169#undef d
170
171#ifndef QT_NO_DEBUG_STREAM
173{
174 return dbg << "KDChart::MarkerAttributes("
175 << "visible=" << ma.isVisible()
176 << "markerStylesMap=" << ma.markerStylesMap()
177 << "markerStyle=" << ma.markerStyle()
178 << "markerColor=" << ma.markerColor()
179 << "customMarkerPath=" << ma.customMarkerPath()
180 << "pen=" << ma.pen()
181 << ")";
182}
183#endif
A set of attributes controlling the appearance of data set markers.
void setCustomMarkerPath(const QPainterPath &path)
void setMarkerStylesMap(const MarkerStylesMap &map)
MarkerAttributes & operator=(const MarkerAttributes &)
MarkerStylesMap markerStylesMap() const
void setMarkerSize(const QSizeF &size)
void setMarkerColor(const QColor &color)
bool operator==(const MarkerAttributes &) const
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 on Fri Feb 23 2024 00:02:58 for KD Chart API Documentation by doxygen 1.9.8