##// END OF EJS Templates
Fixed a bug in setting scatter/area series brush color
Tero Ahola -
r1933:8e404718d98e
parent child
Show More
@@ -48,6 +48,9 Rectangle {
48 48
49 49 AreaSeries {
50 50 name: "Russian"
51 color: "#FFD52B1E"
52 borderColor: "#FF0039A5"
53 borderWidth: 3
51 54 axisX: categoriesAxis
52 55 upperSeries: LineSeries {
53 56 XYPoint { x: 0; y: 1 }
@@ -69,6 +72,9 Rectangle {
69 72
70 73 AreaSeries {
71 74 name: "Swedish"
75 color: "#AF005292"
76 borderColor: "#AFFDCA00"
77 borderWidth: 3
72 78 axisX: categoriesAxis
73 79 upperSeries: LineSeries {
74 80 XYPoint { x: 0; y: 1 }
@@ -88,6 +94,9 Rectangle {
88 94
89 95 AreaSeries {
90 96 name: "Finnish"
97 color: "#00357F"
98 borderColor: "#FEFEFE"
99 borderWidth: 3
91 100 axisX: categoriesAxis
92 101 upperSeries: LineSeries {
93 102 XYPoint { x: 0; y: 0 }
@@ -103,10 +112,6 Rectangle {
103 112 XYPoint { x: 10; y: 0 }
104 113 XYPoint { x: 11; y: 1 }
105 114 }
106 onClicked: {
107 color = "white";
108 borderColor = "blue";
109 }
110 115 }
111 116 }
112 117 }
@@ -248,8 +248,11 void QAreaSeries::setBrush(const QBrush &brush)
248 248 {
249 249 Q_D(QAreaSeries);
250 250 if (d->m_brush != brush) {
251 bool emitColorChanged = brush.color() != d->m_brush.color();
251 252 d->m_brush = brush;
252 253 emit d->updated();
254 if (emitColorChanged)
255 emit colorChanged(brush.color());
253 256 }
254 257 }
255 258
@@ -262,11 +265,10 QBrush QAreaSeries::brush() const
262 265 void QAreaSeries::setColor(const QColor &color)
263 266 {
264 267 QBrush b = brush();
265 if (b.color() != color) {
266 b.setColor(color);
267 setBrush(b);
268 emit colorChanged(color);
269 }
268 if (b == QBrush())
269 b.setStyle(Qt::SolidPattern);
270 b.setColor(color);
271 setBrush(b);
270 272 }
271 273
272 274 QColor QAreaSeries::color() const
@@ -185,10 +185,10 void QScatterSeries::setBrush(const QBrush &brush)
185 185 void QScatterSeries::setColor(const QColor &color)
186 186 {
187 187 QBrush b = brush();
188 if (b.color() != color) {
189 b.setColor(color);
190 setBrush(b);
191 }
188 if (b == QBrush())
189 b.setStyle(Qt::SolidPattern);
190 b.setColor(color);
191 setBrush(b);
192 192 }
193 193
194 194 QColor QScatterSeries::color() const
General Comments 0
You need to be logged in to leave comments. Login now